# Vim in GoLand

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

[IdeaVim](https://plugins.jetbrains.com/plugin/164-ideavim) is a Vim engine for the GoLand editor. It supports the normal, insert, and visual modes, Command-line and Ex modes, Vim regexp and configuration, and other features.

Procedure: Install the IdeaVim plugin

1. In 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))), select Plugins.

2. Find the IdeaVim plugin and click Install.

3. Restart GoLand.

After you restart the GoLand, Vim is enabled and the editor starts operating in the Vim mode. To disable it,  deselect `Tools | Vim` in the main menu.

Procedure: Configure shortcuts

Both Vim and GoLand are keyboard-centric. Your keymap in GoLand may conflict with Vim's key combinations. To resolve this, select the shortcuts you prefer for different actions.

1. Press `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)) to open settings and then select `Editor | Vim`.

2. Find the shortcut and the corresponding IDE action and then select how you want to handle it when you are using Vim:

* Undefined: show a popup notification that suggests to either redefine the IDE shortcut or configure the handler in the settings.

* IDE: perform the IDE action associated with this shortcut.

* Vim: handle it as a Vim shortcut.

## Editing modes

With Vim, the caret is a block when you are in the [Normal mode](http://vimdoc.sourceforge.net/htmldoc/intro.html#Normal).

To change to the [Insert mode](http://vimdoc.sourceforge.net/htmldoc/insert.html#Insert), press `i`, and the cursor will become a line.

In this mode you can type new code or change existing code. You can also enter other Vim modes: for example, press `R` for the [Replace mode](http://vimdoc.sourceforge.net/htmldoc/insert.html#Replace).

To return to the Normal mode, press `Escape` (Windows), `⎋` (macOS), `⎋` (IntelliJ IDEA Classic (macOS)), `⎋` (macOS System Shortcuts), `Escape` (XWin), `Escape` (GNOME), `Escape` (KDE), `Escape, Escape` (Emacs), `Escape` (Sublime Text), `⎋` (Sublime Text (macOS)), `Escape` (VSCode), `⎋` (VSCode (macOS)).

## Vim configuration

Vim is configured using a `vimrc` file. Similarly, the IdeaVim plugin uses an `ideavimrc` file with the same syntax.

Procedure: Create a .ideavimrc file

* In the status bar at the bottom of the IDE window, click the IdeaVim widget and select Create ~/.ideavimrc.

GoLand creates the file and opens it in the editor. You can use this widget later on to quickly access your `ideavimrc` file.

> **Tip:**
> You can find examples of the `ideavimrc` file in this [GitHub discussion](https://jb.gg/share-ideavimrc).

The configuration file will be created in one of the following locations depending on the operating system:

Windows:
`%HOMEPATH%\_ideavimrc`

macOS:
`~/.ideavimrc`

Linux:
`~/.ideavimrc`

> **Note:**
> The location where GoLand looks for `ideavimrc` depends on the `user.home` JVM option, which is set to the user's home directory by default. For more information, refer to [JVM options](tuning-the-ide.html#configure-jvm-options).

Procedure: If the configuration already exists

If you already have a `vimrc` file with your configuration, you can do one of the following:

* Include the configuration from `vimrc` with the `source` command in your `ideavimrc` file:

```PLAINTEXT
source ~/.vimrc
```

This way you can also include other commands in your `ideavimrc` file, which will be applied only to your Vim in GoLand and will not affect actual Vim configuration.

* If you don't want to use your Vim configuration, you can rename `.vimrc` to `.ideavimrc`.

* Create `ideavimrc` as a symlink to `vimrc` if you don't want to modify your Vim in GoLand compared to actual Vim configuration:

Windows:

```SHELL
mklink _ideavimrc _vimrc
```

macOS:

```SHELL
ln -s "$HOME/.vimrc" "$HOME/.ideavimrc"
```

Linux:

```SHELL
ln -s "$HOME/.vimrc" "$HOME/.ideavimrc"
```

## IDE actions

IdeaVim allows you to map IDE features using action IDs.

Procedure: Learn an action ID

1. Press `Ctrl+Shift+A` (Windows), `⌘ ⇧ A` (macOS), `⌘ ⇧ A` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ P` (macOS System Shortcuts), `Ctrl+Shift+A` (XWin), `Ctrl+Shift+A` (GNOME), `Ctrl+Shift+A` (KDE), `Escape, X` (Emacs), `Ctrl+Shift+P` (Sublime Text), `⌘ ⇧ P` (Sublime Text (macOS)), `Ctrl+Shift+P` (VSCode), `F1` (VSCode (macOS)) and type `IdeaVim: Track Action Ids`.

2. Toggle the feature on using the switcher on the right.

Now the IDE will be showing you IDs of actions that you click with the mouse in a popup notification at the bottom of the screen and in the [Notifications](notifications.html) tool window. Note that some actions do not have an ID.

3. Click Copy Action Id to copy an ID or Stop Tracking to disable the tracking mode.

Procedure: Map an action in ideavimrc

1. In the `ideavimrc` file, map an action using the `map` command and the `<Action>` keyword, for example: `map \r <Action>(ReformatCode)`

2. Press `Ctrl+Shift+O` (Windows), `Ctrl+Shift+O` (macOS), `Ctrl+Shift+O` (IntelliJ IDEA Classic (macOS)), `Ctrl+Shift+O` (macOS System Shortcuts), `Ctrl+Shift+O` (XWin), `Ctrl+Shift+O` (GNOME), `Ctrl+Shift+O` (KDE), `Ctrl+Shift+O` (Emacs), `Ctrl+Shift+O` (Sublime Text), `Ctrl+Shift+O` (Sublime Text (macOS)), `Ctrl+Shift+O` (VSCode), `Ctrl+Shift+O` (VSCode (macOS)) to reload the changes.

> **Tip:**
> You can also execute actions as Ex commands. For more information, refer to [IdeaVim documentation](https://jb.gg/abva4t).

## See also

### External Links

[IdeaVim documentation](https://jb.gg/abva4t) [Examples of ideavimrc](https://jb.gg/share-ideavimrc)

