Lets say, hypothetically, that I always forget the command :vsplit
, and always think it’s :vdivide
.
Is there a way to map (I’m not sure if that’d be the right thing to call it, since it’s a command) one to the other?
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.
alias command instructs the shell to replace one string with another string while executing the commands. When we often have to use a single big command multiple times, in those cases, we create something called as alias for that command.
To get around the limitation that user-defined commands must start with an uppercase letter, I recommend the cmdalias.vim - Create aliases for Vim commands plugin. With it, you can do:
:Alias vdivide vsplit
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