GoLand keyboard shortcuts for Windows, Linux and Mac

GoLand 2026.2 keys from JetBrains' help: Windows on the left, also valid on Linux bar a few keys named in the FAQ, macOS on the right. Go test, coverage, import and hierarchy rows come from topic pages; Emacs and other alternative keymaps are left out. The help gives no key for go fmt, go vet or go generate: Ctrl + Alt + L runs GoLand's own formatter and Ctrl + Shift + T hops between a function and its test.

246 shortcuts in 17 sections. Checked row by row against JetBrains on . Edited by Jay.

General 11

ActionWindows / LinuxMac
Open SettingsThe dialog's Keymap page shows the active keymap; Go import handling is configured under Go, Imports.Ctrl+Alt+SCmd+,
Save AllWith Reformat code switched on in Actions on Save, the default, saving also runs the built-in formatter and gofmt.Ctrl+SCmd+S
New in This DirectoryCtrl+Alt+InsertCtrl+Option+N
New Scratch FileOpens the New Scratch File window, where you pick the language of the file, Go for example.Ctrl+Alt+Shift+InsertCmd+Shift+N
Detach editor tabMoves the active tab into a window of its own; drag it back over the main window to re-attach it.Shift+F4Shift+F4
Close active tabCloses only the tab that has the focus; a middle click anywhere on a tab does the same.Ctrl+F4Cmd+W
Jump to Navigation BarPuts the focus on the navigation bar; move along the path with the arrow keys and press Enter to open a file.Alt+HomeCmd+Up
Show file path popupLists the directories on the path of the file being edited; choose one and press Enter to open that location.Ctrl+Alt+F12Cmd+Option+F12
Bigger font in all editorsChanges the code font size globally, and a zoom indicator at the bottom of the editor shows the new size.Alt+Shift+.Ctrl+Shift+.
Smaller font in all editorsThe Windows key is Alt, Shift and comma; the macOS keymap uses Ctrl in place of Alt.Alt+Shift+,Ctrl+Shift+,
Open the Switch menuSwitches between schemes, keymaps and viewing modes from one popup; the same key undoes the change.Ctrl+`Ctrl+`

Basic editing 19

ActionWindows / LinuxMac
CutA line cut without a selection is later pasted above the current line, not at the caret.Ctrl+XCmd+X
CopyWithout a selection the whole current line is copied as it is.Ctrl+CCmd+C
PasteWith several carets, a multi-line clipboard is pasted one line per caret.Ctrl+VCmd+V
Paste as Plain TextSkips the smart paste that, for example, adds comment markers to lines pasted into a comment.Ctrl+Alt+Shift+VCmd+Option+Shift+V
Paste from HistoryGoLand keeps what you copied earlier; pick an entry in the dialog and choose Paste.Ctrl+Shift+VCmd+Shift+V
Copy PathsCtrl+Shift+CCmd+Shift+C
Copy ReferenceBuilds a reference string that includes the line number of the line or symbol at the caret.Ctrl+Alt+Shift+CCmd+Option+Shift+C
UndoAlso reverts a refactoring such as Move.Ctrl+ZCmd+Z
RedoShift added to the Undo key in both keymaps; Ctrl with Y deletes a line here.Ctrl+Shift+ZCmd+Shift+Z
Indent SelectionTabTab
Unindent Line or SelectionInside an expanded live template the same key steps back to the previous variable.Shift+TabShift+Tab
Auto-Indent LinesReformats only the indents of the selected fragment, following the code style settings.Ctrl+Alt+ICtrl+Option+I
Start New LineOpens an empty line below the current one and puts the caret there.Shift+EnterShift+Return
Start new line aboveOpens an empty line above the current one and moves the caret up to it.Ctrl+Alt+EnterCmd+Option+Return
Delete LineDeletes the line that holds the caret; the macOS keymap puts it on Cmd and Backspace.Ctrl+YCmd+Backspace
Join LinesPulls the next line up into the caret's line; repeat until everything needed is joined. Same key on a Mac.Ctrl+Shift+JCtrl+Shift+J
Duplicate Line or SelectionThe same key is Show Diff in the Commit tool window and Compare Files in the Project tool window.Ctrl+DCmd+D
Toggle CaseFlips the selected fragment between upper and lower case; a CamelCase name becomes lower case.Ctrl+Shift+UCmd+Shift+U
Unwrap or removeShows the unwrap and remove actions available at the caret, with different background colors for code that stays and code that goes.Ctrl+Shift+DeleteCmd+Shift+Delete

Caret navigation 13

ActionWindows / LinuxMac
Go to previous wordWhere the caret stops when moving by words can be configured in the editor settings.Ctrl+LeftOption+Left
Go to next wordBy default the caret lands at the end of the current word.Ctrl+RightOption+Right
Go to line startHome in the Windows keymap, Cmd and the Left arrow in the macOS one.HomeCmd+Left
Go to line endEnd in the Windows keymap, Cmd and the Right arrow in the macOS one.EndCmd+Right
Go to matching braceJumps between the opening and closing brace of a code block; the Mac key drops Shift.Ctrl+Shift+MCtrl+M
Go to code block startOn a Mac both code block keys take Cmd and Option with the bracket.Ctrl+[Cmd+Option+[
Go to code block endCtrl+]Cmd+Option+]
Go to top of editorCtrl+Page UpCmd+Page Up
Go to bottom of editorCtrl+Page DownCmd+Page Down
Page UpPage UpPage Up
Page DownPage DownPage Down
Go to start of fileCtrl+HomeCmd+Home
Go to end of fileCtrl+EndCmd+End

Select text 19

ActionWindows / LinuxMac
Select AllCtrl+ACmd+A
Extend selection one character leftShift+LeftShift+Left
Extend selection one character rightShift+RightShift+Right
Extend selection to previous wordCtrl+Shift+LeftOption+Shift+Left
Extend selection to next wordCtrl+Shift+RightOption+Shift+Right
Extend selection to line startShift+HomeCmd+Shift+Left
Extend selection to line endShift+EndCmd+Shift+Right
Extend selection one line upIn column selection mode this adds a caret on the line above instead.Shift+UpShift+Up
Extend selection one line downIn column selection mode this adds a caret on the line below instead.Shift+DownShift+Down
Extend selection to block startCtrl+Shift+[Cmd+Option+Shift+[
Extend selection to block endCtrl+Shift+]Cmd+Option+Shift+]
Extend selection to top of editorCtrl+Shift+Page UpCmd+Shift+Page Up
Extend selection to bottom of editorCtrl+Shift+Page DownCmd+Shift+Page Down
Extend selection one page upShift+Page UpShift+Page Up
Extend selection one page downShift+Page DownShift+Page Down
Extend selection to start of fileCtrl+Shift+HomeCmd+Shift+Home
Extend selection to end of fileWith column selection mode on and the caret on the first line, this puts a caret on every line.Ctrl+Shift+EndCmd+Shift+End
Extend SelectionEach press widens the selection by one code construct: symbol, line, method body, method, whole file.Ctrl+WOption+Up
Shrink SelectionWalks the same steps back, from the whole file down to the single symbol.Ctrl+Shift+WOption+Down

Code folding 10

ActionWindows / LinuxMac
ExpandUnfolds the fragment at the caret, for example one function or a block in curly braces.Ctrl+Num +Cmd+Num +
CollapseFolds the code fragment the caret is in; these keys use the numeric keypad's plus and minus.Ctrl+Num -Cmd+Num -
Expand RecursivelyOpens the current fragment together with every region nested inside it.Ctrl+Alt+Num +Cmd+Option+Num +
Collapse RecursivelyCloses the current fragment and all the regions under it.Ctrl+Alt+Num -Cmd+Option+Num -
Expand AllUnfolds every fragment in the selection or in the current file.Ctrl+Shift+Num +Cmd+Shift+Num +
Collapse AllFolds every fragment in the selection or, with nothing selected, in the whole file, for example all methods.Ctrl+Shift+Num -Cmd+Shift+Num -
Fold SelectionTurns the selected code into a foldable fragment; the same key expands and collapses a custom folding region.Ctrl+.Cmd+.
Expand to levelA sequence: the chord, then a digit from 1 to 5 for how many nesting levels of the current fragment to open.Ctrl+Num *then1-5Cmd+Num *then1-5
Expand all to levelApplies the chosen nesting level to every collapsed fragment of the file; the Mac chord uses Option where Windows uses Shift.Ctrl+Shift+Num *then1-5Cmd+Option+Num *then1-5
Go to custom folding regionNavigates to a region that was marked as a custom folding region with dedicated comments.Ctrl+Alt+.Cmd+Option+.

Multiple carets and selection ranges 11

Adding a caret on the line above or below is a gesture rather than a chord: two quick presses of Ctrl (Option on a Mac), keeping the key down after the second, then an arrow key. With virtual space switched on, each new caret sits exactly above or below the current one.

ActionWindows / LinuxMac
Add or remove a caretClick where the extra caret should go; clicking an existing caret removes it, except the last one.Alt+ClickOption+Click
Toggle Column Selection ModeWhile the mode is on, a Column indicator appears in the status bar.Alt+Shift+InsertCmd+Shift+8
Clone Caret AboveTap the modifier twice and keep it down on the second tap, then press the Up arrow.CtrlthenCtrl+UpOptionthenOption+Up
Clone Caret BelowTap the modifier twice and keep it down on the second tap, then press the Down arrow.CtrlthenCtrl+DownOptionthenOption+Down
Add carets to ends of selected linesSelect a block first; every line of it gets a caret at its end.Alt+Shift+GOption+Shift+G
Select next occurrenceMatching is case-sensitive; after the second hit, F3 skips an occurrence and selects the following one.Alt+JCtrl+G
Select All OccurrencesSelects every case-sensitive match of the word or range in the document at once.Ctrl+Alt+Shift+JCmd+Ctrl+G
Deselect last occurrenceDrops the selection added most recently and keeps the earlier ones.Alt+Shift+JCtrl+Shift+G
Rectangular selection to click pointPut the caret at one corner, then use this click at the diagonally opposite corner.Alt+Shift+Middle-clickOption+Shift+Middle-click
Drag a rectangular selectionNeeds column selection mode to be off.Alt+Shift+ClickOption+Shift+Click
Drag additional rectangular selectionsEach drag over another part of the code adds one more rectangle to the selection.Ctrl+Alt+Shift+ClickCmd+Option+Shift+Click

Coding assistance 25

With XWin, the keymap JetBrains provides for Linux, Surround With leaves Ctrl + Alt + T for Ctrl + Alt + Shift + B.

ActionWindows / LinuxMac
Basic CompletionOn a declaration name, a second press adds types from module dependencies and a third the whole project.Ctrl+SpaceCtrl+Space
Type-Matching CompletionNarrows the suggestion list to values that suit the current context.Ctrl+Shift+SpaceCtrl+Shift+Space
Second Basic CompletionCtrl+Alt+SpaceCtrl+Option+Space
Complete Current StatementMakes the current construct syntactically correct, for example by balancing its parentheses.Ctrl+Shift+EnterCmd+Shift+Return
Parameter InfoReopens the parameter popup when it has closed or is set not to appear automatically.Ctrl+PCmd+P
Quick DocumentationShows the documentation in a popup; pressing twice moves it to the Documentation tool window. F1 on a Mac.Ctrl+QF1
External DocumentationOpens the documentation for the symbol in a web browser; the action goes to pkg.go.dev.Shift+F1Shift+F1
Type InfoDisplays the type of the expression or code element at the caret.Ctrl+Shift+PCtrl+Shift+P
Context InfoTells you which element the caret is in when its declaration is not visible; the Mac key is a different chord.Alt+QCtrl+Shift+Q
GenerateIn a Go file the popup also creates tests: an empty test file or tests for a function, file or package.Alt+InsertCmd+N
Implement MethodsThe help uses it to create a type: choose Create Type and name the interface the new type has to implement.Ctrl+ICtrl+I
Surround WithWraps the selected fragment in a construct chosen from a popup, custom folding comments included.Ctrl+Alt+TCmd+Option+T
Insert Live TemplateOpens the list of live templates to pick from, instead of typing an abbreviation and pressing Tab.Ctrl+JCmd+J
Surround with Live TemplateWraps the selected code in a template taken from the suggestion list.Ctrl+Alt+JCmd+Option+J
Reformat CodeRuns GoLand's own formatter, which, unlike gofmt, copes with incomplete code and can be applied to a selected block.Ctrl+Alt+LCmd+Option+L
Reformat File dialogOpens a dialog with an Optimize imports checkbox; once it is selected, Reformat Code tidies the imports in this project as well.Ctrl+Alt+Shift+LCmd+Option+Shift+L
Optimize ImportsCleans up the import block of the current file; the macOS keymap keeps Ctrl and swaps Alt for Option.Ctrl+Alt+OCtrl+Option+O
Move Statement UpCarries the whole statement at the caret upwards with a syntax check; where the move is not allowed, the action is disabled.Ctrl+Shift+UpCmd+Shift+Up
Move Statement DownCtrl+Shift+DownCmd+Shift+Down
Move Element LeftCtrl+Alt+Shift+LeftCmd+Option+Shift+Left
Move Element RightThe keymap page labels this row Move Statement Right; the key is the counterpart of Move Element Left.Ctrl+Alt+Shift+RightCmd+Option+Shift+Right
Move Line UpMoves the current line only, where Move Statement carries a whole statement.Alt+Shift+UpOption+Shift+Up
Move Line DownAlt+Shift+DownOption+Shift+Down
Toggle line commentPress it again on a commented line to remove the comment.Ctrl+/Cmd+/
Toggle block commentThe Mac binding uses Option where the Windows binding uses Shift.Ctrl+Shift+/Cmd+Option+/

Context navigation 21

ActionWindows / LinuxMac
Next MethodMoves the caret from method to method; separator lines between methods can be switched on in the editor settings.Alt+DownCtrl+Shift+Down
Previous MethodAlt+UpCtrl+Shift+Up
Go to Line or ColumnType a line number, a column number, or both in the dialog; the Mac key is Cmd with L.Ctrl+GCmd+L
SwitcherKeep Ctrl down to hold the popup open and press Tab to move through open files and tool windows.Ctrl+TabCtrl+Tab
Select InOpens a popup for locating the current file elsewhere, for example in the Project view.Alt+F1Option+F1
Recent FilesA second press narrows the popup to files that were edited recently.Ctrl+ECmd+E
Recent LocationsShows recently visited places as code snippets, latest first; pressing the key again keeps only locations with changed code.Ctrl+Shift+ECmd+Shift+E
Recent ChangesLists recent local and external changes to the project, which can be reverted from there.Alt+Shift+COption+Shift+C
Last Edit LocationTakes you back to the spot where you last edited code.Ctrl+Shift+BackspaceCmd+Shift+Backspace
Navigate backGoes to the previous caret position; the macOS keymap uses Cmd with a square bracket.Ctrl+Alt+LeftCmd+[
Navigate forwardCtrl+Alt+RightCmd+]
Select Next TabMoves between open editor tabs; the Mac keys are Cmd, Shift and a square bracket.Alt+RightCmd+Shift+]
Select Previous TabAlt+LeftCmd+Shift+[
Toggle anonymous bookmarkMarks the caret's line, or an item selected in the Project tool window, with a bookmark that has no mnemonic.F11F3
Toggle mnemonic bookmarkAsks for the number or letter that will identify the bookmark; confirm it with Enter.Ctrl+F11Option+F3
Toggle bookmark with digitSets or removes the bookmark numbered with the digit you press.Ctrl+Shift+0-9Ctrl+Shift+0-9
Jump to bookmark by digitHold Ctrl and press the bookmark's digit, on a Mac as well.Ctrl+0-9Ctrl+0-9
Show line bookmarksOpens a popup with the line bookmarks set in the code.Shift+F11Cmd+F3
Show Mnemonic BookmarksCtrl+Shift+F11Cmd+Option+F3
Next OccurrenceSteps through the entries of a tool window: bookmarks, search results or failed tests on the Test Runner tab.Ctrl+Alt+DownCmd+Option+Down
Previous OccurrenceCtrl+Alt+UpCmd+Option+Up

Find everything 13

ActionWindows / LinuxMac
Search EverywherePress Shift twice; the window first lists recent files and finds files, types, symbols, actions and settings.ShiftthenShiftShiftthenShift
Find ActionType a command or setting name and press Enter to run it; Alt and Enter on a result assigns a shortcut.Ctrl+Shift+ACmd+Shift+A
Go to TypeOpens the Search Everywhere window with its scope already narrowed to types.Ctrl+NCmd+O
Go to FileFinds a file or directory by name and accepts CamelCase and snake_case abbreviations.Ctrl+Shift+NCmd+Shift+O
Go to SymbolCtrl+Alt+Shift+NCmd+Option+O
File StructureShows the elements of the open file in a popup that narrows as you type.Ctrl+F12Cmd+F12
FindSearches within the open file; pressed in the Documentation tool window, it searches the documentation text.Ctrl+FCmd+F
Find NextF3Cmd+G
Find PreviousShift+F3Cmd+Shift+G
Next occurrence of word at caretHighlights the word at the caret and jumps to its next occurrence; the predefined macOS keymap has no key for it.Ctrl+F3—
ReplaceFind and replace within the current file.Ctrl+RCmd+R
Find in FilesA string highlighted in the editor is placed in the search field automatically.Ctrl+Shift+FCmd+Shift+F
Replace in FilesOpens the Replace in Path dialog for a project-wide search and replace.Ctrl+Shift+RCmd+Shift+R

Code analysis 5

ActionWindows / LinuxMac
Show Context ActionsLists quick-fixes and intention actions that apply at the caret; a preview of the result opens automatically.Alt+EnterOption+Return
Error DescriptionShows a description of the error or warning the caret is on.Ctrl+F1Cmd+F1
Next Highlighted ErrorMoves the caret to the following problem that code analysis has highlighted in the file.F2F2
Previous Highlighted ErrorShift+F2Shift+F2
Run Inspection by NameCtrl+Alt+Shift+ICmd+Option+Shift+I

Run and debug 28

Linux users who pick XWin in the help's keymap selector get the digit 9 instead of F9 in the run-to-cursor keys: Alt + Shift + 9 for Run to Cursor (Alt + F9 here) and Ctrl + Alt + 9 for Force Run to Cursor (Ctrl + Alt + F9 here). The left column shows the Windows keymap.

ActionWindows / LinuxMac
Run AnythingTwo taps of Ctrl in both keymaps.CtrlthenCtrlCtrlthenCtrl
Build ProjectCtrl+F9Cmd+F9
RebuildCtrl+Shift+F9Cmd+Shift+F9
RunStarts the run configuration selected in the Run widget; on a Mac it is Ctrl with R.Shift+F10Ctrl+R
Choose configuration and runOpens a menu of run configurations to launch one of them.Alt+Shift+F10Ctrl+Option+R
StopTerminates the process at once; with two or more running, you choose which one.Ctrl+F2Cmd+F2
Stop Background ProcessesCtrl+Shift+F2Cmd+Shift+F2
RerunStops the running application and starts it again; on the Test Runner tab it reruns all tests of the session.Ctrl+F5Cmd+R
DebugStarts a debug session for the configuration selected in the Run widget.Shift+F9Ctrl+D
Choose configuration and debugPick an existing run/debug configuration from the menu and press Enter to debug it.Alt+Shift+F9Ctrl+Option+D
Attach to ProcessCtrl+Alt+F5Option+Shift+F5
Resume ProgramContinues execution of a program that the debugger has paused.F9Cmd+Option+R
Step OverRuns to the next line of the current method without entering the methods called on the way.F8F8
Force Step OverAlt+Shift+F8Option+Shift+F8
Step IntoEnters the method called at the current execution point.F7F7
Smart Step IntoLets you pick which method call on the line to enter; confirm the choice with Enter or F7.Shift+F7Shift+F7
Force Step IntoAlt+Shift+F7Option+Shift+F7
Step OutLeaves the current method and stops at the line executed right after it.Shift+F8Shift+F8
Run to CursorResumes execution and pauses again when it reaches the line with the caret.Alt+F9Option+F9
Force Run to CursorCtrl+Alt+F9Cmd+Option+F9
Show Execution PointHighlights the current execution point in the editor and shows its stack frame.Alt+F10Option+F10
Evaluate ExpressionOpens the evaluation dialog; select a variable or expression first to have it filled in.Alt+F8Option+F8
Quick Evaluate ExpressionSelect an expression in the code, or only the portion of it that matters, before pressing the key.Ctrl+Alt+F8Cmd+Option+F8
Toggle Line BreakpointSets or removes a breakpoint on the executable line at the caret.Ctrl+F8Cmd+F8
Toggle temporary breakpointCtrl+Alt+Shift+F8Cmd+Option+Shift+F8
View BreakpointsOpens the Breakpoints dialog, where Go error breakpoints are set and breakpoints are grouped or removed.Ctrl+Shift+F8Cmd+Shift+F8
Edit BreakpointListed by JetBrains on the same key as View Breakpoints.Ctrl+Shift+F8Cmd+Shift+F8
Set ValueChanges the value of the variable selected in the debugger, to test how the program behaves with other data.F2F2

Testing 5

ActionWindows / LinuxMac
Go to Test or Test SubjectJumps between a test and its subject; on the way to a test, a popup may list tests or offer a new one.Ctrl+Shift+TCmd+Shift+T
Run tests at caretIn a test file it runs every test of the file; with the caret on one test, only that test.Ctrl+Shift+F10Ctrl+Shift+R
Expand test treeOn the Test Runner tab, opens all nodes of the test tree; needs the plus key of the numeric keypad.Ctrl+Num +Cmd+Num +
Collapse test treeCloses all nodes of the test tree on the Test Runner tab.Ctrl+Num -Cmd+Num -
Manage Coverage ReportsOpens the list of coverage suites, where you tick the ones whose data the IDE should display.Ctrl+Alt+F6Cmd+Option+F6

Refactorings 12

ActionWindows / LinuxMac
Refactor ThisA predefined quick list of the refactorings; on a Mac it is Ctrl with T.Ctrl+Alt+Shift+TCtrl+T
RenameIdentical in both keymaps; in the Project tool window it renames the selected item.Shift+F6Shift+F6
Change SignatureCtrl+F6Cmd+F6
InlineCtrl+Alt+NCmd+Option+N
MoveMoves the selected declaration to another package or file; the dialog lists declarations that can go with it.F6F6
CopyCreates a copy of a file, directory or package in a different directory or package.F5F5
Extract MethodCtrl+Alt+MCmd+Option+M
Extract ConstantTurns the selected expression into a constant; by default the refactoring is done in place, without a dialog.Ctrl+Alt+CCmd+Option+C
Introduce VariableCtrl+Alt+VCmd+Option+V
Introduce FieldCtrl+Alt+FCmd+Option+F
Introduce ParameterCtrl+Alt+PCmd+Option+P
Safe DeleteAlt+DeleteCmd+Delete

Version control 9

ActionWindows / LinuxMac
VCS Operations PopupGathers the Git commands in a single popup, which the help also names the Git Operations Popup.Alt+`Ctrl+V
CommitOpens the Commit tool window and selects the entire active changelist.Ctrl+KCmd+K
Commit and PushPushes to the remote repository right after committing; the commit checks are still done before the commit.Ctrl+Alt+KCmd+Option+K
Stage fileWorks on the file selected in the Commit tool window and stages all of it.Ctrl+Alt+ACmd+Option+A
Update ProjectCtrl+TCmd+T
PushOpens the Push dialog; Shift is added to the Commit key in both keymaps.Ctrl+Shift+KCmd+Shift+K
RollbackCtrl+Alt+ZCmd+Option+Z
Next ChangeIn a file under version control, moves the caret to the following changed fragment.Ctrl+Alt+Shift+DownCtrl+Option+Shift+Down
Previous ChangeOn a Mac both change keys are Ctrl, Option and Shift with an arrow.Ctrl+Alt+Shift+UpCtrl+Option+Shift+Up

Diff viewer 8

ActionWindows / LinuxMac
Show DiffIn the Commit tool window, compares the selected file with its repository version.Ctrl+DCmd+D
Compare FilesWith two files selected in the Project tool window, opens them in a new Diff Viewer tab.Ctrl+DCmd+D
Next DifferenceAt the last difference, another press offers to continue with the next locally modified file.F7F7
Previous DifferenceShift+F7Shift+F7
Accept Left SideCtrl+Alt+RCmd+Ctrl+Right
Accept Right SideCtrl+Alt+ACmd+Ctrl+Left
Select Opposite Diff PaneMoves the caret between the left and right panes; the active pane is the one with the caret.Ctrl+Shift+TabCtrl+Shift+Tab
Show diff settings popupOpens a menu of the most commonly used diff commands.Ctrl+Shift+DCmd+Shift+D

Tool windows 24

ActionWindows / LinuxMac
Show Project windowThe Alt and digit keys of this group become Cmd and digit in the macOS keymap.Alt+1Cmd+1
Show Bookmarks windowLists all bookmarks in their lists, together with the breakpoints of the project.Alt+2Cmd+2
Show Find windowAlt+3Cmd+3
Show Run windowAlt+4Cmd+4
Show Debug windowReopens the Debug tool window if it was closed during a session.Alt+5Cmd+5
Show Problems windowAlt+6Cmd+6
Show Structure windowAlt+7Cmd+7
Show Services windowAlt+8Cmd+8
Show Version Control windowAlt+9Cmd+9
Show Commit windowAlt+0Cmd+0
Show Terminal windowPressed inside the terminal, it closes the tool window and returns to the editor.Alt+F12Option+F12
Hide Active Tool WindowShift+EscShift+Esc
Hide All Tool WindowsLeaves only the active editor on screen, which the help calls maximizing the editor pane.Ctrl+Shift+F12Cmd+Shift+F12
Return to last tool windowSends the focus from the editor to whichever tool window was active before.F12F12
Stretch to LeftLeft and Right resize a vertical tool window; the macOS keymap uses Ctrl and Option without Shift.Ctrl+Alt+Shift+LeftCtrl+Option+Left
Stretch to RightCtrl+Alt+Shift+RightCtrl+Option+Right
Stretch to TopUp and Down resize a horizontal tool window.Ctrl+Alt+Shift+UpCtrl+Option+Up
Stretch to BottomCtrl+Alt+Shift+DownCtrl+Option+Down
Maximize Tool WindowStretches the active tool window to its maximum width or height.Ctrl+Shift+'Cmd+Shift+'
Restore default layoutThe menu equivalent is Window, Layouts, Default; the key is the same in both keymaps.Shift+F12Shift+F12
Jump to SourceOpens the file of the item selected in a tool window, such as a search result, a code issue or a bookmark.F4Cmd+Down
Open in Right SplitIn the Project tool window, opens the selected file in the right half of a split editor.Shift+EnterShift+Return
Close Run tabBesides closing the tab, it terminates the process that was running in it.Ctrl+Shift+F4Ctrl+Shift+F4
New terminal tabStarts another terminal session in a tab of its own; in the editor the Windows key is Go to Test.Ctrl+Shift+TCmd+T

Notes

Go-specific uses of shared keys

Ctrl + Shift + T jumps between a function and its test, and may offer to create a new test; Alt + Insert generates an empty test file or tests for a function, a file or a package. Ctrl + B on an identifier goes to its declaration, on a name inside a comment to the package-level declaration it refers to, and in a go.work file to the module listed there. Alt + F7 finds usages — for a method, usages of the interface method; Ctrl + Alt + Shift + F7 searches for the current method instead. Ctrl + U navigates to the interface, or to all the types that implement an interface. Ctrl + Shift + Enter completes the statement being typed and, in structs, slices and other composite literals, inserts the trailing comma Go requires. Ctrl + Shift + N opens any file and Ctrl + E lists recent ones; Ctrl + F12 shows the current file's structure as a popup.

Fixing and formatting

Alt + Enter lists the quick-fixes and intention actions for the code at the caret, with a preview of what each would change. Ctrl + Alt + L runs GoLand's built-in formatter, which also works on incomplete code and on a selected block; gofmt itself runs on save together with the built-in formatter while Reformat code is enabled in Actions on Save, and the help gives Go Fmt File, Goimports File, Go Generate File and Go Vet File as commands under Tools › Go Tools and prints no key for them. Ctrl + Alt + O optimizes imports. Ctrl + / comments a line, Ctrl + D duplicates one, F2 steps to the next highlighted error, and Shift + F6 renames a symbol together with the references to it.

Running tests and programs

Ctrl + Shift + F10 runs what is at the caret: in a test file all of its tests, on a single test only that one. Shift + F10 launches the configuration selected in the Run widget, Alt + Shift + F10 lets you pick another one, and Ctrl + F5 reruns. On a Mac these are Ctrl + Shift + R, Ctrl + R, Ctrl + Option + R and Cmd + R. After a run with failures, Ctrl + Alt + Down and Ctrl + Alt + Up step forward and back through the failed tests on the Test Runner tab, and Ctrl + F2 stops the test process. Shift, Shift searches everything including actions and settings, while Ctrl + Shift + A locates a named action — such as Go Generate File, for which the help prints no key.

Questions

Is there a GoLand shortcut for go fmt?

The help prints none: it gives Go Fmt File and Go Fmt Project as commands under Tools › Go Tools, so check Settings › Keymap for a binding in your version. Ctrl + Alt + L (Cmd + Option + L on a Mac) runs GoLand's built-in formatter, and with Reformat code enabled in Actions on Save, which is the default, Ctrl + S runs both the built-in formatter and gofmt.

How do I jump between a Go function and its test?

Press Ctrl + Shift + T (Cmd + Shift + T on a Mac) with the caret on the function or on the test. Going to the test subject is immediate; going to a test may show a popup to choose a test or create a new one. Alt + Insert (Cmd + N) generates test files directly.

Which key runs the test under the caret?

Ctrl + Shift + F10, or Ctrl + Shift + R on a Mac. With the caret elsewhere in a test file it runs every test in that file, and on a folder selected in the Project tool window it runs the tests of the folder. Ctrl + F5 (Cmd + R) reruns the session.

Why does Find Usages on a Go method list interface usages?

In GoLand Alt + F7 looks for usages of the interface method. To search for usages of the current method only, press Ctrl + Alt + Shift + F7 (Cmd + Option + Shift + F7 on a Mac), which opens the Find Usages dialog.

Which GoLand keys change on Linux?

The help has no separate Linux table, but its keymap selector includes XWin, and the shortcut data behind GoLand's topic pages shows where XWin departs from the Windows column: Manage Coverage Reports moves to Ctrl + Alt + 6, the file path popup to Ctrl + Alt + Shift + 2 and Surround With to Ctrl + Alt + Shift + B, while several debugger and usage keys trade their function key for a digit — Ctrl + Alt + 8 for Quick Evaluate Expression, Alt + Shift + 9 and Ctrl + Alt + 9 for Run to Cursor and Force Run to Cursor, Ctrl + Alt + 7 for Show Usages and Ctrl + Alt + Shift + 7 for the Find Usages dialog. GNOME and KDE keymaps are available as plugins.

Sources and checks

24 more source pages

Every row on this page was matched to a line in the documentation above on . A binding that could not be found there is not listed.

Found a wrong or missing key? Tell us and it gets checked against the source. How we verify describes the process and its limits.