Skip to content

namp10010/goland-cheatsheet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

Goland Cheatsheet

A place to keep neat, cool, secret GoLand shortcuts currently for Mac only.

Tool Windows/Popups

Action Shortcut
Project ⌘1
Version Control ⌘9
Run ⌘4
Debug ⌘5
Terminal ⌥F12
Editor Esc
Navigation Bar ⌘↑
Hide all tool windows ⇧⌘F12

Code Completion

Action Shortcut
Basic completion ⌃Space
Smart Completion ⌃⇧Space
See suggested parameters for method/function ⌘P

Quick Popups

Action Shortcut
Docume­ntation F1
Quick definition ⌥Space
Show usages ⌥F7
Show implementation ⌥⌘B

Refact­oring

Action Shortcut
Rename ⇧F6
Extract variable ⌥⌘V
Extract constant ⌥⌘C
Extract function ⌥⌘M
Inline ⌥⌘N
Copy F5
Move F6
Refactor this ⌃T

Code Style and Formatting

Action Shortcut
Reformat code ⌥⌘L
Auto-i­ndent lines ⌃⌥I
Optimize imports ⌃⌥O
Go fmt file ⌥⇧⌘F
Go fmt project ⌥⇧⌘P

Editor Basics

Action Shortcut
Move the current line of code ⇧⌘↑ ⇧⌘↓
Duplicate a line of code ⌘D
Remove a line of code ⌘⌫
Comment or uncomment a line of code ⌘/
Comment a block of code ⌥⌘/
Find in the currently opened file ⌘F
Find and replace in the current file ⌘R
Next/p­revious occurrence ⌘G ⇧⌘G
Navigate between opened tabs ⇧⌘] ⇧⌘[
Navigate back/forward ⌘[ ⌘]
Expand or collapse a code block in the editor ⌘+ ⌘-
Create new... ⌘N
Surround with ⌥⌘T
Highlight usages of a symbol ⌘F7
Expand/shrink a selection based on grammar ⌥↑ ⌥↓
Select/deselect any piece of code (multiple selections allowed) ⌃G

Debug

Action Shortcut
Toggle breakpoint ⌘F8
Disable breakpoint Click on the gutter while holding Alt
Change breakpoint details ⇧⌘F8
Step into (debug mode) F7
Step over (debug mode) F8
Step out (debug mode) ⇧F8
Resume (debug mode) ⌥⌘R
Evaluate expression tool (debug mode) ⌥F8

Inspections

Action Shortcut
Go to next/p­revious problem F2 ⇧F2
Choose Quick Fix ⌥⏎

Navigation

Action Shortcut
File Structure Popup ⌘F12
Recent Files Popup ⌘E
Select In Popup ⌥F1
Navigate to Type ⌘O
Navigate to File ⇧⌘O
Navigate to Symbol ⌥⌘O
Navigate to type declar­ation ⇧⌘B
Navigate to declar­ation ⌘B
Navigate to type hierarchy ⌃H
Navigate to implem­ent­ati­on(s) ⌥⌘B
Navigate to super method ⌘U
Navigate to test ⇧⌘T
Search everywhere Double Shift
Next highlighted element usage ⌃⌥↓
Prev highlighted element usage ⌃⌥↑

Build and Run

Action Shortcut
Run ⌃R
Debug ⌃D

Finding Usages

Action Shortcut
Find Usages ⌥F7
Set custom options for the Find Usages algorithm ⌥⇧⌘F7
Find in Path (if looking for plain text) ⌘F

Version Control

Action Shortcut
VCS Operations Popup ⌃V
Version Control Tool Window ⌘9
Commit changes ⌘K
Update project ⌘T
Push commits ⇧⌘K

From The Hichhiker's Guide to GoLand

Action Shortcut
Action ⌘^a
Extract Method ⌘⌥m
Select inclusively next word ⌥⇧→
Comment line ⌘ /
Basic completion suggestion ^Space
Quick completion of a line ⌘⇧Enter
Smart type completion ^⇧Space
Method-Like Function Completion dot ^Space
Method-Like Function Completion dot ^ Space ^ Space
Postfix Completion type dot after a variable
Completion with tab will replace existing function with the selected one
Rename ⇧F6
Extract Variable ⌘⌥v
Inline place cursor at the variable and ⌘⌥n
Extract Function place cursor at the code and ⌘⌥m
Reformat the code ⌘⌥l
Go to next highlighted error in the file F2
Implement missing methods ⌥Enter
Format string argument ⌥Enter

Reference

About

goland shortcuts cheatsheet

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published