4 ms·
I 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’
by laserbeam 9mo ago
I 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 8mo 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.