[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: VI Tricks
On Tue, Apr 16, 2002 at 03:07:30PM -0500 or thereabouts, James L. Burke wrote:
> Gary,
>
> Is it possible to yank only part of lines? example half of line 2, all of lines 3-6, and half of line 7 ...
Yes it is by using the w .. which stands for word.. you can yank
'n'words to the buffer... i.e. y6w would move the next 6 words into the
un-named buffer. So, if you cursor was in the middle, you would just
count the words to the end of the line, then use this command. However,
I have found it much easier to just yank and paste lines, then you can
delete what you do not want... if the cursor is at the beginning of the
new pasted line, and you want to delete the first 5 words, just d5w. You
can then reformat the paragraph by doing a ESC gqip or gqj
Or... you could do a ESC d^ which would delete from the cursor position
to the beginning of the line. Whatever you just have deleted is kept in
the un-named buffer.. ESC D (that is Capital D) deletes from cursor
position to end of line.
> I often find myself wanting parts of multiple lines and that is why I
> end up using the "v" or visual method. (I don't have mouse support
> enabled on some of the machines I log into) Maybe there is a faster
> way than highlighting to accomplish this?
I understand..using Visual combined with letters for cursor movement,
etc, would work well for you.,.
--
Best regards,
Gary
-
To unsubscribe, send email to majordomo@silug.org with
"unsubscribe silug-discuss" in the body.