bufdelete: delete buffer without messing up windows

This commit is contained in:
xinyangli 2024-12-10 12:40:33 +08:00
parent 493148c3b8
commit aea55dcd6c
Signed by: xin
SSH key fingerprint: SHA256:UU5pRTl7NiLFJbWJZa+snLylZSXIz5rgHmwjzv8v4oE
6 changed files with 37 additions and 19 deletions

View file

@ -1,6 +1,6 @@
# Nixvim
## TODO
[ ] Open last active buffer after :bd
[ ] Code action
[ ] DAP support
- [ ] Open last active buffer after :bd
- [ ] Code action
- [ ] DAP support

View file

@ -0,0 +1,23 @@
{ helpers, ... }:
{
plugins = {
bufdelete = {
enable = true;
};
};
keymaps = [
{
mode = [ "n" ];
key = "<C-x>";
action = helpers.mkRaw ''
function()
require("bufdelete").bufdelete(0, false)
end
'';
options = {
desc = "Toggle terminal";
};
}
];
}

View file

@ -1,6 +1,7 @@
{
# Import all your configuration modules here
imports = [
./buffer/bufdelete.nix
./blink.nix
./bufferline.nix
./comment.nix
@ -15,7 +16,6 @@
./lsp
./lualine.nix
./neo-tree.nix
# ./nvim-cmp.nix
# ./project.nix
./rainbow-delimiters.nix
./telescope.nix
@ -23,6 +23,5 @@
./treesitter.nix
./which-key.nix
];
plugins.web-devicons.enable = true;
}

View file

@ -83,14 +83,5 @@
desc = "Next Buffer";
};
}
{
mode = [ "n" "i" ];
key = "<S-Tab>";
action = "<cmd>tabprevious<cr>";
options = {
desc = "Previous Tab";
};
}
];
}

View file

@ -6,7 +6,10 @@
};
keymaps = [
{
mode = [ "n" "i" ];
mode = [
"n"
"i"
];
key = "<C-p>";
action = helpers.mkRaw ''
function()
@ -18,11 +21,14 @@
};
}
{
mode = [ "n" "i" ];
mode = [
"n"
"i"
];
key = "<C-S-p>";
action = helpers.mkRaw ''
function()
require("telescope.builtin").help_tags()
require("telescope.builtin").live_grep()
end
'';
}

View file

@ -4,7 +4,6 @@
};
keymaps = [
{
mode = [ "n" ];
key = "<leader>tt";