Last active
March 17, 2023 13:02
-
-
Save wellle/9289224 to your computer and use it in GitHub Desktop.
Commands to append after (and insert before) any text object. http://redd.it/1z93ww
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nnoremap <silent> <Leader>a :set opfunc=Append<CR>g@ | |
nnoremap <silent> <Leader>i :set opfunc=Insert<CR>g@ | |
function! Append(type, ...) | |
call feedkeys("`]a", 'n') | |
endfunction | |
function! Insert(type, ...) | |
call feedkeys("`[i", 'n') | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This does weird things if you try to append to a multi-line textobject (like
ip
). You might find it preferable to make it start a new line, like this: