From 82dd9c85d55df7314ff9e58550b90ee03db2d351 Mon Sep 17 00:00:00 2001 From: jasmine Date: Tue, 13 May 2025 23:45:00 +0800 Subject: [PATCH] feat: replace buffer plugin with leader maps --- config/default.nix | 1 - config/keymaps.nix | 36 +++++++++++++++++++++++++++++ config/plugins/editor/bufdelete.nix | 20 ---------------- config/plugins/utils/whichkey.nix | 9 -------- 4 files changed, 36 insertions(+), 30 deletions(-) delete mode 100644 config/plugins/editor/bufdelete.nix diff --git a/config/default.nix b/config/default.nix index 17a48df..78f0bd9 100644 --- a/config/default.nix +++ b/config/default.nix @@ -11,7 +11,6 @@ ./plugins/cmp/cmp.nix # Editor plugins and configurations - ./plugins/editor/bufdelete.nix ./plugins/editor/comment.nix ./plugins/editor/treesitter.nix diff --git a/config/keymaps.nix b/config/keymaps.nix index b7fcfe7..4a456a5 100644 --- a/config/keymaps.nix +++ b/config/keymaps.nix @@ -10,5 +10,41 @@ 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 = ":bdelete"; + options = { + silent = true; + }; + } ]; } diff --git a/config/plugins/editor/bufdelete.nix b/config/plugins/editor/bufdelete.nix deleted file mode 100644 index 33b328a..0000000 --- a/config/plugins/editor/bufdelete.nix +++ /dev/null @@ -1,20 +0,0 @@ -{...}: { - plugins.bufdelete = { - enable = true; - }; - - keymaps = [ - { - mode = "n"; - key = "bd"; - action = "Bdelete"; - options.desc = "Buffer Delete"; - } - { - mode = "n"; - key = "bw"; - action = "Bwipeout"; - options.desc = "Buffer Wipeout"; - } - ]; -} diff --git a/config/plugins/utils/whichkey.nix b/config/plugins/utils/whichkey.nix index f226fd1..d88365d 100644 --- a/config/plugins/utils/whichkey.nix +++ b/config/plugins/utils/whichkey.nix @@ -14,15 +14,6 @@ }; } - { - mode = "n"; - key = "b"; - action = ""; - options = { - desc = "+buffer"; - }; - } - { mode = ["n" "v"]; key = "c";