Wednesday, April 27, 2011

Re: Where is defined?

On Wednesday 27 April 2011 14:16:55 ZyX wrote:
> Reply to message «Where is <localleader> defined?»,
> sent 21:58:45 27 April 2011, Wednesday
>
> by Steve Litt:
> > Where is <localleader> defined?
>
> It is surprising, but if you open `:h <localleader>' you will get desired
> answer.
>
> > How would I define a similar variable
> > called <voleader> so that it's available for use in various Vimscript
> > programs?
>
> <localleader> is not a variable, it is expanded to the value of a variable.
> You can't define a new <...> expression without patching vim.
>
> If you want to have a custom prefix, use `execute': instead of
> nnoremap <voleader>lhs rhs
> use
> execute 'nnoremap' g:voleader.'lhs' 'rhs'
> (note that though I use different strings for different arguments, spaces
> in lhs and g:voleader won't be escaped: I do this only for readability).

Hi ZyX,

I'm not sure if I understand what you're writing, but it sounds like what
you're doing is, instead of creating <voleader> to be used in a map command,
at mapping time you're running a different syntax. Is that correct?

If it is, it's not going to work in our application because there are tons of
map commands that need to be changed. It's one thing to globally change
<localleader> to <voleader>, but it's a little more troublesome (and requires
considerable testing) to put in the execute and the g: and the dot.

Can you think of another way to create a <voleader> right at the beginning?

Thanks

Steve

Steve Litt
Recession Relief Package
http://www.recession-relief.US
Twitter: http://www.twitter.com/stevelitt

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