22

I'm trying to change <Leader> in MacVim to be something less carpal-tunnel inducing. I have added this line

let mapleader=","

to my .gvimrc, but "\" is still the only key that works. Am I missing something?

Thomas Hunter II
  • 5,081
  • 7
  • 35
  • 54
Paul Wicks
  • 62,960
  • 55
  • 119
  • 146
  • This does not seem to be MacVim specific. Can anyone confirm this? If it applies to windows/linux versions to I'd say this question should be retagged to be not macvim-specific. – ThiefMaster Apr 11 '12 at 08:38

3 Answers3

25

The line needs to go into your normal .vimrc (instead of .gvimrc). .gvimrc is not read until all plugins have been loaded, by which time all the mappings have already been created with the default map leader.

.gvimrc is intended only for GUI-specific options, everything else should be in .vimrc.

too much php
  • 88,666
  • 34
  • 128
  • 138
  • 1
    I don't know if MacVim reads `.gvimrc` but I'm pretty sure it reads `.vimrc` so this should work. It might be possible to add conditional lines to your `.vimrc` to control MacVim-specific behavior. – Chris Lutz Sep 16 '09 at 23:54
  • A very useful answer and not macvim specific. – Jeremy Jul 30 '12 at 19:12
0

I use macvim and it does seem to use the .vimrc I also have leader mapped to that character.

segy
  • 644
  • 4
  • 12
0

If you are using some scripts to customise your vim you may try to put the let mapleader="," in your ~/.vimrc.before file. At least this did the trick for me.

Biscuit
  • 21
  • 5