Friday, November 2, 2012

Re: mapleader question

Thanks, nice explanation. You answered my question. You helped a lot.

On Fri, Nov 2, 2012 at 10:01 PM, Chris Lott <chris@chrislott.org> wrote:
> On Fri, Nov 2, 2012 at 5:47 PM, stosss <stosss@gmail.com> wrote:
>
> I might just not understand the question. Let me try again:
>
>> My question is this:
>>
>> I see some examples in email here that show:
>>
>> <Leader>A
>>
>> or some other character besides A
>>
>> what key do I use if my map looks like that?
>
> Unless you have changed the leader key using the mapleader=X command,
> then you would type:
> \A
>
>> right now some of my maps actually have \ as the first key to press
>> some have the F key or Shift F key.
>
> If you haven't changed the leader key, then you would press
> \\
> in the first instance.
>
> <Leader> is just a way to say: "whatever leader key I have defined"
> and so is used by plugins and the like to do keymapping so they can
> adapt to whatever leader you have defined.
>
> Could you post a couple of the maps you are talking about? Because "X
> is the first key to press" is ambiguous: do you mean X is the key that
> is mapped or X is the key that is to be pressed after pressing the
> <Leader>? As it stands, you could mean
> map F foobar
> OR
> map <Leader>F foobar
>
>> Why are some maps set up like so:
>>
>> <Leader>A
>
> So that the code is portable (see above). For instance, I can drop
> nnoremap <Leader>A foo
> into my code and it works fine no matter what leader key I have
> defined (I use the comma), so I would press
> ,A
> where you would, if you haven't changed it, press
> \A

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