diff --git a/.config/vim/vimrc.d/40-keys.vim b/.config/vim/vimrc.d/40-keys.vim index e918cd7..a6e71ff 100644 --- a/.config/vim/vimrc.d/40-keys.vim +++ b/.config/vim/vimrc.d/40-keys.vim @@ -113,7 +113,9 @@ nnoremap gp '`[' . strpart(getregtype(), 0, 1) . '`]' " Git bindings " Insert a commit's subject behind the SHA1 that the cursor is currently on. " Mnemonic: "git reference commit" -nmap grc yiweak:r!git show -s --format='("\%s")' 0kJJ +" NOTE: This uses `system` and not `:r!` to insert the text directly at the +" cursor. `subject[:-2]` cuts off the trailing newline. +nmap grc :let subject=system('git show -s --format="(\"%s\")" ')ea =subject[:-2] if exists('g:loaded_fugitive') nmap gc :G commit