Is there a command that resets key mappings to their default values?
For all of them, not just for one key.
or a plugin maybe?
On vim , command-mode keys can be mapped through the ex command :map <key> <macro> and insert-mode keys can be mapped through :map! <key> <macro> . After mapped, the commands to remove the mapping from the command-mode keys and insert-mode keys are unmap <key> and unmap! <key> respectively.
Use :map! and :map for manually set keys and :help 'char(-combination)' to find out which keys are already mapped in vim out-of-the-box(/out of your specific compiling options).
Creating keymaps To map a sequence of keys to execute another sequence of keys, use the ':map' command. For example, the following command maps the <F2> key to display the current date and time. The ':map' command creates a key map that works in normal, visual, select and operator pending modes.
You can remove all mappings for certain modes by running some of the mapclear
family of commands.
This is taken from :h mapclear
:mapc[lear] mapmode-nvo :mapc :mapclear
:nmapc[lear] mapmode-n :nmapc :nmapclear
:vmapc[lear] mapmode-v :vmapc :vmapclear
:xmapc[lear] mapmode-x :xmapc :xmapclear
:smapc[lear] mapmode-s :smapc :smapclear
:omapc[lear] mapmode-o :omapc :omapclear
:mapc[lear]! mapmode-ic :mapc! :mapclear!
:imapc[lear] mapmode-i :imapc :imapclear
:lmapc[lear] mapmode-l :lmapc :lmapclear
:cmapc[lear] mapmode-c :cmapc :cmapclear
Remove ALL mappings for the modes where the map
command applies. {not in Vi}
Use the <buffer> argument to remove buffer-local
mappings :map-<buffer>
Warning: This also removes the default mappings.
One command to remove everything is
:mapclear | mapclear <buffer> | mapclear! | mapclear! <buffer>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With