Skip to content

Instantly share code, notes, and snippets.

@esquifit
Forked from wellle/append.vim
Created January 24, 2017 12:49
Show Gist options
  • Save esquifit/e8eb85e48f3d76fa56aae0ef823149ca to your computer and use it in GitHub Desktop.
Save esquifit/e8eb85e48f3d76fa56aae0ef823149ca to your computer and use it in GitHub Desktop.
Commands to append after (and insert before) any text object. http://redd.it/1z93ww
nnoremap <silent> <Leader>a :set opfunc=<SID>Append<CR>g@
nnoremap <silent> <Leader>i :set opfunc=<SID>Insert<CR>g@
fun! s:Append(type,...)
call feedkeys( a:type == 'char' ? "`]a" : "`]o" , 'tn')
endf
fun! s:Insert(type,...)
call feedkeys( a:type == 'char' ? "`[i" : "`[O" , 'tn')
endf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment