nix/home/file/nvim/module/key/Buffer.nix

17 lines
346 B
Nix
Raw Normal View History

2024-11-04 04:37:29 +03:00
{ ... }: {
text = ''
-- New empty buffer.
remap_normal("<Leader>n", "<cmd>enew<cr>")
2024-04-06 03:03:58 +03:00
2024-11-04 04:37:29 +03:00
-- Close buffer.
function _buf_close()
pcall(vim.cmd, "w")
vim.cmd[[bp|sp|bn|bd!]]
end
rekey_normal("<Leader>x", "<cmd>lua _buf_close()<cr>")
2024-04-06 03:03:58 +03:00
2024-11-04 04:37:29 +03:00
-- Close all hidden buffers.
rekey_normal("<Leader>X", "<cmd>BDelete hidden<cr><C-l>")
'';
2024-04-06 03:03:58 +03:00
}