Skip to content

Commit

Permalink
ftplugin/gitrebase.vim: smart K map
Browse files Browse the repository at this point in the history
If K is pressed at the beginning of the line, call it instead on the
following hash.
  • Loading branch information
tpope committed Apr 16, 2008
1 parent 4819a1a commit b169850
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ftplugin/gitrebase.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin
" Language: git rebase --interactive
" Maintainer: Tim Pope <vimNOSPAM@tpope.info>
" Last Change: 2008 Feb 27
" Last Change: 2008 Apr 16

" Only do this when not done yet for this buffer
if (exists("b:did_ftplugin"))
Expand All @@ -16,3 +16,11 @@ if !exists("b:undo_ftplugin")
let b:undo_ftplugin = ""
endif
let b:undo_ftplugin = b:undo_ftplugin."|setl com< cms< fo<"

if exists("g:no_plugin_maps") || exists("g:no_gitrebase_maps")
finish
endif

nnoremap <buffer> <expr> K col('.') < 7 && expand('<Lt>cword>') =~ '\X' && getline('.') =~ '^\w\+\s\+\x\+\>' ? 'wK' : 'K'
let b:undo_ftplugin = b:undo_ftplugin . "|nunmap <buffer> K"

0 comments on commit b169850

Please sign in to comment.