Vim -- Enumerate Lines in Base26

417 views Asked by At

Is there any standard way to specify the set of characters that vim uses to enumerate lines? For example, instead of numbers in succession, could I use lower-case letters {a, b, ..., aa, ab, ac, ...} (or even better, use only the characters in a keyboard's home row) and still act on specific lines by this new referencing system?

I suppose an escape key of sorts -- perhaps ':' or 'g' -- might be needed, but even so, if anyone has suggestions as to how I could implement this, I'd be quite appreciative.

Thanks.

1

There are 1 answers

0
Ingo Karkat On BEST ANSWER

There's nothing built-in other than absolute and relative line numbers, and it would be difficult to square a different addressing scheme with the numerical [count] prefixes to the Vim motions. However, plugins like EasyMotion and vim-seek implement such, though for motions like the built-in f inside a line.

For implementation tips, have a look at the RltvNmbr.vim plugin; it uses the sign column to emulate the now built-in relative numbering. As the sign column is two characters wide (and can display arbitrary characters), this would be fitting. That would take care of the visualization... you'd then only need a custom mapping to query for the Base26 line number, and translate that back into a jump.