1
0
Fork 0

neovim: Only auto-decide splits for tag jumps

This commit is contained in:
Jeremy Kaplan 2025-10-19 16:02:37 -04:00
commit a6e8e6a702

View file

@ -88,7 +88,13 @@ vim.keymap.set("", ';0', ":close<CR>")
vim.keymap.set("", '<Leader>w', ":w<CR>") vim.keymap.set("", '<Leader>w', ":w<CR>")
vim.keymap.set("n", "<C-w>]", ":rightbelow wincmd ]<CR>") vim.keymap.set("n", "<C-w>]", function()
if vim.api.nvim_win_get_width(0) > 2 * 80 then
vim.cmd('vertical wincmd ]')
else
vim.cmd('horizontal wincmd ]')
end
end)
-- TODO: Delete these ; fake-leader bindings -- TODO: Delete these ; fake-leader bindings
vim.keymap.set("", ';w', ":w<CR>") vim.keymap.set("", ';w', ":w<CR>")
@ -136,17 +142,4 @@ vim.keymap.set("n", "<C-l>", function()
vim.cmd.redraw() vim.cmd.redraw()
end) end)
-- Split windows vertically if there's enough width for two "full size" panes.
-- Otherwise, split horizontally.
vim.api.nvim_create_autocmd('WinNew', {
callback = function()
if vim.fn.win_gettype(0) ~= '' then
return
end
if vim.api.nvim_win_get_width(0) > 2 * 80 then
vim.cmd.wincmd(vim.o.splitright and 'L' or 'H')
end
end
})
vim.diagnostic.config({ jump = { float = true } }) vim.diagnostic.config({ jump = { float = true } })