vim:keys:TODO: Handle errors when referencing commits

This commit is contained in:
2024-10-18 16:12:40 +02:00
parent 09f9ffbd8e
commit f9764de6d5

View File

@@ -140,6 +140,7 @@ nnoremap <expr> gp '`[' . strpart(getregtype(), 0, 1) . '`]'
" Mnemonic: "git reference commit"
" NOTE: This uses `system` and not `:r!` to insert the text directly at the
" cursor. `subject[:-2]` cuts off the trailing newline.
" TODO: print error message but insert nothing on git error
nmap <leader>grc :let subject=system('git show -s --format="(\"%s\")" <C-R><C-W>')<CR>viw<Esc>a <C-R>=subject[:-2]<CR><Esc>
" Insert a Signed-off-by trailer