From f7ba4d7b92770fe449d093221ebbd5e0ddab9082 Mon Sep 17 00:00:00 2001 From: js0ny Date: Wed, 16 Apr 2025 20:33:42 +0100 Subject: [PATCH] feat(vim): Use `[g` to navigate git changes --- tools/nvim/lua/plugins/appearance.lua | 2 ++ tools/vscode/vscode.vimrc | 3 +++ 2 files changed, 5 insertions(+) diff --git a/tools/nvim/lua/plugins/appearance.lua b/tools/nvim/lua/plugins/appearance.lua index 91d54bf..3f3a463 100644 --- a/tools/nvim/lua/plugins/appearance.lua +++ b/tools/nvim/lua/plugins/appearance.lua @@ -86,6 +86,8 @@ return { { "gb", "Gitsigns blame", desc = "Blame file" }, { "gd", "Gitsigns diffthis", desc = "Diff file" }, { "gB", "Gitsigns toggle_current_line_blame", desc = "Toggle line blame" }, + { "[g", "Gitsigns prev_hunk", desc = "Prev hunk" }, + { "]g", "Gitsigns next_hunk", desc = "Next hunk" }, }, }, -- { -- Highlight and navigate between TODOs diff --git a/tools/vscode/vscode.vimrc b/tools/vscode/vscode.vimrc index d545641..c937c5d 100644 --- a/tools/vscode/vscode.vimrc +++ b/tools/vscode/vscode.vimrc @@ -71,6 +71,9 @@ noremap zR editor.foldAll vnoremap < editor.action.outdentLines vnoremap > editor.action.indentLines +nnoremap [g editor.action.editor.previousChange +nnoremap ]g editor.action.editor.nextChange + " 分词版本的w和b,支持中文,需要插件 " 为了保证递归解析,而不是打断,使用 `nmap` 而不是 `nnoremap` " Comment if you don't use cjk or the plugin