Command to move line up or down in Atom Editor
Keyboard ShortcutsAtom EditorKeyboard Shortcuts Problem Overview
I have used Sublime for years and am trying out Atom for the first time.
How can I move a single line or selected block up or down by one line? In sublime I could do this with ctrl+shift+Up, but that doesn't seem to work in Atom. Any ideas?
Keyboard Shortcuts Solutions
Solution 1 - Keyboard Shortcuts
In Atom you can just use Ctrl + Up.
You can find these options on Atom menu : Edit > Lines > Move Line Up
Solution 2 - Keyboard Shortcuts
Windows: Ctrl+Up/Down
Mac: Ctrl+Cmd+Up/Down
Don't have enough Rep to leave as a comment. But for @DanielM question.
To move several lines in Atom:
Select all the several lines you want move by mouse or by holding shift
and moving up or down the lines you want, and then use either the commands for Windows Ctrl+Up/Down
or Mac Ctrl+Cmd+Up/Down
Note: The whole line does not have to be selected as long as part of it is, it will move with the commands.
Solution 3 - Keyboard Shortcuts
I had the same problem, I solved editing keymap file and adding this:
'atom-workspace atom-text-editor':
'alt-up': 'editor:move-line-up'
'alt-down': 'editor:move-line-down'
So to move I use "alt+up" or "alt+down".
Solution 4 - Keyboard Shortcuts
'.editor':
'alt-up': 'editor:move-line-up'
'alt-down': 'editor:move-line-down'
Solution 5 - Keyboard Shortcuts
Depends on your OS:
Linux & Windows: Ctrl + Up/Down
Mac: Ctrl + Cmd + Up/Down