peter-b
peter-b

Reputation: 4191

Command to move line up or down in Atom Editor

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?

Upvotes: 69

Views: 30039

Answers (5)

Rimian
Rimian

Reputation: 38458

Depends on your OS:

Linux & Windows: Ctrl + Up/Down
Mac: Ctrl + Cmd + Up/Down

Upvotes: 3

Marcelo C.
Marcelo C.

Reputation: 3972

'.editor':
  'alt-up': 'editor:move-line-up'
  'alt-down': 'editor:move-line-down'

Upvotes: 4

Isa Souza
Isa Souza

Reputation: 1631

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".

Upvotes: 14

dlchang
dlchang

Reputation: 957

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.

Upvotes: 47

alysonsm
alysonsm

Reputation: 1463

In Atom you can just use Ctrl + Up.

You can find these options on Atom menu : Edit > Lines > Move Line Up

Upvotes: 102

Related Questions