Delete and redirect lines in Vim to another file
问题 I want to delete say last 10 lines and move it to another file. What I currently do is: select last 10 lines in visual mode, write these lines by :'<,'>w to other file, and then delete selected lines. Is there any more efficient way I can do this? 回答1: You can use ex commands instead. e.g. :1,10w file.name Write the first ten lines :$-9,$w file.name Write the last ten lines (the dollar sign denotes last line) With the code below in your .vimrc you can use the command :MoveTo file.name