Skip to content

Commit

Permalink
feat(nvim): use bufdelete.nvim
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Sep 21, 2023
1 parent 02d5e73 commit 16b3b78
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/neovim/config/lua/user/keymaps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ keymap("n", "<A-Right>", ":vertical resize +2<CR>", opts)
keymap("n", "<S-l>", ":bnext<CR>", opts)
keymap("n", "<S-h>", ":bprevious<CR>", opts)

keymap("n", "<leader>q", ":bd!<cr>", opts) -- delete current buffer
keymap("n", "<leader>q", function()
require("bufdelete").bufdelete(0, true)
end, opts) -- delete current buffer

keymap("n", "<leader>bad", ":%bd!<cr>", opts) -- delete all buffers
-- delete surrounding buffers, make sure to keep the cursor position
keymap("n", "<leader>bsd", function()
Expand Down
1 change: 1 addition & 0 deletions modules/neovim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ in
telescope-nvim
telescope-github-nvim
auto-hlsearch-nvim
bufdelete-nvim
vim-tmux-navigator
better-escape-nvim

Expand Down

0 comments on commit 16b3b78

Please sign in to comment.