Saturday, September 11, 2010

Re: How to copy the name of the variable / function under the cursor?

Ответ на сообщение «Re: How to copy the name of the variable / function under
the cursor?»,
присланное в 21:15:24 11 сентября 2010, Суббота,
отправитель Ven Tadipatri:

> I'm sorry - I'm not understanding what you're doing here. Wouldn't 'i'
> put you into insert mode and then there would be a 'w' character
> that's pasted.
No, if vim expects next atom to be a motion. Normal mode commands after which
vim expects motion (this commands are called operators) are listed in |operator|
section of vim help, yank command (y) is one of them.

Текст сообщения:
> On Sat, Sep 11, 2010 at 3:37 AM, caruso_g <peppecaruso@gmail.com> wrote:
> >> "+yiw
>
> I'm sorry - I'm not understanding what you're doing here. Wouldn't 'i'
> put you into insert mode and then there would be a 'w' character
> that's pasted.
> Whever I want to paste, I just use 'P'.
> Thanks for the tip on the buffers - it looks quite useful.
>
> Thanks,
> Ven
>
> > Why not directly yiw ?
> > It will copy the word (or other text object) to the
> > "0
> > buffer which is the latest yanked text and is not affected by
> > deletions (which are assigned to buffers from 1 to 9).
> > As stated, to take a look at your register, just digit
> > :reg<CR>
> > To select a register to paste just digit
> > "np
> > where n is the buffer number to select.
> > Tip: if you don't want to take a look at register, just digit
> > "1p
> > and if is not what you are looking for, just press
> > u
> > to undo and
> > .
> > to repeat the latest command and (drum roll) Vim will automatically
> > increment the number of the buffer to paste!
> > Repeat until you find what you were looking for. :)
> >
> > --
> > 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: