Skip to content

Commit

Permalink
Add gitsigns recommended keymaps as an optional plugin (nvim-lua#858)
Browse files Browse the repository at this point in the history
  • Loading branch information
dam9000 authored and eunmann committed Aug 21, 2024
1 parent 271030f commit 0a06487
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -286,15 +286,19 @@ require('lazy').setup({
require('which-key').setup()

-- Document existing key chains
require('which-key').add {
{ '<leader>c', group = '[C]ode' },
{ '<leader>d', group = '[D]ocument' },
{ '<leader>r', group = '[R]ename' },
{ '<leader>s', group = '[S]earch' },
{ '<leader>w', group = '[W]orkspace' },
{ '<leader>t', group = '[T]oggle' },
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
require('which-key').register {
['<leader>c'] = { name = '[C]ode', _ = 'which_key_ignore' },
['<leader>d'] = { name = '[D]ocument', _ = 'which_key_ignore' },
['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' },
['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' },
['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' },
['<leader>t'] = { name = '[T]oggle', _ = 'which_key_ignore' },
['<leader>h'] = { name = 'Git [H]unk', _ = 'which_key_ignore' },
}
-- visual mode
require('which-key').register({
['<leader>h'] = { 'Git [H]unk' },
}, { mode = 'v' })
end,
},

Expand Down Expand Up @@ -894,6 +898,7 @@ require('lazy').setup({
-- require 'kickstart.plugins.lint',
-- require 'kickstart.plugins.autopairs',
-- require 'kickstart.plugins.neo-tree',
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps

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

0 comments on commit 0a06487

Please sign in to comment.