Added
- User-configurable global key mappings (
gmap/gnoremap/gunmap) — non-editor key bindings (graph view, canvas, PDF, reading mode, file explorer, empty workspace) can now be customized via.obsidian.vimrc. Previously, all non-editor bindings were hardcoded. The<leader>key is shared with editor mappings. (#43)gmap <leader>f :obcommand switcher:open— bind<leader>fto open the quick switcher in non-editor viewsgnoremap <leader>s :sidebar left— functionally identical togmap(accepted for vim syntax familiarity)gunmap H— remove the defaultH → previous tabbinding (key propagates to Obsidian)- Right-hand side supports
:obcommand <id>for Obsidian commands and:<ex-command> [args]for global ex commands - User bindings override defaults;
gunmapremoves any binding (user or default) - Count prefix support:
5jscrolls 5 lines,3gtgoes to tab 3 (matching existing behavior) - New files:
src/workspace/global-mapping-registry.ts(registry with prefix-matching resolver),src/workspace/global-defaults.ts(default binding table) - Refactored
src/workspace/global-key-handler.tsfrom 770-line hardcoded state machine to 255-line table-driven dispatch viaGlobalMappingRegistry - E2E tests:
test/specs/gmap.e2e.ts(12 tests),test/specs/gmap-vimrc.e2e.ts(9 tests)
- Global which-key overlay — non-editor key sequences now show a which-key popup after 500ms, displaying available completions. Pressing
<C-w>showsh/j/k/l/v/s/c/q/owindow commands. Controlled by the existingwhichKeyModesetting (off/leader/all).- New file:
src/ui/global-which-key.ts—GlobalWhichKeyOverlayclass, shares CSS with editor which-key - Reuses
vim-motions-which-keyCSS classes fromstyles.css(no CSS changes needed) - Popout window support via
Documentparameter tracking - Dismiss on sequence completion, timeout, or focus change to editor
- New file:
- Global which-key labels (
gwhichkeylabel/gwhichkeygroup) — label global bindings for the non-editor which-key overlay, independent from editor which-key labelsgwhichkeylabel <leader>f Open file— shows "Open file" instead of the raw command IDgwhichkeygroup <leader> +leader— groups<leader>*bindings under a named prefix
:gmapex command — lists all active global bindings with source (default/user) in a modal. Available in both editor and non-editor:command contexts.executeGlobalExCommandhelper — exported fromglobal-ex-command.tsfor programmatic ex command dispatch without opening the modal UI
Documentation
docs/configuration/vimrc.md: addedgmap/gnoremap/gunmap/gwhichkeylabel/gwhichkeygroupto supported commands table, added "Global key mappings" section with full syntax and examplesdocs/features/workspace-navigation.md: added "Customizing global bindings" sectiondocs/configuration/which-key.md: updated modes to note non-editor overlay support, added "Global (non-editor) labels" sectiondocs/reference/keybindings.md: added:gmapex command, added customization note to non-editor bindings section
Full Changelog: 0.29.0...0.30.0