Date: Fri, 29 Aug 2014 09:52:11 -0300 (ADT) From: Andrew Hamilton-Wright <AHamiltonWright@MtA.ca> To: Polytropon <freebsd@edvax.de> Cc: Jamie Griffin <griffin8j@gmail.com>, FreeBSD Questions <freebsd-questions@freebsd.org> Subject: Re: Moving Text In vi(1) To Another File Message-ID: <alpine.BSF.2.11.1408290949170.33406@qemg.org> In-Reply-To: <20140829104726.dc4aa238.freebsd@edvax.de> References: <540037DE.4030404@gmail.com> <20140829104726.dc4aa238.freebsd@edvax.de>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 29 Aug 2014, Polytropon wrote: > On Fri, 29 Aug 2014 09:20:46 +0100, Jamie Griffin wrote: >> What is the best way to copy large sections of text in a file and copy >> it to another file, possibly a new file or not. Is vi even the best >> utility to do that? > > The "best" utility is the one you're most familiar with, > regarding the particular task. Good advice. This is easy in vi, as 'w' (write) works essentially the same as (command-line) yank. Assuming you are yanking your data via something like: :100,200y (with 100 and 200 standing in as the line range), then you can simply do this instead :100,200w myNewFile or :100,200w /my/new/faraway/file if you want to include a path to the file. A
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.11.1408290949170.33406>