Skip to content

Commit

Permalink
Fixed which-key bug which was not showing
Browse files Browse the repository at this point in the history
  • Loading branch information
prrockzed committed Oct 1, 2024
1 parent fffca8d commit b636a6c
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
3 changes: 1 addition & 2 deletions lua/nvimdev/core/keymaps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ map("n", "<S-h>", ":bprevious<CR>", opts)
map("n", "<S-j>", "<Esc>:m .+1<CR>==gi", opts)
map("n", "<S-k>", "<Esc>:m .-2<CR>==gi", opts)

-- Esc to No Highlight
-- Others
map("n", "<Esc>", ":noh <CR>", opts)
map("n", "<Space>e", "<cmd> NvimTreeToggle <CR>", opts)

-- Insert --
-- Press kj fast to exit insert mode
Expand Down
1 change: 1 addition & 0 deletions lua/nvimdev/plugin_config/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
41 changes: 41 additions & 0 deletions lua/nvimdev/plugin_config/whichkey.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
local wk = require("which-key")

local mappings = {
{ "<leader>N", "<cmd> enew <CR>", desc = "New buffer", nowait = true, remap = false },
{ "<leader>c", "<cmd> BufferClose <CR>", desc = "Close Buffer", nowait = true, remap = false },
{ "<leader>e", "<cmd> NvimTreeToggle<cr>", desc = "Nvim Tree Toggle", nowait = true, remap = false },
{ "<leader>q", "<cmd> q! <CR>", desc = "Quit", nowait = true, remap = false },
{ "<leader>w", "<cmd> w! <CR><CR>", desc = "Save", nowait = true, remap = false },

-- Buffer management using Barbar plugin
{ "<leader>B", group = "Buffer", nowait = true, remap = false },
{ "<leader>Bc", "<cmd> BufferCloseAllButCurrentOrPinned <CR>", desc = "Delete Picked Buffer", nowait = true, remap = false },
{ "<leader>Bd", "<cmd> BufferPickDelete <CR>", desc = "Delete Picked Buffer", nowait = true, remap = false },
{ "<leader>Bf", "<cmd> BufferFirst <CR>", desc = "Move to First Buffer", nowait = true, remap = false },
{ "<leader>Bi", "<cmd> BufferPick <CR>", desc = "Buffer Pick", nowait = true, remap = false },
{ "<leader>Bl", "<cmd> BufferLast <CR>", desc = "Move to Last Buffer", nowait = true, remap = false },
{ "<leader>Bp", "<cmd> BufferPin <CR>", desc = "Pin/Unpin Buffer", nowait = true, remap = false },
{ "<leader>Bs", "<cmd> BufferMoveStart <CR>", desc = "Move Buffer to Start", nowait = true, remap = false },
{ "<leader>Bt", "<cmd> BufferRestore <CR>", desc = "Restore Buffer", nowait = true, remap = false },
-- Buffer Ordering
{ "<leader>Bo", group = "Order", nowait = true, remap = false },
{ "<leader>Bod", "<cmd> BufferOrderByDirectory <CR>", desc = "Order by Directory", nowait = true, remap = false },
{ "<leader>Bol", "<cmd> BufferOrderByLanguage <CR>", desc = "Order by Language", nowait = true, remap = false },
{ "<leader>Bon", "<cmd> BufferOrderByBufferNumber <CR>", desc = "Order by Buffer Number", nowait = true, remap = false },
{ "<leader>Bow", "<cmd> BufferOrderByWindowNumber <CR>", desc = "Order by Window Number", nowait = true, remap = false },

-- Update/Install plugins and languages extensions
{ "<leader>s", group = "Update/Install", nowait = true, remap = false },
-- For Lazy Plugin Manager
{ "<leader>sl", group = "Lazy - Plugin Manager", nowait = true, remap = false },
{ "<leader>slc", "<cmd> Lazy clean <CR>", desc = "Clean", nowait = true, remap = false },
{ "<leader>sle", "<cmd> Lazy health <CR>", desc = "Health", nowait = true, remap = false },
{ "<leader>slh", "<cmd> Lazy help <CR>", desc = "Help", nowait = true, remap = false },
{ "<leader>slk", "<cmd> Lazy check <CR>", desc = "Check", nowait = true, remap = false },
{ "<leader>sll", "<cmd> Lazy log <CR>", desc = "Log", nowait = true, remap = false },
{ "<leader>slr", "<cmd> Lazy reload <CR>", desc = "Reload", nowait = true, remap = false },
{ "<leader>sls", "<cmd> Lazy sync <CR>", desc = "Sync", nowait = true, remap = false },
{ "<leader>slu", "<cmd> Lazy update <CR>", desc = "Update", nowait = true, remap = false },
}

wk.add(mappings)

0 comments on commit b636a6c

Please sign in to comment.