Skip to content

Commit 0a06487

Browse files
dam9000eunmann
authored andcommitted
Add gitsigns recommended keymaps as an optional plugin (nvim-lua#858)
1 parent 271030f commit 0a06487

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

init.lua

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -286,15 +286,19 @@ require('lazy').setup({
286286
require('which-key').setup()
287287

288288
-- Document existing key chains
289-
require('which-key').add {
290-
{ '<leader>c', group = '[C]ode' },
291-
{ '<leader>d', group = '[D]ocument' },
292-
{ '<leader>r', group = '[R]ename' },
293-
{ '<leader>s', group = '[S]earch' },
294-
{ '<leader>w', group = '[W]orkspace' },
295-
{ '<leader>t', group = '[T]oggle' },
296-
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
289+
require('which-key').register {
290+
['<leader>c'] = { name = '[C]ode', _ = 'which_key_ignore' },
291+
['<leader>d'] = { name = '[D]ocument', _ = 'which_key_ignore' },
292+
['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' },
293+
['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' },
294+
['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' },
295+
['<leader>t'] = { name = '[T]oggle', _ = 'which_key_ignore' },
296+
['<leader>h'] = { name = 'Git [H]unk', _ = 'which_key_ignore' },
297297
}
298+
-- visual mode
299+
require('which-key').register({
300+
['<leader>h'] = { 'Git [H]unk' },
301+
}, { mode = 'v' })
298302
end,
299303
},
300304

@@ -894,6 +898,7 @@ require('lazy').setup({
894898
-- require 'kickstart.plugins.lint',
895899
-- require 'kickstart.plugins.autopairs',
896900
-- require 'kickstart.plugins.neo-tree',
901+
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
897902

898903
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
899904
-- This is the easiest way to modularize your config.

0 commit comments

Comments
 (0)