Monday, February 21, 2011

Re: Including into the current buffer from an external source

On Mon, Feb 21, 2011 at 09:29:15AM +0100, Christian Brabandt wrote:
> On Sa, 19 Feb 2011, Rostyslaw Lewyckyj wrote:
> > Christian Brabandt wrote:
> >>
> > Well sort of. :read inserts the whole file after the current line.
> > But my memory insists that there is/was a way to select a specified
> > range of records from the source file and insert them at a specific
> > place in the current file. For example: Insert records 25 through 50
> > from file source.txt after record 101 of the current buffer.

That can be done with:

:r! head -n 50 <filename> | tail -n 25

(And the benefit is that the editor doesn't require its own odd syntax
to do the job.)

Erik

--
It would be a big help if you asked the question that I was answering. :)
- Kirk Wallace on emc-users

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

No comments: