10 lines at once is even better

Posted Mar 16, 2022, 10:22 AM UTC

Posted Mar 16, 2022, 10:22 AM UTC
Wait, what does Alt+Shift do?
Multiline selection, try it and you'll see what I mean
I once did 40 but that’s because I hadn’t been taught the forEach loop yet
Dear god
laughs in vim
VSCode ... man this is really relatable
[deleted]
Ctrl+a ctrl+i indents all lines at once in Qt
6dd
I once had a huge file with A LOT of words and i could transform it to an array thanks to that (importing text files is annoying)
Image Transcription: Meme
["What gives people feelings of power" meme showing a horizontal bar graph with the first bar being green and fairly small labelled "Money". The second bar is blue and a little less than twice the size of the green one labelled "Status". Last is a red bar that is 3-4 times the size of the blue bar labelled "USING ALT + SHIFT TO EDIT 6 LINES OF CODE AT ONCE".]
^^I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!
I use multi line editing constantly for quick text transformations, pulling relevant info out of structured files like csv or json, or quickly converting unstructured data into structured formats. Any editor that can't do these things isn't worth my time. It's so much faster to throw the text I'm working with into a scratch, in memory file buffer to do the editing than to do it any other way. Combined with commands like "split cursor across all selected lines" and a bit of experimentation and you'll see what I mean.
Even in everyday code it's often useful to do things like copying all enum values and pasting it inside a switch, then adding case and : to finish things up. Or for grabbing all public methods/private methods, etc out of a class. Or sometimes I might want to rename a word that appears in multiple variables, such as when deciding that my naming scheme could be improved. Selecting the text then hitting ctrl+d until I've gotten all the instances I want is easier than using find/replace. Often it's even faster to use this method to rename a symbol than refactoring tools because the language tools are much slower than basic text editing. It's just a shortcut I really just can't live without anymore considering how versatile it is while remaining remarkably simple to use.
ctrl alt arrow keys in vs code no?
I use this all the time for indentation.
...and occasionally for formatting CSV in columns.