I sometimes need to write the whole alphabet abcd…z
and I hate typing it letter by letter in Vim's insert mode. Does there exist any method to do this more efficiently?
I know about the ga
command which gives me the ascii code of the character where the cursor is … but don't know anything about how to mix it with my standard solution to type numbers from 1 to (for example) 5000: a1ESCqqyyp^Aq4998@q
…
This is the same thing as pressing caret "I". So the lowercase "i" command lets you insert text before your current cursor position and capital "I" lets you insert text before the first non blank character on the line you're on.
b - jump backwards to the start of a word. B - jump backwards to the start of a word (words can contain punctuation) 0 - jump to the start of the line. ^ - jump to the first non-blank character of the line. $ - jump to the end of the line.
Using set nrformats+=alpha
:
ia<Esc>qqylp<C-a>q24@q
Step by step:
ia<Esc> " Start with 'a'
qqylp<C-a>q " @q will duplicate the last character and increment it
24@q " Append c..z
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