diff --git a/config/default.nix b/config/default.nix index 7b5b384..3c8edba 100644 --- a/config/default.nix +++ b/config/default.nix @@ -11,6 +11,7 @@ ./plugins/cmp/cmp.nix # Editor plugins and configurations + ./plugins/editor/buffers.nix ./plugins/editor/comment.nix ./plugins/editor/treesitter.nix diff --git a/config/keymaps.nix b/config/keymaps.nix index 827588c..2266688 100644 --- a/config/keymaps.nix +++ b/config/keymaps.nix @@ -46,42 +46,5 @@ silent = true; }; } - - { # buffer prefix - mode = "n"; - key = "b"; - action = ""; - options = { - desc = "+buffer"; - }; - } - - { # goto next buffer - mode = ["n"]; - key = "bn"; - action = ":bnext"; - options = { - silent = true; - }; - } - - { # goto previous buffer - mode = ["n"]; - key = "bp"; - action = ":bprevious"; - options = { - silent = true; - }; - } - - { # delete buffer - mode = ["n"]; - key = "bd"; - action = ":b#bd#"; - options = { - desc = ":bdelete"; - silent = true; - }; - } ]; } diff --git a/config/plugins/editor/buffers.nix b/config/plugins/editor/buffers.nix new file mode 100644 index 0000000..6a629d4 --- /dev/null +++ b/config/plugins/editor/buffers.nix @@ -0,0 +1,59 @@ +{...}: { + plugins.bufdelete = { + enable = true; + }; + + keymaps = [ + { + # buffer prefix + mode = "n"; + key = "b"; + action = ""; + options = { + desc = "+buffer"; + }; + } + + { + # goto next buffer + mode = ["n"]; + key = "bn"; + action = ":bnext"; + options = { + silent = true; + }; + } + + { + # goto previous buffer + mode = ["n"]; + key = "bp"; + action = ":bprevious"; + options = { + silent = true; + }; + } + + { + # delete buffer + mode = ["n"]; + key = "bd"; + action = ":Bdelete"; + options = { + desc = "bdelete"; + silent = true; + }; + } + + { + # wipeout buffer + mode = ["n"]; + key = "bw"; + action = ":Bwipeout"; + options = { + desc = "bwipeout"; + silent = true; + }; + } + ]; +}