diff --git a/lua/nvimdev/core/keymaps.lua b/lua/nvimdev/core/keymaps.lua index ddedd31..dc28a1e 100644 --- a/lua/nvimdev/core/keymaps.lua +++ b/lua/nvimdev/core/keymaps.lua @@ -38,9 +38,8 @@ map("n", "", ":bprevious", opts) map("n", "", ":m .+1==gi", opts) map("n", "", ":m .-2==gi", opts) --- Esc to No Highlight +-- Others map("n", "", ":noh ", opts) -map("n", "e", " NvimTreeToggle ", opts) -- Insert -- -- Press kj fast to exit insert mode diff --git a/lua/nvimdev/plugin_config/init.lua b/lua/nvimdev/plugin_config/init.lua index c6567f6..abc3bac 100644 --- a/lua/nvimdev/plugin_config/init.lua +++ b/lua/nvimdev/plugin_config/init.lua @@ -8,3 +8,4 @@ require("nvimdev.plugin_config.color_config") require("nvimdev.plugin_config.nvimtree") require("nvimdev.plugin_config.barbar") require("nvimdev.plugin_config.lualine") +require("nvimdev.plugin_config.whichkey") diff --git a/lua/nvimdev/plugin_config/whichkey.lua b/lua/nvimdev/plugin_config/whichkey.lua new file mode 100644 index 0000000..f0fa340 --- /dev/null +++ b/lua/nvimdev/plugin_config/whichkey.lua @@ -0,0 +1,41 @@ +local wk = require("which-key") + +local mappings = { + { "N", " enew ", desc = "New buffer", nowait = true, remap = false }, + { "c", " BufferClose ", desc = "Close Buffer", nowait = true, remap = false }, + { "e", " NvimTreeToggle", desc = "Nvim Tree Toggle", nowait = true, remap = false }, + { "q", " q! ", desc = "Quit", nowait = true, remap = false }, + { "w", " w! ", desc = "Save", nowait = true, remap = false }, + + -- Buffer management using Barbar plugin + { "B", group = "Buffer", nowait = true, remap = false }, + { "Bc", " BufferCloseAllButCurrentOrPinned ", desc = "Delete Picked Buffer", nowait = true, remap = false }, + { "Bd", " BufferPickDelete ", desc = "Delete Picked Buffer", nowait = true, remap = false }, + { "Bf", " BufferFirst ", desc = "Move to First Buffer", nowait = true, remap = false }, + { "Bi", " BufferPick ", desc = "Buffer Pick", nowait = true, remap = false }, + { "Bl", " BufferLast ", desc = "Move to Last Buffer", nowait = true, remap = false }, + { "Bp", " BufferPin ", desc = "Pin/Unpin Buffer", nowait = true, remap = false }, + { "Bs", " BufferMoveStart ", desc = "Move Buffer to Start", nowait = true, remap = false }, + { "Bt", " BufferRestore ", desc = "Restore Buffer", nowait = true, remap = false }, + -- Buffer Ordering + { "Bo", group = "Order", nowait = true, remap = false }, + { "Bod", " BufferOrderByDirectory ", desc = "Order by Directory", nowait = true, remap = false }, + { "Bol", " BufferOrderByLanguage ", desc = "Order by Language", nowait = true, remap = false }, + { "Bon", " BufferOrderByBufferNumber ", desc = "Order by Buffer Number", nowait = true, remap = false }, + { "Bow", " BufferOrderByWindowNumber ", desc = "Order by Window Number", nowait = true, remap = false }, + + -- Update/Install plugins and languages extensions + { "s", group = "Update/Install", nowait = true, remap = false }, + -- For Lazy Plugin Manager + { "sl", group = "Lazy - Plugin Manager", nowait = true, remap = false }, + { "slc", " Lazy clean ", desc = "Clean", nowait = true, remap = false }, + { "sle", " Lazy health ", desc = "Health", nowait = true, remap = false }, + { "slh", " Lazy help ", desc = "Help", nowait = true, remap = false }, + { "slk", " Lazy check ", desc = "Check", nowait = true, remap = false }, + { "sll", " Lazy log ", desc = "Log", nowait = true, remap = false }, + { "slr", " Lazy reload ", desc = "Reload", nowait = true, remap = false }, + { "sls", " Lazy sync ", desc = "Sync", nowait = true, remap = false }, + { "slu", " Lazy update ", desc = "Update", nowait = true, remap = false }, +} + +wk.add(mappings)