idk what all...

This commit is contained in:
2026-06-22 22:06:23 +00:00
parent 97dd524fa3
commit f21da90f44
6 changed files with 56 additions and 18 deletions
+19 -1
View File
@@ -8,7 +8,25 @@ vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left wind
vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' })
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
vim.keymap.set('n', '<C-q>', '<cmd>close<CR>', { desc = 'Close window' })
vim.keymap.set('n', '<C-q>', function()
local wins = vim.tbl_filter(function(win)
return vim.api.nvim_win_get_config(win).relative == ''
end, vim.api.nvim_tabpage_list_wins(0))
if #wins > 1 then
vim.cmd('close')
else
local buffers = vim.tbl_filter(function(buf)
return vim.api.nvim_buf_is_valid(buf) and vim.bo[buf].buflisted
end, vim.api.nvim_list_bufs())
if #buffers > 1 then
vim.cmd('bdelete')
else
vim.cmd('q')
end
end
end, { desc = 'Close split, buffer, or exit' })
vim.keymap.set('n', '<C-\\>', '<cmd>vsplit<CR>', { desc = 'Vertical split' })
vim.keymap.set('n', '<C-S-\\>', '<cmd>split<CR>', { desc = 'Horizontal split' })
vim.keymap.set('n', '<leader>po', '<cmd>only<CR>', { desc = 'Only pane' })