Last active
August 29, 2015 14:21
-
-
Save dahu/2b13271f26d091e5a1b3 to your computer and use it in GitHub Desktop.
Wrap visual selection
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
" Barry Arthur May 2015 | |
function! VisualWrap(front, back) | |
exe "'<s/\\%V/" . a:front | |
exe "'>s/\\%V.*\\%V.\\zs/" . a:back | |
exe "'>s/\\ze\\n/" . a:back | |
endfunction | |
vnoremap <leader>x :<c-u>call VisualWrap('front', 'back')<cr> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment