On 13/08/11 16:30, sinbad wrote:
hi,

how to pass the contents of a register in a vim script to the "p"
command.
basically i've written the following function. In the following
function with
pflag set to '0', the p command (paste command) works fine if no
register
is passed, but for example if i press "ap, i want to pass the "a to
the command
as well. basically i want to capture the prefix to the p command and
pass it to
the vim function.i hope i explained it to clearly.

fun! Myp()

if (pflag == 1)
  " do something
else
silent normal! p

endfun

thanks


If you mean you want to map the Normal-mode p command to some function, that function will see the register name (or '"' if none is supplied, because ""p [explicitly specifying register double-quote] is the same as just p with no explicit register) in v:register.

See :help v:register


Best regards,
Tony.
--
"Cutting the space budget really restores my faith in humanity.  It
eliminates dreams, goals, and ideals and lets us get straight to the
business of hate, debauchery, and self-annihilation."
                -- Johnny Hart

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

Reply via email to