10

I use Vim on a MacBook Pro and in order to input \, I have to type in Maj + Alt + /. Vim's leader key is bound by default on \ but typing the whole "shortcut" doesn't seem to work as a leader key.

Is there a way to make it work or should I use another leader key like , ?

Cydonia7
  • 3,744
  • 2
  • 23
  • 32

2 Answers2

15

I use this command:

let mapleader = ','
kev
  • 155,172
  • 47
  • 273
  • 272
  • 4
    The problem with that solution is that you lose the default usage of "," which is to reverse a character search. Example fa goes to the next "a" on the line then hit "," it goes to the previous "a". It is really useful if you use ";" to repeat a character search and you need to go back. – Julien Grenier Apr 01 '13 at 15:48
  • @JulienGrenier, Well, `,` will still search for the reverse character. Personally, I don't reverse search a lot (I rarely get trigger-happy) and there is also F{char}) so having to type the extra space doesn't bother me... – Justin D. Jan 09 '14 at 02:09
5

Put the following line into your .vimrc in order to use , as your leader

let mapleader = ','

Save your .vimrc and reopen vim. Your leader is now ,

darryn.ten
  • 6,784
  • 3
  • 47
  • 65