# Reformat File dialog

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/go/2026.3/llms.txt).

> **TL;DR**
> `Code | Reformat Code`
>
>
>
> `Ctrl+Alt+Shift+L` (Windows), `⌘ ⌥ ⇧ L` (macOS), `⌘ ⌥ ⇧ L` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ ⇧ L` (macOS System Shortcuts), `Ctrl+Alt+Shift+L` (XWin), `Ctrl+Alt+Shift+L` (GNOME), `Ctrl+Alt+Shift+L` (KDE), `Ctrl+Alt+Shift+L` (Emacs), `Ctrl+Alt+Shift+L` (Sublime Text), `⌘ ⌥ ⇧ L` (Sublime Text (macOS)), `Ctrl+Alt+Shift+L` (VSCode), `⌘ ⌥ ⇧ L` (VSCode (macOS))

The dialog appears when you press `Ctrl+Alt+Shift+L` (Windows), `⌘ ⌥ ⇧ L` (macOS), `⌘ ⌥ ⇧ L` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ ⇧ L` (macOS System Shortcuts), `Ctrl+Alt+Shift+L` (XWin), `Ctrl+Alt+Shift+L` (GNOME), `Ctrl+Alt+Shift+L` (KDE), `Ctrl+Alt+Shift+L` (Emacs), `Ctrl+Alt+Shift+L` (Sublime Text), `⌘ ⌥ ⇧ L` (Sublime Text (macOS)), `Ctrl+Alt+Shift+L` (VSCode), `⌘ ⌥ ⇧ L` (VSCode (macOS)) in the editor of the current file. If you choose  `Code | Reformat Code` from the main menu or press `Ctrl+Alt+L` (Windows), `⌘ ⌥ L` (macOS), `⌘ ⌥ L` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ L` (macOS System Shortcuts), `Ctrl+Alt+L` (XWin), `Ctrl+Alt+L` (GNOME), `Alt+Shift+L` (KDE), `Ctrl+Alt+L` (Emacs), `Ctrl+Alt+L` (Sublime Text), `⌘ ⌥ L` (Sublime Text (macOS)), `Alt+Shift+F` (VSCode), `⌥ ⇧ F` (VSCode (macOS)), GoLand tries to reformat the source code of the specified scope automatically.

| Item | Description |
| --- | --- |
| Only changes uncommitted to VCS |    If this checkbox is selected, then reformatting will apply only to the code that has been changed locally, but not yet checked in to the repository.        This option is available only for the files under version control.     |
| Selected text | Choose this option to have the currently selected fragment of source code reformatted. |
| Whole file | Choose this option to have all the source code in the current file reformatted. |
| Options |
| Optimize imports | Select this checkbox to remove unused import statements from the code within the selected scope. |
| Rearrange code | Select this checkbox to reorder your source code entries according to the configurations specified in the Arrangement tab of your [Code Style settings](settings-code-style.html).     This checkbox is not available for Python files.   |
|  Code cleanup | Select this option to run the code cleanup inspections. GoLand finds and automatically fixes potentially problematic code fragments.    |
| Do not keep line breaks |  Reformat line breaks according to the code style settings. This option overrides the `Keep when reformatting \| Line breaks` setting.  |
| Run | Click this button to start reformatting the source code within the specified scope. |

> **Tip:**
> You can define rules and format your code as you write it. To define formatting rules for Go,   open the Settings dialog (`Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Comma` (VSCode), `⌘ Comma` (VSCode (macOS))) and navigate to Editor | Code Style | Go.

## See also

### Procedures

[Reformat and rearrange code](reformat-and-rearrange-code.html)

### Reference

[Code Style](settings-code-style.html)

