On Wed 21-Feb-07 1:56pm -0600, Charles E Campbell Jr wrote:

> Bill McCarthy wrote:

>>BTW, as an enhancement request, could AN be enhanced to look
>>for <leader>map when it fails to find <char>map?  That is,
>>if I want to load the align maps:
>>
>>    AN \abox
>>
>>doesn't work.  I would need to type:
>>
>>    AN <leader>abox
>>
>>  
>>
> If you happen to have (as an example)
>
>   let mapleader= ";"
>
> in your <.vimrc>, did you know that
>
>   :AN ;abox
>
> would load AlignMaps.vim?  So you don't actually need to type <leader>,
> just the leader you're actually currently using.

Yes, I understand that if the user has explicitly defined
g:mapleader in their vimrc, then that works.  However, if
the user lets Vim default to '\' then it doesn't work the
way your code is written.

One can certainly add to their vimrc:

  let g:mapleader = '\'

and now:

  :AN \abox

works - which it doesn't now as I mentioned above.

But that won't work when running with -u NORC.

Your fix notes specify:

  v3 May 19, 2004 : * bugfix: now works correctly when mapleader
                      wasn't set by user explicitly

so perhaps you fixed this in the past and something is
preventing your fix from working today.

You could easily make default behavior work by adding, right
after your check for previous load, code such as:

  if !exists("g:mapleader")
    let g:mapleader = '\'
  endif

Which would allow users who use Vim's default behavior,
without explicitly setting mapleader, to do:

  :AN \abox

-- 
Best regards,
Bill

Reply via email to