Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Atom editor - multiselect by line

I am moving from Sublime to Atom, and can't find a certain hotkey for the life of me.

Control+D will still do a multi-select - select the next instance your highlighted text, at which point you will get multiple cursors.

In Sublime, if you selected multiple lines and pressed control+shift+l, it would then create a cursor on each line, so you could edit each line at once.

I looked through the hotkey lists for Atom, and can't find this. But then I probably don't know the right terminology.

like image 439
dthree Avatar asked Feb 10 '23 19:02

dthree


2 Answers

For Windows users,
the default keybindings ctrl + shift + up / down seems to work.

For Mac users,
add the following custom keybinding code to the
/user/<yourName>/.atom/keymap.cson file

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# change the keybinding for ADD SELECTION ABOVE / BELOW
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  'shift-alt-up': 'editor:add-selection-above'
#  'shift-alt-down': 'editor:add-selection`-below'
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Then place the cursor where you want to start and press and hold shift + alt and press up or down repeatedly to extend the cursor to as many lines as needed.

like image 71
Pankil Shah Avatar answered Apr 25 '23 12:04

Pankil Shah


I recently apm'd this package, though I'm not sure if there's a hotkey: https://atom.io/packages/sublime-style-column-selection

like image 38
user12341234 Avatar answered Apr 25 '23 12:04

user12341234