5 ms·
I use vim every day and use a completely different workflow that heavily relies on searching and (gasp!) mouse mode. I like “hjkl” movement for nearby characte
by sameoldtune 2y ago
I use vim every day and use a completely different workflow that heavily relies on searching and (gasp!) mouse mode.
I like “hjkl” movement for nearby characters but the idea of typing numbers to move around a document (e.g. “13k”, “4w”,…) has always baffled me. If something is more than a few lines away I either search for it and go directly or use the mouse to scroll to it.
- bmoxb 2y agoI also rely heavily on search. When editing code, I am frequently looking to modify a string of characters somewhere in the middle of a line. Navigating firstly to the correct line and then also the correct position within that line is probably going to require several keystrokes anyway so why not just use search to go there directly?
- mattpallissard 2y agoThe trick is to set both number, and relative number. You then get line numbers in the side. The line your cursor is on is the absolute line, but above and below them are offsets. Makes jumping up/down lines easy. So the cursor sitting on line 4 of a file looks like this 3 a line 2 another line 1 a third line 4 foo 1 bar 2 bazz 3 fizz buzz As far as jumping words, I personally feel that it's easy enough to eyeball. edit: I see that they have the note 'There are line number and relative line number on the left.' in the post.
- Repulsion9513 2y agoI don't like number because it makes it harder to copy-paste from vim. LOL (Although I've now left copy-pastability behind a bit with `list listchars=tab:··▸`... Maybe I should try them again)
- mattpallissard 2y agoThat's why I set the vim copy-paste buffer to the operating system clipboard. So you can use visual select and y/x.
- Repulsion9513 2y ago... huh! Today I learned that visual selecting throws stuff in PRIMARY. (and also "* "+) That's helpful for sure :) unfortunately I'm often running vim on a remote system though
- tecoholic 2y agoAfter searching I usually press n for next and N for previous to move around, without having to use the mouse. But it does leave me occasionally baffled as to which function I am looking at when the functions are too long and it’s all the same get/list/update - looking at you Django Rest Framework.
- lawn 2y agoIf you have relative line numbers on, you do "go directly to it" by eg 13k. Yes, you may not land on exactly the spot you wanted to, but that's also just a few characters away. Searching also has a similar problem where you might land on an earlier match, so it's not perfect either. Mouse to scroll (scroll not jump?) just feels much slower to me than any of the other solutions.
- lambdaba 2y agoI never use number prefixes. I'm on a keyboard layout where I have to press shift to get numbers, and as you say it's unergonomic. Jumping to characters with f or t and word jumps at much more useful. Searches for more distant things.