-1

I have taken the .vimrc from another guy. However, is Leader character is now ,, and I am no longer able to modify it

let mapleader = ","

I'm trying to change it for the default leader with let mapleader = "\", but it didn't work. Could anyone be able to tell me how to obtain the default mapping?

  • Does work if you restart Vim? – Loovjo Feb 15 '17 at 6:13
  • 5
    I have taken the .vimrc from another guy It has already been said on this site but really you shouldn't do that: you'll spend waaaay more time debugging things you don't need/you don't understand than creating your own vimrc which really fits your needs/ – statox Feb 15 '17 at 8:17
3

To get the default behaviour, the best way would be simply remove that setting from .vimrc. But it's also possible to set that in .vimrc by any of the following:

let mapleader = "\\"

or

let mapleader = '\'

Using double quote requires escaping special characters. And because \ is a special character used to escape others, it has to be escaped as well.

3

Make sure you set the leader before using any mappings which involve the leader. When you use the leader in a mapping you're not saying "use whatever the leader is, which I might have defined now, or I might define later on in this vimrc file" you're saying "use whatever the leader is currently set to right now".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy