The Computer Oracle

How do I do multi-line editing in Atom editor?

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Cool Puzzler LoFi

--

Chapters
00:00 How Do I Do Multi-Line Editing In Atom Editor?
00:24 Accepted Answer Score 59
01:19 Answer 2 Score 6
01:43 Answer 3 Score 30
02:20 Answer 4 Score 3
02:49 Thank you

--

Full question
https://superuser.com/questions/957128/h...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#texteditors #atomeditor

#avk47



ACCEPTED ANSWER

Score 59


IIRC, it is the same as it is with Sublime Text. Ctrl+Alt and then use the arrow keys to select additional rows. If using the mouse, then just the Ctrl key is used; the selected locations can be as required, the wouldn't need to be in any particular order.

Atom have a "flight manual" (user manual) with some more detail of the block editing here.


On a Mac when using the mouse, it would be the Cmd / ⌘ key instead of the Ctrl as on Windows.


Note:

On Windows, the Ctrl+Alt could be already mapped by the OS or the screen card drivers/utility to change the screen orientation, for example: CTRL + ALT + WINDOWS KEY + Up / Down

The same would apply on the Mac, e.g.: the Ctrl + Shift (as used in Sublime) is often mapped by the OS, so the functionality there takes preference.

In both cases the keybindings can be changed to something else to accommodate both (or turn off the OS, screen card short cuts). The commands are called 'editor:add-selection-above' and 'editor:add-selection-below'




ANSWER 2

Score 30


For mac users, I found 3 ways:

  1. You have a plugin to add support for alt + rectangular mouse selection, called sublime-style-column-selection.
  2. With + mouse click in multiple places to create multiple cursors.
  3. Or without the mouse, there is control+shift+ and control+shift+, but you have to disable the same shortcuts from System Preference -> Keyboard -> Shortcuts used by Mission Control: look for ^ ↑ (ie. control+) and ^ ↓ (ie. control+).

    enter image description here




ANSWER 3

Score 6


Install a plugin,

https://atom.io/packages/multi-cursor

NOTE: multi-cursor plugin does not show up in Packages menu like some other plugins.

Pressing the following key combo will give you multi line edit,

Windows: alt up arrow

Linux: alt shift up arrow




ANSWER 4

Score 3


Today I found a package in Atom named "column-select". So far it works perfectly fine. The way it works is very close to the implementation of Block selection of Rstudio and Kate.

It does not add space to fill the gap. It literally let you select vertically if there is anything there (skips empty lines and lines that does not have enough length).

The following gif from their Github shows how it works:

enter image description here