From 5ab97d6111a4d64070a11cf04139ab272036d80d Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Sat, 27 Aug 2022 16:48:34 +0200 Subject: [PATCH] vim:keys: Map `gg` only with fugitive --- .config/vim/vimrc.d/40-keys.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/vim/vimrc.d/40-keys.vim b/.config/vim/vimrc.d/40-keys.vim index 77212e1..32ce61f 100644 --- a/.config/vim/vimrc.d/40-keys.vim +++ b/.config/vim/vimrc.d/40-keys.vim @@ -89,8 +89,6 @@ nnoremap gp '`[' . strpart(getregtype(), 0, 1) . '`]' " Git bindings -nmap gg :G - " Insert a commit's subject behind the SHA1 that the cursor is currently on. " Mnemonic: "git reference commit" " NOTE: This uses `system` and not `:r!` to insert the text directly at the @@ -103,6 +101,8 @@ nmap gs :!git stash -- % nmap gu :!git checkout -- % if exists('g:loaded_fugitive') + " Interactive `git status` + nmap gg :G " Using fugitive.vim, start a commit and open the message in a new split nmap gc :G commit " Move to root of directory