Monday, January 14, 2013

Re: Yank part of line?

On Saturday, January 12, 2013 8:52:50 PM UTC-6, Jack Gates wrote:
> This appears to be the only thing in help that seems to imply you can
>
> yank part of a line. But I can't figure out how to make that work. Am
>
> I wrong about this? Is the only way to yank part of a line in visual
>
> mode only or search and replace if one gets technical?
>
>
>
> *y* *yank*
>
> ["x]y{motion} Yank {motion} text [into register x]. When no
>
> characters are to be yanked (e.g., "y0" in column 1),
>
> this is an error when 'cpoptions' includes the 'E'
>
> flag.

Many of the responses you got have pointed out that you can 'y' followed by any number of commands to yank specific text from a line.

This is true for most normal-mode commands.

I saw a description once that said using Vim is about having a conversation with your editor.

Commands like 'y' and 'd' are "verbs" and motions are the "nouns". 'y' or 'd' or 'c' or '=' or many other commands all tell Vim what to *do*, but you need to tell Vim what to *do it on*.

I may be remembering this writing from the author of the excellent Gundo plugin (and others), although I can't find a reference to having a conversation with the editor here:

http://stevelosh.com/blog/2010/09/coming-home-to-vim/

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