Thursday, October 20, 2011

Re: Trigger for yank

On Oct 20, 4:50 am, sinbad <sinbad.sin...@gmail.com> wrote:
>
> btw, how do you capture the register input and [range] input
> inside mapped function.
>
> ["x]yy                  Yank [count] lines [into register x]
> [range]y

:help v:register
:help v:count
:help v:count1

You can access the contents of a register with @{register name}, for
example @a, @b, @0, @-, etc.

:help :let-@ gives some detail but there's probably a better help link
somewhere.

I really don't think this is a good idea though...as you say n and p
are bad choices for maps. I personally use <F3> and <S-F3> for
navigating the quickfix list (and for navigating diffs for that
matter, if in diff mode).

I think your mapping will work best, if you use an <expr> mapping, and
simply have it return 'y'. But it will still take quite a bit of work
to get working in all situations. And, don't you want 'p' to default
to paste when you've used the 'd' operator? How about 'x'? How about
'c'?

Maybe it would be better to assign some other key (like CTRL-P
maybe...a synonym for 'k') to either your navigation command, or to
your paste command. This would prove much easier methinks. CTRL-N is
likewise a synonym for j, so it could be mapped to resolve the
conflict with the default "next search match" command.

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