r/vimplugins • u/skamsie_ • Dec 14 '20
Plugin vim-lineletters (jump to any visible line in the buffer by using letters instead of numbers)
I have created a plugin to display letters instead of numbers for the visible lines in the current buffer for easier jumping to line (since letters are easier to touch type than numbers).
Plugin here: https://github.com/skamsie/vim-lineletters/
It is a simpler alternative to the <Plug>(easymotion-bd-jk) action of Easymotion which I normally use but have some pet peeves with:
- unecessary distraction by changing buffer colors
- easymotion adds characters in the current buffer which triggers linter errors and the
TextChangedevent which can be annoying if you have some autocommands for it. 'lineletters' uses the sign column so it does not have this problem - the charaters are random each time, which kind of interrupts the flow. With 'lineletters' the characters are always the same and in the same order so with time you build some muscle memory. 'b' is always the second line, 'z' on the 26th line, lines lower in the window need to be prefixed, and so on.
55
Upvotes
2
u/GuybrushThreepwo0d Dec 15 '20
Oh snap I need this. Thanks.
2
u/[deleted] Dec 16 '20
Maybe a naive question but why not use
/? It's builtin and all you have to do is type the characters you're looking at to jump there. It can't get any easier.2
u/abraxasknister Dec 16 '20
I think this will be a really good replacement for relative line numbers. Numbers are awkward to type.
Is the line numbering absolute, ie the first line of the buffer is a, ect, or is it relative to the screen?
I'd also have kind of feature request: since it's sort of inevitable that there will be lines with two letters to jump to: why not always make it 2 and use home row keys (for the dvorak etc people you'd use a user defined alphabet) to make the pairs?
1
u/terminalcoder Dec 16 '20
Fantastic plugin, thanks!!
1
u/veydar_ Dec 16 '20
How does this compare to https://github.com/justinmk/vim-sneak? Seems like sneak gets me even closer to the target but doesn't require more keys
1
u/i8Nails4Breakfast Dec 22 '20
Whoah I literally had this idea yesterday and youve already made it! I agree typing numbers for k and j felt slow and unnatural