0

I've tried setting localleader using:

:let localleader="]"

And it seems to be 'working':

:let localleader
localleader            ]

However, when I try and run a command using localleader, it doesn't seem to register, and is using the general leader. For example, after I do:

:autocmd FileType python nnoremap <localleader>c I#<esc>

Hitting ]c does nothing...but hitting \c (normal leader) actually works. What's wrong here? Perhpaps I'm misunderstanding the use of leader vs mapleader ?

1
  • 2
    Leader keys need to be set before any mapping that uses them. Is it your case? Commented Jun 11, 2020 at 21:12

1 Answer 1

4

According to :h <LocalLeader>

<LocalLeader> is just like <Leader>, except that it uses "maplocalleader" instead of "mapleader".

So you need

let maplocalleader="]"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.