Prasanna Maddila
Prasanna Maddila

Reputation: 21

Change command line mode key ":"

I'd like to change the way to enter command line mode. In particular, I want to change the : key to ;, since : is just Shift + ; for me. I've tried, so far,

but they've not worked.

Upvotes: 1

Views: 220

Answers (2)

romainl
romainl

Reputation: 196566

Mappings are thoroughly documented under :help mapping, and introduced in the gentlest way possible in chapter 5 of the user manual: :help 05.4, the reading of which is pretty much mandatory if you ever hope to use Vim efficiently.

Case in point…

  • The left-hand side of a mapping is what you want to press and the right-hand side is what you want to happen instead, so all your attempts are in the wrong order.
  • Both sides of a mapping are the exact key you would press so ";" in a mapping is not ;, it is ", then ;, then ". If you wanted ;, you should have used ;. Besides, you are very unlikely to find even one resource on the web suggesting that notation.

You won't extract any value from Vim by trying random things and turning to the internet for help when you are lost. Vim must be learned to be used and there is no way around that.

See :help user-manual.

Upvotes: -1

LordMZTE
LordMZTE

Reputation: 227

Looks like you got : and ; the wrong way around. nnoremap ; : does the trick for me.

Upvotes: 2

Related Questions