Move Block Up/Down Using Keyboard

Use the keyboard to move a line or selection up or down in your file.

Move lines and blocks, up or down, using the keyboard.

When you're in the flow, you want to re-arrange code fast. Use this tip to move code around without cut-and-paste.

How to use:

Move Statement Up with ⌘⇧↑ (macOS) / Ctrl+Shift+Up Arrow (Windows/Linux).

Move Statement Down with ⌘⇧↑ (macOS) / Ctrl+Shift+Up Arrow (Windows/Linux).

Related Resources

Go doc comments in quick documentation
Support for links, lists, and new headings in doc comments.
Changing the font size in the editor
Use a keyboard shortcut to change the font size in the editor.
Quick Documentation
View documentation for any symbol without interrupting your workflow.