2

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?

1
  • 2
    I am not sure that the intention of vi or vim is really to customize. You could build something on vi, but if you learn vi, it really beats many editors hand down. vi as the base for another improved version could be the way to go, but vim, the already improved version of vi has pretty much nailed it on the head, in my opinion. I see plenty of people that like nano, as a alternative basic version, but maybe you are looking for a IDE. Vi or vim is not a IDE. Commented Feb 28, 2021 at 13:52

2 Answers 2

3

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?

Sign up to request clarification or add additional context in comments.

2 Comments

I can understand that it can be annoying when you miss hit a key and it does something unexpected. Also, if you disable all unwanted keys, you get to now what unwanted features you might have. Also then you can use these keys to create custom keymaps without having to worry about overriding anything important.
That's quite the convoluted justification.
1

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.