# How to Modify the PhotoGIMP shortcutsrc File Directly

> Learn to directly modify the PhotoGIMP shortcutsrc file to customize keyboard shortcuts using GIMP's RC syntax. Edit (action "name" "shortcut") expressions for personalized shortcuts.

- Repository: [Diolinux/PhotoGIMP](https://github.com/Diolinux/PhotoGIMP)
- Tags: how-to-guide
- Published: 2026-05-20

---

**You can directly customize PhotoGIMP's keyboard shortcuts by editing the `shortcutsrc` file in GIMP's configuration directory using GIMP's RC syntax with `(action "name" "shortcut")` expressions.**

PhotoGIMP, an open-source project by Diolinux that brings Photoshop-style shortcuts to GIMP, stores its keyboard mappings in a plain-text `shortcutsrc` file. While GIMP provides a GUI for shortcut editing, directly modifying this configuration file allows for bulk changes, version control, and customization of shortcuts not exposed in the interface.

## Locate the shortcutsrc File on Your System

The `shortcutsrc` file resides in GIMP's user configuration directory, with the specific path varying by operating system:

- **Linux:** `~/.config/GIMP/3.0/shortcutsrc`
- **Windows:** `%APPDATA%\GIMP\3.0\shortcutsrc`
- **macOS:** `~/Library/Application Support/GIMP/3.0/shortcutsrc`

In the PhotoGIMP repository, the default template is located at [`./.config/GIMP/3.0/shortcutsrc`](https://github.com/Diolinux/PhotoGIMP/blob/master/.config/GIMP/3.0/shortcutsrc). When you install PhotoGIMP, this file populates your local GIMP configuration, establishing the Photoshop-style keybindings documented in the project's [[`README.md`](https://github.com/Diolinux/PhotoGIMP/blob/main/README.md)](https://github.com/Diolinux/PhotoGIMP/blob/master/README.md) around line 176.

## Understand the shortcutsrc File Format

The `shortcutsrc` file uses **GIMP RC syntax**, a Lisp-like format where each shortcut mapping follows this pattern:

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

```

- **`action-name`**: The internal GIMP command identifier (e.g., `edit-undo`, `layers-duplicate`).
- **`key-combination`**: Uses modifier placeholders and literal keys:
  - `<Primary>` represents **Ctrl** on Linux, **Cmd** on macOS, and the **Windows** key on Windows.
  - `<Shift>` and `<Alt>` represent their respective modifier keys.
  - Literal keys (e.g., `s`, `F1`, `Page_Down`) are written directly.

Lines beginning with `#` are comments and are ignored by GIMP, allowing you to disable mappings by commenting them out.

## Step-by-Step Guide to Editing shortcutsrc

Follow these steps to safely modify your PhotoGIMP shortcuts directly:

1. **Back up the original file** before making changes:

   ```bash
   cp ~/.config/GIMP/3.0/shortcutsrc ~/.config/GIMP/3.0/shortcutsrc.backup
   ```

2. **Open the file** in your preferred text editor (VS Code, nano, Vim, or Notepad).

3. **Locate the action** you want to modify or add. Use GIMP's internal action names (visible in *Edit → Keyboard Shortcuts* when hovering over commands).

4. **Modify an existing entry** by changing the second string. For example, to change the *Undo* shortcut to **Ctrl+U**:

   ```lisp
   (action "edit-undo" "<Primary>u")
   ```

5. **Add new shortcuts** by inserting new lines. To assign **Ctrl+Shift+D** to *Duplicate Layer*:

   ```lisp
   (action "layers-duplicate" "<Primary><Shift>d")
   ```

6. **Save the file** and close your editor.

7. **Restart GIMP** or reload shortcuts via *Edit → Keyboard Shortcuts → Refresh* to apply your changes.

## Practical shortcutsrc Modifications

Here are concrete examples you can copy directly into your `shortcutsrc` file:

### Change the Save Shortcut to Ctrl+Alt+S

Replace the default **Ctrl+S** with **Ctrl+Alt+S**:

```lisp

# Modified save shortcut

(action "file-save" "<Primary><Alt>s")

```

### Add a Shortcut for New Layer from Visible

Assign **Ctrl+Shift+N** to the *New from Visible* layer command:

```lisp
(action "layer-new-from-visible" "<Primary><Shift>n")

```

After saving and restarting GIMP, verify these mappings by searching for the action names in *Edit → Keyboard Shortcuts*.

## Summary

- **PhotoGIMP** stores its Photoshop-style shortcuts in the `shortcutsrc` file located in GIMP's configuration directory.
- The file uses `(action "name" "shortcut")` syntax with modifiers like `<Primary>`, `<Shift>`, and `<Alt>`.
- You can modify the file directly to bulk-edit shortcuts, add custom bindings, or override defaults not exposed in the GUI.
- Always back up your `shortcutsrc` before editing, and restart GIMP to apply changes.
- The source template is maintained in the Diolinux/PhotoGIMP repository at `.config/GIMP/3.0/shortcutsrc`.

## Frequently Asked Questions

### Where does PhotoGIMP store the shortcutsrc file on Windows?

On Windows systems, the `shortcutsrc` file is located at `%APPDATA%\GIMP\3.0\shortcutsrc`. You can paste this path into File Explorer's address bar to navigate directly to the file, then open it with Notepad or any text editor to modify PhotoGIMP's keyboard shortcuts.

### What does the `<Primary>` modifier represent in the shortcutsrc file?

The `<Primary>` placeholder maps to **Ctrl** on Linux, **Cmd** on macOS, and the **Windows** key on Windows systems. This allows the `shortcutsrc` file to remain portable across operating systems while maintaining consistent physical key positions for core shortcuts like saving, undoing, and copying.

### Can I comment out shortcuts instead of deleting them?

Yes, you can disable any shortcut by adding a `#` at the beginning of the line. GIMP ignores lines starting with `#`, allowing you to preserve the original syntax for reference or easily re-enable mappings later without searching through git history or backups.

### Why do my shortcutsrc changes not appear in GIMP?

Changes to the `shortcutsrc` file require a GIMP restart to take effect, or you can reload them without restarting by opening *Edit → Keyboard Shortcuts* and clicking the *Refresh* button. If changes still don't appear, ensure you saved the file in plain text format and used correct GIMP action names and syntax.