feat(vim): Use [g to navigate git changes

This commit is contained in:
js0ny 2025-04-16 20:33:42 +01:00
parent 78400e4a6a
commit f7ba4d7b92
2 changed files with 5 additions and 0 deletions

View file

@ -86,6 +86,8 @@ return {
{ "<leader>gb", "<cmd>Gitsigns blame<CR>", desc = "Blame file" }, { "<leader>gb", "<cmd>Gitsigns blame<CR>", desc = "Blame file" },
{ "<leader>gd", "<cmd>Gitsigns diffthis<CR>", desc = "Diff file" }, { "<leader>gd", "<cmd>Gitsigns diffthis<CR>", desc = "Diff file" },
{ "<leader>gB", "<cmd>Gitsigns toggle_current_line_blame<CR>", desc = "Toggle line blame" }, { "<leader>gB", "<cmd>Gitsigns toggle_current_line_blame<CR>", desc = "Toggle line blame" },
{ "[g", "<cmd>Gitsigns prev_hunk<CR>", desc = "Prev hunk" },
{ "]g", "<cmd>Gitsigns next_hunk<CR>", desc = "Next hunk" },
}, },
}, },
-- { -- Highlight and navigate between TODOs -- { -- Highlight and navigate between TODOs

View file

@ -71,6 +71,9 @@ noremap zR editor.foldAll
vnoremap < editor.action.outdentLines vnoremap < editor.action.outdentLines
vnoremap > editor.action.indentLines vnoremap > editor.action.indentLines
nnoremap [g editor.action.editor.previousChange
nnoremap ]g editor.action.editor.nextChange
" 分词版本的w和b支持中文需要插件 " 分词版本的w和b支持中文需要插件
" 为了保证递归解析,而不是打断,使用 `nmap` 而不是 `nnoremap` " 为了保证递归解析,而不是打断,使用 `nmap` 而不是 `nnoremap`
" Comment if you don't use cjk or the plugin " Comment if you don't use cjk or the plugin