Skip to content

Instantly share code, notes, and snippets.

Created November 26, 2012 21:19
Show Gist options
  • Save anonymous/4150687 to your computer and use it in GitHub Desktop.
Save anonymous/4150687 to your computer and use it in GitHub Desktop.
vnoremap <leader>d :call Test()<CR>
function! Test()
"yank current visual selection to reg x
normal! gv"xy
"put new string value in reg y
let @y = " IF (DEBUG.GT.0) THEN\n" . @x . "\n ENDIF"
"re-select area and delete
normal! gvd
"paste new string value back in
normal! "yp
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment