From: Samir Benmendil Date: Fri, 11 Mar 2022 08:38:53 +0000 (+0000) Subject: vim: reinstate K -> "git show" map in gitrebase X-Git-Url: https://git.rmz.io/dotfiles.git/commitdiff_plain/bccff5a0e15cd16d28cfb5e0d9fc2b0c4687e55d vim: reinstate K -> "git show" map in gitrebase This got removed upstream, but I found it really useful. There might be a better way of doing this, but this works. --- diff --git a/vim/ftplugin/gitrebase.vim b/vim/ftplugin/gitrebase.vim index 08a1740..897aaf6 100644 --- a/vim/ftplugin/gitrebase.vim +++ b/vim/ftplugin/gitrebase.vim @@ -6,3 +6,11 @@ nnoremap e :Edit nnoremap r :Reword nnoremap f :Fixup nnoremap d :Drop + +" used to be part of vim, now removed see +" https://github.com/tpope/vim-git/commit/3a96b1bca +" https://github.com/tpope/vim-git/commit/6ee5e1f20 +let &l:keywordprg = 'git show' +nnoremap K col('.') < 7 && expand('cword>') =~ '\X' && getline('.') =~ '^\w\+\s\+\x\+\>' ? 'wK' : 'K' + +let b:undo_ftplugin = "setl keywordprg< |exe 'nunmap K'"