fuzzylogic25 wrote:
> I tried  :g/cat/.w! >> out.txt
>
> The problem with this is, for each time it finds one
> occurrence of cat, it then appends it to out.txt. So for each
> occurrence, the hard disk head moves. This causes alot of
> mechanical movements.

You can put all the lines into a register as shown in earlier
replies. You can easily paste the register into a new file and
save it.

  qaq        (trick to clear register a)
  :g/pattern/y A
  Ctrl-W n   (press Ctrl-W then n for a new window)
  "ap        (paste register a into the new windo)
  :w my.txt  (save in file my.txt)

Tim's suggestion of redir is a also good solution, and more
general.

John

-- 
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