1

Failed attempts

With quotes

let mapleader = "<Delete>"

Without quotes

let mapleader = <Delete>

E15: Invalid expression: <Delete>

Other keys

let mapleader = "<Escape>"

let mapleader = "<Insert>"


Baseline

Using a comma works.

let mapleader = ","


What I'm really trying to do

I'm trying to set Caps Lock as a mapleader in Vim. Using xmodmap, I can clear Caps Lock's functionality and assign it to a new key. I'd like to assign it to Insert, Delete, or Esc, and then assign one of those as a mapleader in Vim.

Matt Kleinsmith
  • 1,017
  • 3
  • 13
  • 24

1 Answers1

3

Use an escape character

let mapleader = "\<Delete>"

let mapleader = "\<Esc>"

let mapleader = "\<Insert>"


More info: http://vimdoc.sourceforge.net/htmldoc/eval.html#expr-quote

Credit: https://stackoverflow.com/a/9578616/3822261

Community
  • 1
  • 1
Matt Kleinsmith
  • 1,017
  • 3
  • 13
  • 24