On 01/14/13 10:15, Ben Fritz wrote:
I want to generate file1.txt, file2.txt, file3.txt from
file.txt with a mapping.

I open file.txt yank "a50Y another "b50Y another "c50Y

Look through :help :write and :help :write_f for the various ways
to write output to a file.

For example,

:7,42w >> blah.txt

Will append lines 7-42 of the current file to the end of existing
other file blah.txt

Also note that Ben's answer takes any arbitrary Vim range, so you can do things like

  :1,/SOME TOKEN/-1 w > file1.txt
  :1/SOME TOKEN/;/OTHER TOKEN/ w > file2.txt
  ...

which you can read about at ":help :range"

-tim




--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to