My <leader> key is , and for convenience I'm using for a few years now the ; normal-mapped as a :, to save me a key stroke to type :commands.

Now, I know that , and ; are shortcuts themselves, to repeat last f and F commands and the inverse.

; and ,         Repeat latest f, t, F or T [count] times. See :help cpo-;

I want to map them to be <leader> ; and <leader> ,, so I don't lose this functionality. So, if I type ,; it will act as ; and ,, will do as a single ,. I can't wrap my head around this mapping.

Any suggestions? Thanks.


I have the following configurations/maps:

let mapleader=',' 
nnoremap ; :

If you simply need to create this mapping:

nnoremap <leader>, ,
nnoremap <leader>; ;

OP mentions <leader> is comma, via let mapleader = ',' or similar.

  • Thanks! It worked as a charm. So simple, and yet I couldn't make it at first attempt.
    – DrBeco
    May 31 '19 at 3:37

Your Answer

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

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