I quite often start typing the s before fully releasing the shift key, and having to correct the command afterwards is a bit annoying.
Is there any way to make :Set ... an alias for :set ...?
I quite often start typing the s before fully releasing the shift key, and having to correct the command afterwards is a bit annoying.
Is there any way to make :Set ... an alias for :set ...?
While you cannot define custom commands starting with lowercase characters (like the built-in ones), nothing prevents you from doing the opposite, defining user commands that mirror the built-in ones.
:command! -nargs=* -complete=option Set set <args>
If you do this for additional commands, just ensure the number of arguments / taken :range / bang ([!]) matches. See :help :command-nargs (and following paragraphs) for the available options.
Sloppy typing won't get you very far with Vim; instead of relying on such workarounds (which don't work as well in other areas like mappings and motions), better deliberately slow down for a period of time and work on your typing precision. Investing in a higher-quality keyboard might help, too.
:set syntax=whatever and then switch to insert mode if i need a code scratchpad for something.
– ThiefMaster
Mar 21 '15 at 14:07
You could remap ; to :, that way there's no more Shift key involved:
:noremap ; :
This has the obvious downside of losing the function of the ; key ("Repeat latest f, t, F or T [count] times."), to map this to : (and thus swapping ; and :), you can use:
:noremap ; :
:noremap : ;
The problem with that, though, is that once you're used to it, you'll be semi-crippled in a default Vim installation....
1..90-= keys with their alternatives !..()_+ in C, C++ and Haskell files since the alternatives are used much more frequently and it's really nice, but I do get semi-crippled when using vim where my settings are not in effect.
– Shahbaz
Mar 22 '15 at 14:06
: and ; on a default installation to not be semi-crippled: :no; :|no: ;<cr> (12 characters have to be typed).
– Hotschke
May 08 '19 at 11:49
You can simply define an abbreviation.
:cab Set set
As carpetsmoker mentioned this will replace Set with set everywhere in the command line. To avoid this use
:cnoreab Set set
Set with set everywhere in the command line, not just when you type :Set
– Martin Tournoij
Mar 22 '15 at 16:09
:sp,:vsand:e– Shahbaz Mar 21 '15 at 12:57