Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Learn how to use multiple selections.

On OS X CTRL + SHIFT + UP/DOWN will create a new cursor on the next line up or down. And you can CMD + LMB-click to insert a new cursor anywhere.

I cannot count how much time this feature saves me.



CTRL+D (Might be CMD on Mac) will also select the next occurrence of a symbol/selection. And Ctrl+U will undo a selection from this method or the parent post's method.

Aside from being able to simultaneously write in multiple places, you can copy-paste across multiple cursors; highlight 5 variables, copy, create 5 new lines with cursors, paste. Each line will have one of your copied variables. Try using Find with regex and alt+enter to select all matches with separate cursors.

Many plugins also support or add onto this feature. I love TextPastry to easily insert number ranges and patterns across multiple cursors.


Yep, it's CMD+D for selecting the next occurrence of the current symbol on OS X.

CMD+SHIFT+D is handy, too; it duplicates your current line.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: