Search code examples
vimalphabet

Writing whole alphabet in Vim


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


Solution

  • 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