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