I have this in my vimrc:

let g:mapleader = ","
nnoremap # ,

so I use , as my leader, and want to use # for backwards search after f,t...But my # mapping does not work, so something is amiss


1 Answer 1


To set your leader key, you must use let mapleader = "," not let g:mapleader = ",".

From :h <leader>

                    *<Leader>* *mapleader*
To define a mapping which uses the "mapleader" variable, the special string
"<Leader>" can be used.  It is replaced with the string value of "mapleader".
If "mapleader" is not set or empty, a backslash is used instead.  Example: >
    :map <Leader>A  oanother line<Esc>
Works like: >
    :map \A  oanother line<Esc>
But after: >
    :let mapleader = ","
It works like: >
    :map ,A  oanother line<Esc>

As for using nnoremap <something> <leader> like you did, this causes no issues for me. Make sure you don't have some other mapping by running the command: nnoremap ,. It should print No mapping found.

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.