5 ms·
Stuff like typing "10j" made sense when text editing was high latency. Nowadays you can just hold j and stop precisely where you wanted to, even if you're ssh'i
by chmod775 9mo ago
Stuff like typing "10j" made sense when text editing was high latency. Nowadays you can just hold j and stop precisely where you wanted to, even if you're ssh'ing into a server on the other side of the country. There's nothing wrong with it (and in fact I prefer it because of the 0 finger movement required).
The only times I use "precise" movement commands like that is when I'm in the odd situation of having to ssh into something from my phone.
- laserbeam 9mo agoI found that moving between empty lines is the nicest way to navigate most code across all programming languages, markup languages and just regular text. I don’t have to think, I don’t have to count, I just move and select text big chunks at a time… (not in vim, but I first saw someone have key bindings for this in vim)
- cstrahan 9mo agohttps://vimhelp.org/motion.txt.html#%7B https://vimhelp.org/motion.txt.html#%7B { [count] paragraphs backward. exclusive motion. } [count] paragraphs forward. exclusive motion.
- fuzztester 9mo agoWhat does exclusive motion mean here?
- daotoad 9mo agoMotions can be inclusive or exclusive. It works like the different ways of annotating ranges: [0,1] and (0,1). Consider the command `d` (delete) combined with the motions for `"`. First we have `da"`, it deletes the everything between the pair of `"` characters that surround my cursor. Next, `di"` deletes the contents of the `"` pair. The movement `a"` is inclusive (think 'a quote') and `i"` is exclusive (think 'inside quote'). Combined with the command you get "delete a quote" and "delete inside quote" when the mnemonics are spelled out. https://vimhelp.org/motion.txt.html#exclusive https://vimhelp.org/motion.txt.html#exclusive
- fuzztester 9mo agooh, wow, great info, thanks. i knew about the general concept from high school math (where it is called open and closed intervals) and also about Python ranges, but didn't know about it in connection with vim. Got it now.
- fuzztester 9mo agoAlso, I love mnemonics. They make many topics easier to remember. Related: Sanskrit has tons of them. https://duckduckgo.com/?t=fpas&q=sanskrit+mnemonics&ia=web https://duckduckgo.com/?t=fpas&q=sanskrit+mnemonics&ia=web
- guidopallemans 9mo agoThis is the one thing I brought from my time of trying out vim. I have now set all my editors to move by paragraph with ctrl+up/dn. It fits so well together with ctrl+left/right that I think it should be standard behaviour. I also set up ctrl+shift+up/dn to select, of course.
- jcrben 9mo agoGenerally I'm using 'e' to go forward and 'b' to go backward
- bluebarbet 9mo agoWhereas I have always used `w` and did not even know that `e` existed (not that I can see an obvious advantage to it). Ahh, vim.
- worksonmine 9mo ago> (not that I can see an obvious advantage to it). Precision. I use e/E more often than w/W when editing a line or creating macros, but w/W for moving around. But more often i search with f and jump to next match with ; if I didn't hit the target right away. / then n if I'm moving to another line.
- themadsens 9mo agoMore often than not you want 'de' or 'ye' rather than 'dw' or 'yw'
- daotoad 9mo agoDo you like your cursor at the beginning or end of words? Most of the time it doesn't really matter. But if you know you want to append to a word you can hit that target immediately by using `e` (`ea`). Or if you want to prepend, you can use `wi`. Note that `i` and `a` have a similar pairing to `w` and `e`.
- bluebarbet 9mo agoAs it happens, I do actually use both `i` and `a` already. So, to celebrate my first decade on vim, I'm going to try to add `e` to my repertoire.
- eviks 9mo agoIt's slower to "stop precisely"on key hold/release, so 10j still makes more sense, only for a few lines tapping J a few times makes more sense, but not 10-20
- PhilipRoman 9mo agoIt can be about as fast if you set key repeat delay to minimum and repeat speed to maximum. I used it for a while and got quite precise with it. Works well until someone else needs to use your computer for a moment...
- eviks 9mo agoHm, I doubt the precision can match and avoid under/overshootings, especially at high enough repeat speed to match, and it's a global change that can affect even regular typing, so you're suggesting specialized training (to minimizeerrors) for a less effective workflow
- chmod775 9mo agoThe main issue with precise jumps (for me) is that they require you to - already exactly know where you want to go - figure out the relative distance either by looking to the side at relative line numbers or calculating - move your hands to the numbers row to input numbers and back (I don't have small hands, but that still translates into a small amount of arm movement for me). Whereas just using repeat input on jklhwe... only requires you to have a rough idea initially and leaves you plenty of time to figure out where exactly you want to stop while you're already getting there. Besides: I don't like to think about random numbers while I'm coding. Doesn't exactly make the cursor feel like an extension of my body (imagine you had to tell your hand "move 10 centimeters left") Another quite intuitive way I navigate is using "/something" and cycling through hits - usually you know some text that appears near the area you want to go. That was pretty much instant muscle memory.
- eviks 9mo ago> - already exactly know where you want to go Same as with moving down by 1x10? How are you even choosing cursor direction if you don't know where to go to? > - figure out the relative distance either by looking to the side Ok, how is that an issue? You also have to figure out the distance by looking down when moving down with the arrows, so eyes still move? > move your hands to the numbers row to input numbers and back No, you could maintain your hands on the home row and use a numpad layer containing it > imagine you had to tell your hand "move 10 centimeters left" Imagine you had to tell your hand "move 1 centimeter left 10 times"? The mouse is that extension where you don't "move by 1 pixel X times" and move in an analog way
- papyrus9244 9mo agoThat's because you aren't combining it with more advanced commands, or macros. "10j" may sound useless. But "y10j50jp" is much more effective. Put that in a macro that does other stuff too, and suddenly you perform complex editions to a file containing thousands of lines of text in a few seconds.
- deleted 9mo ago[deleted]