Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multi-line editing on Atom

I have this task that I need to complete fast as possible. I have coupon codes (over 1000), I going to create an array out of it. To do that fast as possible I need to be able select multiples lines and edit them at the same time. I am using Atom as my editor choice. I tried to search online for answers but non found.

ST55672
SE82673
SS85074
SD65675
SH75676

to:

"ST55672",
"SE82673",
"SS85074",
"SD65675",
"SH75676",

PS. Im using Mac

like image 695
Jaakko Uusitalo Avatar asked Sep 08 '16 13:09

Jaakko Uusitalo


People also ask

How do you edit multiple lines in an Atom on a Mac?

Select all text ( Cmd + A on Mac, Ctrl + A elsewhere), then use the shortcut to “split the selection into lines” ( Cmd + Shift + L on Mac, Ctrl + Shift + L elsewhere). Both commands are also available from the command palette.

What is multiline editing?

Multi-Line Editing This is useful for HTML where you may want to change several hyperlinks at once or if you want to edit multiple rows in a JSON file. To employ multi-line editing, use the following command for your OS: Windows: Ctrl + Alt + Arrow Keys. Linux: Shift + Alt + Arrow Keys. Mac: Opt + Cmd + Arrow Keys.


1 Answers

1. Atom Commands

Select all text (Cmd+A on Mac, Ctrl+A elsewhere), then use the shortcut to “split the selection into lines” (Cmd+Shift+L on Mac, Ctrl+Shift+L elsewhere). Both commands are also available from the command palette.

PS: like many other keyboard shortcuts, these also work in Sublime Text

2. RegEx Search & Replace

Search for ^(.*)$ and replace with "$1",.

like image 123
idleberg Avatar answered Sep 20 '22 11:09

idleberg