Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 1st, 2012  |  syntax: None  |  size: 0.28 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. in vim, move selection text appen into a specified file
  2. com! -nargs=1 -range Sbak call MoveSelectedLinesToFile(<f-args>)
  3. fun! MoveSelectedLinesToFile(filename)
  4.     exec "'<,'>w! >>" . a:filename
  5.     norm gvd
  6. endfunc
  7.        
  8. map <F2> :'<,'> w! >> /YOUR/SELECTIONFILE<cr>:'<,'>d<cr>