Insertar texto seleccionado a archivo vim
You can do it in three steps:
- type
Shift-vj...jto select some lines - type
:'<,'>w! >>file.bakto save selected lines to file.bak(append) - type gvd to delete original lines
You can write a user-defined command Sbak if you like:
com! -nargs=1 -range Sbak call MoveSelectedLinesToFile() fun! MoveSelectedLinesToFile(filename) exec “’<,’>w! »” . a:filename norm gvd endfunc