Sunday, September 7, 2014

Alternate .vimrc causes problems with Leader key

People,

If I have the first three of the following lines as the only lines in my
regular .vimrc file, executing the test while vim is loaded works fine:

let mapleader = ','
" Test
nnoremap <leader>a :echo("\<leader\> works! It is set to
<leader>")<CR>

set backup
set undofile
set backupdir=~/z_save/backup//
set directory=~/z_save/swap//
set undodir=~/z_save/undo//

"Base64 Encode/Decode Macro
vnoremap <leader>64 c<c-r>=system('base64',@")<cr><esc>
vnoremap <leader>64d c<c-r>=system('base64 --decode',@")<cr><esc>

However, if I have all the above lines in ".vimrc_Maildir" and start vim
with:

vim -u ./.vimrc_Maildir

the test does not work! I want to be able to use this alternate .vimrc
file for when I am directly editing email files in the Maildir
directory. Is there a quick explanation for why the test works in one
place and not the other? I tried running
/usr/share/vim/vim74/bugreport.vim in both cases and doing vimdiff on
the outputs and the only thing I could see that seems to be relevant is:

Regular case - bugreport.txt:

n ,a * :echo("\<leader\> works! It is set to ,")<CR>

Alternate case - bugreport.txt:

n <leader>a * :echo("\<leader\> works! It is set to <leader>")<CR>

And if I do:

:let mapleader

in both cases I get:

mapleader ,

Anyone got any idea what is going on?

Thanks,

Phil.

--
Philip Rhoades

GPO Box 3411
Sydney NSW 2001
Australia
E-mail: phil@pricom.com.au

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment