nix/module/common/nvim/key/Buffer.lua
2024-03-04 03:04:57 +03:00

13 lines
297 B
Lua

-- New empty buffer.
remap_normal("<Leader>n", "<cmd>enew<cr>")
-- 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>")
-- Close all hidden buffers.
rekey_normal("<Leader>X", "<cmd>BDelete hidden<cr><C-l>")