Art Vega
Art Vega

Reputation: 21

How do you disable all key mappings in vim?

The effect that I would like is to remove all key mappings/bindings from vim such that I can then only specify the bindings I use and build from there.

What is the best way to disable everything so that I can configure a whitelist of my own?

Upvotes: 2

Views: 1129

Answers (2)

romainl
romainl

Reputation: 196466

The only way to do what you want is to map every built-in command to :help <Nop> in all relevant modes:

nnoremap a <Nop>
xnoremap a <Nop>
...

and then to create your own custom mappings:

nnnoremap a <do something>

Note that Vim's commands are not implemented as mappings. The above overrides every key combination with a new empty mapping, essentially disabling it, and then creates your own custom mappings.

But Vim's default commands a) are plenty, and b) very expressive so why bother? What value, exactly, are you expecting to get out of this? Why would you want to remove features from a tool whose primary selling point is that it has so many features?

Upvotes: 3

G. Bai
G. Bai

Reputation: 513

When you define a new key mapping with noremap, or nnoremap inoremap, the default key mappings are overwritten.

Upvotes: 1

Related Questions