summaryrefslogtreecommitdiff
path: root/lua/lv-which-key/config.lua
diff options
context:
space:
mode:
authorAnders N. Slinde <[email protected]>2021-07-11 09:54:02 +0200
committerGitHub <[email protected]>2021-07-11 12:24:02 +0430
commitccb0cd27b2eca759993b5e74190e2df1ca6b99a1 (patch)
tree023db658e035bfb73d08997e17c43cc9673f10de /lua/lv-which-key/config.lua
parent5fcd7079e518dd48fd40a3042b29a322643a4636 (diff)
Refactor whichkey config to make all keys overridable in user config (#813)
Diffstat (limited to 'lua/lv-which-key/config.lua')
-rw-r--r--lua/lv-which-key/config.lua30
1 files changed, 21 insertions, 9 deletions
diff --git a/lua/lv-which-key/config.lua b/lua/lv-which-key/config.lua
index bd244d74..d4c3f6bd 100644
--- a/lua/lv-which-key/config.lua
+++ b/lua/lv-which-key/config.lua
@@ -45,16 +45,28 @@ O.plugin.which_key = {
noremap = true, -- use `noremap` when creating keymaps
nowait = true, -- use `nowait` when creating keymaps
},
+ vopts = {
+ mode = "v", -- VISUAL mode
+ prefix = "<leader>",
+ buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
+ silent = true, -- use `silent` when creating keymaps
+ noremap = true, -- use `noremap` when creating keymaps
+ nowait = true, -- use `nowait` when creating keymaps
+ },
+ -- NOTE: Prefer using : over <cmd> as the latter avoids going back in normal-mode.
+ -- see https://neovim.io/doc/user/map.html#:map-cmd
+ vmappings ={
+ ["/"] = { ":CommentToggle<CR>", "Comment" },
+ },
mappings = {
- ["w"] = "Save",
- ["q"] = "Quit",
- ["."] = "LunarConfig",
- ["/"] = "Comment",
- ["c"] = "Close Buffer",
- ["e"] = "Explorer",
- ["f"] = "Find File",
- ["h"] = "No Highlight",
- [";"] = "Dashboard",
+ ["w"] = { "<cmd>w!<CR>", "Save" },
+ ["q"] = { "<cmd>q!<CR>", "Quit" },
+ ["/"] = { "<cmd>CommentToggle<CR>", "Comment" },
+ ["c"] = { "<cmd>BufferClose<CR>", "Close Buffer" },
+ ["e"] = { "<cmd>lua require'lv-nvimtree'.toggle_tree()<CR>", "Explorer" },
+ ["f"] = { "<cmd>Telescope find_files<CR>", "Find File" },
+ ["h"] = { '<cmd>let @/=""<CR>', "No Highlight" },
+ [";"] = { "<cmd>Dashboard<CR>", "Dashboard" },
p = {
name = "Packer",
c = { "<cmd>PackerCompile<cr>", "Compile" },