Skip to content

feat: make keybinds configurable with omasnap.conf - #97

Open
TravonteD wants to merge 5 commits into
omacom:mainfrom
TravonteD:configurable-keybinds
Open

feat: make keybinds configurable with omasnap.conf#97
TravonteD wants to merge 5 commits into
omacom:mainfrom
TravonteD:configurable-keybinds

Conversation

@TravonteD

Copy link
Copy Markdown

Problem:

Existing key-bindings can clash with the custom key-bindings that a user may have on their system already.

Solution:

Allow users to set custom key bindings via the configuration file.

Editor shortcuts move from hardcoded Qt::Key checks to bindings loaded
from a [keys] section in omasnap.conf, following the palette/output
config pattern. Each action takes one key or a comma-separated list, so
the aliases keep working by default (marker=C,M; redo=Ctrl+Shift+Z,
Ctrl+Y; zoom +/=/Ctrl+=). Matching is exact on key plus modifiers, and
keypad bits never distinguish. Any unparsable value or a key bound to
two actions of the same phase rejects the whole section back to
defaults with a warning naming the offender; cross-phase reuse stays
legal (R restores a region while selecting, draws rectangles while
editing).

Status lines, tooltips, and the hotkey legend read the primary binding
through keyHint(), so hints follow rebinds instead of lying about keys.
Pin-window and scrolling-panel keys stay fixed.
"marker =" now removes the marker's keys instead of being treated like
an absent line. Missing names still keep their defaults, and unbinding
one action leaves the rest alone.
@TravonteD
TravonteD force-pushed the configurable-keybinds branch from 589b51e to 866d08f Compare August 27, 2026 13:57
The smoke binary loaded keybindings from the developer's real
~/.config/omasnap/omasnap.conf, so a personal [keys] override (e.g.
cycle-tab=Tab) silently flipped the bindings the suite asserts on and
broke the select-phase undim-hole checks. Point XDG_CONFIG_HOME at a
scratch dir so the editor reads its defaults instead of the host's.

Also add Ctrl+0 as a ZoomFit alias: the suite asserts Ctrl+0 restores the
fitted view and the README documents "0 (also with Ctrl)", matching the
existing Ctrl+=/Ctrl+- zoom aliases.

Co-Authored-By: OpenCode <noreply@opencode.ai>
@TravonteD
TravonteD force-pushed the configurable-keybinds branch from 866d08f to 2f4dcf1 Compare August 27, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant