add quickfix and location list mappings for gitsigns
Added key mappings to send all hunks to the quickfix list and buffer hunks to the location list for improved navigation and management of git changes.
This commit is contained in:
parent
4e9e22da00
commit
5e3a14596d
|
|
@ -182,6 +182,8 @@ Buffer-local keymaps available when inside a git repository:
|
|||
| n | `<leader>hp` | Preview hunk |
|
||||
| n | `<leader>hd` | Diff against index |
|
||||
| n | `<leader>hD` | Diff against previous commit (`~`) |
|
||||
| n | `<leader>hq` | Send all hunks to quickfix list |
|
||||
| n | `<leader>hl` | Send buffer hunks to location list |
|
||||
| o/x | `ih` | Text object: select git hunk |
|
||||
|
||||
### Telescope `lua/plugins/telescope.lua`
|
||||
|
|
|
|||
|
|
@ -50,6 +50,10 @@ return {
|
|||
map('n', '<leader>hd', gs.diffthis, { desc = 'Gitsigns: Diff this' })
|
||||
map('n', '<leader>hD', function() gs.diffthis('~') end, { desc = 'Gitsigns: Diff this ~' })
|
||||
|
||||
-- Quickfix/Location list
|
||||
map('n', '<leader>hq', function() gs.setqflist('all') end, { desc = 'Gitsigns: All hunks to quickfix' })
|
||||
map('n', '<leader>hl', function() gs.setloclist(0) end, { desc = 'Gitsigns: Buffer hunks to loclist' })
|
||||
|
||||
-- Text object
|
||||
map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>', { desc = 'Gitsigns: Select hunk' })
|
||||
end,
|
||||
|
|
|
|||
Loading…
Reference in New Issue