feat(keymaps): configurable map_prefix for the wiki command family (P2)
Mirror vimwiki's g:vimwiki_map_prefix. The whole <Leader>w* family was
hardcoded across the map layer; it is now built from a configurable prefix:
- Neovim: `map_prefix` setup() option (default '<Leader>w'), read by
lua/nuwiki/keymaps.lua (buffer-local) and lua/nuwiki/init.lua (global
entry points).
- Vim: g:nuwiki_map_prefix, applied via :exe in plugin/nuwiki.vim (global)
and ftplugin/vimwiki.vim (buffer-local).
Setting a custom prefix relocates <prefix>{w,t,s,i,n,d,r,c,h,hh,ha} and
<prefix><Leader>{w,y,t,m,i}, leaving nothing under the old <Leader>w*.
Non-prefix maps (<CR>, gl*, headers, …) are untouched.
Tests: new test-keymaps-vim-prefix.vim harness (21 cases, wired into
test-keymaps-vim.sh) + map_prefix.relocates_wiki_family in test-keymaps.lua.
Docs: README, doc/nuwiki.txt, lua config comment, vimwiki-gap.md ticked.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -134,8 +134,18 @@ fix site.
|
||||
`write_page_invokes_custom_wiki2html_converter`,
|
||||
`write_rss_uses_base_url_for_public_links` (`html_export.rs`), config
|
||||
round-trip + defaults (`index_and_config.rs`).
|
||||
- [ ] **`map_prefix`** — `<Leader>w` hardcoded across the map layer.
|
||||
_Fix:_ `plugin/nuwiki.vim`, `lua/nuwiki/keymaps.lua`, `ftplugin/vimwiki.vim`.
|
||||
- [x] **`map_prefix`** — `<Leader>w` was hardcoded across the map layer.
|
||||
_Fix:_ mirror vimwiki's `g:vimwiki_map_prefix` with a configurable prefix
|
||||
(Neovim `map_prefix` setup option, default `'<Leader>w'`; Vim
|
||||
`g:nuwiki_map_prefix`). The whole wiki command family is now built from the
|
||||
prefix — both entry-point globals (`lua/nuwiki/init.lua`,
|
||||
`plugin/nuwiki.vim`, via `:exe`) and buffer-local maps
|
||||
(`lua/nuwiki/keymaps.lua`, `ftplugin/vimwiki.vim`). Setting a custom prefix
|
||||
relocates `<prefix>{w,t,s,i,n,d,r,c,h,hh,ha}` and `<prefix><Leader>{w,y,t,m,
|
||||
i}` and leaves nothing under the old `<Leader>w*`. Tests: new
|
||||
`test-keymaps-vim-prefix.vim` harness (21 cases, driven by
|
||||
`test-keymaps-vim.sh`) + `map_prefix.relocates_wiki_family`
|
||||
(`test-keymaps.lua`). Docs: README, `doc/nuwiki.txt`, lua config comment.
|
||||
- [x] **`<M-CR>` badd-link** — was mouse-only (`<MiddleMouse>`) / command-only
|
||||
(`:VimwikiBaddLink`); upstream binds `<M-CR>` → `VimwikiBaddLink` (confirmed
|
||||
against upstream `ftplugin/vimwiki.vim`). _Fix:_ added normal-mode `<M-CR>` →
|
||||
|
||||
Reference in New Issue
Block a user