What Is the Purpose of the `shortcutsrc` File in PhotoGIMP?

The shortcutsrc file stores the complete keyboard shortcut configuration that maps Photoshop-compatible key bindings to GIMP actions in PhotoGIMP.

The shortcutsrc file is a core component of the PhotoGIMP project—an open-source GIMP configuration that mimics Adobe Photoshop's interface and workflow. Located within the bundled GIMP user profile, this file defines every keyboard shortcut that makes the transition from Photoshop seamless for new users.

Where the shortcutsrc File Lives

PhotoGIMP distributes the shortcutsrc file at a specific path within the GIMP configuration directory:

.config/GIMP/3.0/shortcutsrc

When you install PhotoGIMP, this file replaces or supplements the default GIMP shortcuts file. GIMP loads these mappings at startup, applying the Photoshop-style key bindings across all tools and actions.

Understanding the File Format and Syntax

The shortcutsrc file uses GIMP's native shortcut syntax. Each line records an action name paired with a key combination that triggers it.

The structure follows this pattern:

(action "action-name" "key-combination")

For example, the file contains entries like:

(action "select-all" "<Primary>a")
(action "tools-transform-3d" "<Shift>w")
(action "help-help" "F1")

In this syntax, <Primary> represents the Ctrl key (or Cmd on macOS), and standard GTK accelerator notation defines modifier combinations.

Why PhotoGIMP Ships with a Custom shortcutsrc

The primary purpose of bundling a custom shortcutsrc is to provide Photoshop-compatible key bindings out of the box. According to the PhotoGIMP repository's README.md, this file contains "Keyboard shortcuts mapped to match Photoshop," allowing users accustomed to Adobe's software to work in GIMP without relearning muscle memory.

The file includes comprehensive mappings covering:

  • Selection tools (e.g., Ctrl+A for select all)
  • Transform operations (e.g., Shift+W for 3D transform tool)
  • Navigation and help (e.g., F1 for help)
  • Layer operations and filter applications

This configuration eliminates the friction typically experienced when switching between raster graphics editors.

How to View and Modify Shortcuts

Viewing Current Shortcuts via Python-Fu

You can inspect active shortcuts programmatically using GIMP's Python-Fu console. The following code queries the current binding for the "select-all" action:

from gi.repository import Gimp

# Print the shortcut bound to the "select-all" action

print(Gimp.get_default_context().get_shortcut("select-all"))

# → <Primary>a

Editing the File Manually

Advanced users can modify shortcutsrc directly with a text editor. To change the "select-all" shortcut from Ctrl+A to Ctrl+Shift+A, edit the relevant line:


# Change "select-all" from Ctrl-A to Ctrl-Shift-A

(action "select-all" "<Primary><Shift>a")

After saving changes to .config/GIMP/3.0/shortcutsrc, restart GIMP (or reload the configuration) for the modifications to take effect.

Adding Custom Shortcuts for Scripts

You can bind custom Script-Fu commands or Python-Fu plugins to specific keys by appending entries to the file:


# Bind a custom script-fu command to Ctrl-Alt-T

(action "script-fu-my-tool" "<Primary><Alt>t")

Ensure the script is properly installed in GIMP's scripts folder before adding the shortcut reference.

Resetting to Default GIMP Shortcuts

The shortcutsrc file includes a header comment noting: "If you delete this file, all shortcuts will be reset to defaults."

If you remove or rename .config/GIMP/3.0/shortcutsrc, GIMP falls back to its native shortcut scheme, effectively disabling the Photoshop-style mappings. This provides a clean rollback mechanism if you prefer GIMP's standard key bindings or need to troubleshoot shortcut conflicts.

Summary

  • The shortcutsrc file at .config/GIMP/3.0/shortcutsrc defines all keyboard shortcuts for PhotoGIMP.
  • It uses GIMP's native action-key syntax to bind commands to specific key combinations.
  • PhotoGIMP ships this file specifically to replicate Photoshop's keyboard shortcuts, easing the transition for Adobe users.
  • You can view shortcuts via the Python-Fu console, edit the file manually, or delete it to restore default GIMP bindings.

Frequently Asked Questions

What happens if I delete the shortcutsrc file?

If you delete the shortcutsrc file from .config/GIMP/3.0/, GIMP automatically regenerates the file using default GIMP shortcuts on the next startup. This removes all Photoshop-compatible mappings and restores the standard GIMP key binding scheme.

Can I use shortcutsrc with GIMP versions other than 3.0?

The PhotoGIMP repository specifically targets GIMP 3.0, as indicated by the file path .config/GIMP/3.0/shortcutsrc. While the syntax remains compatible across GIMP 2.10 and 3.0, you must place the file in the correct version-specific directory for your GIMP installation (e.g., 2.10/ for GIMP 2.10).

How do I backup my custom shortcut configuration?

Copy the shortcutsrc file from .config/GIMP/3.0/ to a secure backup location before making modifications. Since this single file contains your complete shortcut mapping, restoring it involves simply copying it back to the original path and restarting GIMP.

Are the shortcuts in shortcutsrc editable through GIMP's preferences?

Yes, you can modify shortcuts through GIMP's graphical preferences (Edit > Keyboard Shortcuts), and GIMP will write those changes back to the shortcutsrc file. However, direct file editing offers more control for bulk modifications and allows you to add custom plugin shortcuts that might not appear in the GUI preferences menu.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →