openrct2-plugin-vim

Vim commands for OpenRCT2

openrct2-plugin-vim

Vim-style modal keybindings for OpenRCT2.

How it works

In normal mode, an off-screen window with a focused textbox captures all keypresses. This gives you count prefixes, multi-key sequences, etc.

In command mode, the indicator bar at the bottom expands to full width and becomes the command input. No new window opens.

Normal mode

Navigation

Key Action
h Scroll left
j Scroll down
k Scroll up
l Scroll right
[count]h/j/k/l Scroll N tiles (e.g. 5j scrolls 5 tiles down)
gg Jump to map start (0, 0)
G Jump to map end
zz Jump to map centre

Viewport

Key Action
r Rotate left
R Rotate right
+ Zoom in
- Zoom out

Mode switching

Key Action
: Enter command mode

Command mode

Press : to open the command input. Type a command and press ENTER. Press ESCAPE to cancel.

Command Action
:pause Pause the game
:unpause Unpause the game
:goto Jump viewport to world coordinates
:wq Save and quit (opens save dialog)
:q / :qa Quit (opens save dialog)
:help Show command list in-game

Add ! to force (e.g. :q!).

Installation

  1. Run npm install
  2. Set the OpenRCT2 path in package.json (default: C:/Users/Marino/Documents/OpenRCT2)
  3. Run npm run build

The plugin copies itself to the OpenRCT2 plugin directory on each build.

Development

npm run build        # build once
npm run watch build  # rebuild on file change

Source files are in src/. Hot-reloading works if enable_hot_reloading = true is set in config.ini.

Toggling

Close the indicator window to turn the plugin off. All shortcuts stop working.

To turn it back on, go to the top toolbar menu and click Vim Keys.

Known issues

  • The capture window holds keyboard focus in normal mode, which conflicts with native rename dialogs.
  • :q! / :qa! still shows the save dialog. The API does not support skipping it.