Skip to content

Add vim motion navigation to searchable menus - #14899

Open
Perry-Olsson wants to merge 1 commit into
omacom:quattrofrom
Perry-Olsson:omarchy-menu-vim-motions
Open

Perry-Olsson wants to merge 1 commit into
omacom:quattrofrom
Perry-Olsson:omarchy-menu-vim-motions

Conversation

@Perry-Olsson

Copy link
Copy Markdown

feat: add vim motion navigation to searchable menus

Summary

The text-searchable emoji, clipboard, and main menus now support vim-style navigation with Ctrl+h/j/k/l, so you can move the cursor without leaving the home row while typing a filter. To make this possible, PanelKeyCatcher was extended into a shared key-dispatch component, and the three searchable menus were refactored to use it instead of their own ad-hoc Keys.onPressed handlers.

Screen Capture

screenrecording-2026-10-10_10-17-57.mp4

Changes

PanelKeyCatcher (shell/Ui/PanelKeyCatcher.qml)

  • New searchable property: on searchable panels, plain h/j/k/l types into the filter and Ctrl+h/j/k/l moves the cursor; on non-searchable panels the plain letters still move, as before.
  • New handleCustomKeys signal, emitted first so a panel can swallow a key before the built-in dispatch runs.
  • New pageUp/pageDown signals and a goBack signal for Backspace.
  • returnRequested and deleteRequested now carry the KeyEvent, so panels can tell Shift+Delete from Delete (e.g. clipboard clear-history vs. remove entry).
  • Text keys are now restricted to printable characters with only Shift/Keypad modifiers, so Alt+letter shortcuts no longer leak through as typed text.

Searchable menus refactored onto PanelKeyCatcher

  • Clipboard (shell/plugins/clipboard/Clipboard.qml): filter editing, Home/End, PageUp/PageDown, Delete vs. Shift+Delete, and the Return-modifier variants (Alt opens, Shift copies) all moved into the catcher's signals.
  • Emojis (shell/plugins/emojis/Emojis.qml): grid movement, page jumps, and filter editing now go through the catcher.
  • Main menu (shell/plugins/menu/Menu.qml): movement, paging, delete, and filter editing now go through the catcher.

Testing

Extensive testing, review, and iteration was done with the help of Opus 5.5 to ensure all of the previous behavior of the various panels already using PanelKeyCatcher was maintained through the refactor.

Tests added

  • New tst_vim_motions.qml: plain h/j/k/l move only when not searchable, Ctrl+letter moves on searchable panels, plain letters type there, and handleCustomKeys runs first.
  • New tst_delete.qml: Delete and x/X fire delete requests, the key event rides along with modifiers, and x types into the filter on searchable panels.
  • Updated tst_modifiers.qml: Alt+letter no longer emits a text key; Shift+letter still does.
  • Shell tests assert the clipboard's Shift+Delete handling, confirm-dialog key routing, and page-key behavior in the clipboard, emoji, and menu plugins.

The text searchable emoji, clipboard, and main menus now support
navigation with vim motion using the control modifier.

Extended the PanelKeyCatcher to support this and refactored the menu's
mentioned to use this.
@greptile-apps

greptile-apps Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium impact] Refactors keyboard navigation in menu and search panels.

The PR appears safe to merge, with non-blocking fixes recommended for AltGr input and Caps Lock shortcuts.

Findings

  1. P2 AltGr characters are dropped ▶
  2. P2 Caps Lock changes shortcuts ▶

Summary

Adds Ctrl+h/j/k/l navigation to the clipboard, emoji picker and main menu through PanelKeyCatcher.

  • Searchable panels type plain letters and move with Ctrl+h/j/k/l.
  • Clipboard search now supports Ctrl+h/j/k/l movement.
  • Emoji search now supports Ctrl+h/j/k/l movement.
  • Main menu search now supports Ctrl+h/j/k/l movement.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Key pressed] --> B{Catcher blocked?}
  B -->|Yes| C[Leave key to editor]
  B -->|No| D[Panel handles custom keys]
  D --> E{Key accepted?}
  E -->|Yes| F[Stop]
  E -->|No| G[Shared key dispatch]
  G --> H[Move, page, return, delete or close]
  G --> I{Printable text with allowed modifiers?}
  I -->|Yes| J[Emit textKey]
Loading

Reviews (1) · Last reviewed commit: "feat: add vim motion navigation to searc..." · Reviewed by Greptile

Comment on lines +118 to +123
const allowedModifiers = Qt.ShiftModifier | Qt.KeypadModifier
return event.text
&& event.text.length === 1
&& event.text.charCodeAt(0) >= 32
&& event.text.charCodeAt(0) !== 127
&& (event.modifiers & ~allowedModifiers) === 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 AltGr characters are dropped

If Qt includes GroupSwitchModifier for AltGr input, isTextKey() rejects printable characters such as @, [ and €. These no longer reach the clipboard and emoji filters. The clock's bracket shortcuts also stop working on affected layouts. Previously, these paths accepted printable text regardless of modifiers.

Allow printable AltGr input while still excluding Alt, Ctrl and Meta shortcuts.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the docs this is only a valid modifier on X11 or windows

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You’re right that GroupSwitchModifier is only available on X11 (and optionally Windows), so my original comment was too broad for Wayland.

The underlying concern is still platform-dependent: on X11, Qt may report AltGr using GroupSwitchModifier; on Wayland, it may instead appear as Ctrl+Alt. If Omarchy targets Wayland exclusively and Qt preserves AltGr’s printable event.text there, this specific GroupSwitchModifier change isn’t needed. The behavior should be verified on the supported compositor before changing the filter.

Tip: You can customize Greptile's behavior for this repo with .greptile/rules.md and .greptile/config.json.

Comment on lines +131 to +140
function isVimMotion(event, key) {
if (event.key != key) {
return false
}

const modifier = searchable
? Qt.CTRL
: Qt.NoModifier

return event.modifiers === modifier

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Caps Lock changes shortcuts

isVimMotion() now checks event.key instead of lowercase event.text. With Caps Lock on, an unshifted L still has Qt.Key_L and no Shift modifier, but its text is uppercase L. Non-searchable panels now take that key as movement instead of passing it to textKey.

This replaces the Dropbox login shortcut with cursor movement. Uppercase J likewise moves instead of jumping on the globe. Keep lowercase-only movement on non-searchable panels, or preserve these uppercase shortcuts before dispatch.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, with no caps lock key configured I didn't test this. However, I'd actually consider this behavior change an improvement.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. Given the intended home-row navigation, treating Caps Lock’s Qt.Key_J/K/L/H the same as the corresponding motion keys is a reasonable improvement, and the loss of those uppercase shortcuts is acceptable in this context. I’ll consider this finding resolved.

@jandrusk

Copy link
Copy Markdown

Vim motions in searchable menus look polished and tested. Overlaps #14919 on Clipboard.qml — rebase after that (or vice versa). Ready for review once the conflict plan is clear.

@Perry-Olsson

Copy link
Copy Markdown
Author

Vim motions in searchable menus look polished and tested. Overlaps #14919 on Clipboard.qml — rebase after that (or vice versa). Ready for review once the conflict plan is clear.

Hey thanks @jandrusk. I pulled #14919 and confirmed the changes can be cleanly merged with these

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.

2 participants