I've tried

let mapleader="<C+k>"


let mapleader="\<C+k>"

But it seems that both of them can't work.


The correct syntax is:

let mapleader="\<C-k>"

It works as expected.

  • 1
    Lol @filbranden, I just saw this in review as Low-quality because of length :{ nothing to worry about, obviously, just thought it was funny – D. Ben Knoble Feb 15 '20 at 19:51
  • @D.BenKnoble 🤣 It struck me as short, didn't expect it would be flagged as possible Low-Quality, but I thought answering was right (better than comment) and not much point in saying more than this, since the OP was already super close to the answer... Anyways, thanks for not flagging it as spam! 😁 – filbranden Feb 16 '20 at 2:03
  • Np; robots only get you so far. It’s pretty much what id have written, at any rate – D. Ben Knoble Feb 16 '20 at 2:15

filbranden is right. Another solution would be:

let mapleader="^K"

^K is inserted by typing <C-V><C-K>. A key typed after <C-V> will be inserted literally. It's very useful. See :h i_CTRL-V for more information.

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.