I know I can set user-defined commands using the :command Foo bar
syntax, but I want a way to set a command without using capitals.
For example, to save all open buffers, the command is :wa
, but that's slightly too inconvenient. I'd really like to be able to just do :ww
.
What's with this seemingly arbitrary limitation? Why do I have to use capital letters?
:AlterCommand ww wa
in the actual vim instance and have it work, but I can't add it to my .vimrc properly. I've triedAlterCommand ww wa
:AlterCommand ww wa
and a few variations of that. I'm not even sure what to Google for this? What are these "commands" called that have colons before them? And how do I add them to my vimrc?AlterCommand
in yourvimrc
, you will need to place this command somewhere above (still in yourvimrc
):call altercmd#load()
. It's documented in the plugin's help. BTW, the whole plugin is a convenient interface around Vim's builtincnoreabbrev
command. Also those "commands" with colons before them are called ... Vim commands (and they are run from "command-line mode").:h altercmd
,:h cnoreabbrev
and so on.