fix(client): small mapping/command-attribute parity gaps
CI / cargo fmt --check (push) Successful in 37s
CI / cargo clippy (push) Successful in 24s
CI / cargo test (push) Successful in 33s
CI / editor keymaps (push) Successful in 1m44s

Clean, fully-wired parity fixes (skipping the accept-but-ignore ones):

- <D-CR> (macOS Cmd+Return) → follow_link_drop, alongside <C-S-CR>, in both
  clients. Upstream binds both to VimwikiTabDropLink.
- plugin/nuwiki.vim global map block: fix the same diary collision the
  buffer-local maps had — <Leader>w<Leader>t now opens today in a new tab and
  <Leader>w<Leader>m (tomorrow) is added.
- Neovim TabIndex: add -count to NuwikiTabIndex and switch both
  Vimwiki/NuwikiTabIndex from vim.v.count (always 0 in command context) to
  <count>, so a count is actually honored.
- Converge VimwikiTableMoveColumn{Left,Right}: the Vim-branch commands now call
  the table_move_column_left/right aliases, matching the Neovim branch.
- VimwikiColorize/NuwikiColorize: -nargs=1 → -nargs=* (all four defs) for
  upstream parity; a bare :VimwikiColorize now prompts for the colour.

Docs (README + doc/nuwiki.txt) updated; mapping surfaces gain <D-CR> and
<Leader>w<Leader>m in both harnesses. vim 265+18, nvim 272, all green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-31 17:28:06 +00:00
parent b8586537f8
commit 212b300fb4
8 changed files with 43 additions and 34 deletions
+1 -1
View File
@@ -483,7 +483,7 @@ via `mappings.<group> = false` in Neovim, or
| `<CR>` | Smart follow — inside `[[…]]` jumps; on a bare word wraps as `[[word]]` (second `<CR>` follows) |
| `<S-CR>` | Follow in horizontal split |
| `<C-CR>` | Follow in vertical split |
| `<C-S-CR>` | Follow in a tab, reusing an existing tab if the file is already open |
| `<C-S-CR>` / `<D-CR>` | Follow in a tab, reusing an existing tab if the file is already open (`<D-CR>` is the macOS Cmd alias) |
| `<M-CR>` | Add the link target to the buffer list (`:badd`, no jump) |
| `<BS>` | Jump back (`<C-o>`) |
| `<Tab>` / `<S-Tab>` | Next / previous wikilink on or after the cursor |
+3 -2
View File
@@ -184,7 +184,7 @@ endfunction
let s:mapping_surface = [
\ ['<CR>', 'n'], ['<S-CR>', 'n'], ['<C-CR>', 'n'], ['<C-S-CR>', 'n'],
\ ['<M-CR>', 'n'],
\ ['<M-CR>', 'n'], ['<D-CR>', 'n'],
\ ['<BS>', 'n'], ['<Tab>', 'n'], ['<S-Tab>', 'n'], ['+', 'nx'],
\ ['<C-Space>', 'nx'], ['<C-@>', 'nx'], ['<Nul>', 'nx'],
\ ['gnt', 'n'], ['gln', 'nx'], ['glp', 'nx'], ['glx', 'nx'],
@@ -201,7 +201,8 @@ let s:mapping_surface = [
\ ['<A-Left>', 'n'], ['<A-Right>', 'n'],
\ ['<Leader>ww', 'n'], ['<Leader>ws', 'n'], ['<Leader>wi', 'n'],
\ ['<Leader>w<Leader>w', 'n'], ['<Leader>w<Leader>y', 'n'],
\ ['<Leader>w<Leader>t', 'n'], ['<Leader>w<Leader>i', 'n'],
\ ['<Leader>w<Leader>t', 'n'], ['<Leader>w<Leader>m', 'n'],
\ ['<Leader>w<Leader>i', 'n'],
\ ['<Leader>wn', 'n'], ['<Leader>wd', 'n'], ['<Leader>wr', 'n'],
\ ['<Leader>wh', 'n'], ['<Leader>whh', 'n'], ['<Leader>wha', 'n'],
\ ['<Leader>wc', 'nx'], ['<C-Down>', 'n'], ['<C-Up>', 'n'],
+3 -2
View File
@@ -206,7 +206,7 @@ vim.defer_fn(function()
local mapping_surface = {
-- Links
{ '<CR>', 'n' }, { '<S-CR>', 'n' }, { '<C-CR>', 'n' }, { '<C-S-CR>', 'n' },
{ '<M-CR>', 'n' },
{ '<M-CR>', 'n' }, { '<D-CR>', 'n' },
{ '<BS>', 'n' }, { '<Tab>', 'n' }, { '<S-Tab>', 'n' }, { '+', 'nx' },
-- Lists
{ '<C-Space>', 'nx' }, { '<C-@>', 'nx' }, { '<Nul>', 'nx' },
@@ -227,7 +227,8 @@ vim.defer_fn(function()
-- Wiki / diary / export
{ '<Leader>ww', 'n' }, { '<Leader>ws', 'n' }, { '<Leader>wi', 'n' },
{ '<Leader>w<Leader>w', 'n' }, { '<Leader>w<Leader>y', 'n' },
{ '<Leader>w<Leader>t', 'n' }, { '<Leader>w<Leader>i', 'n' },
{ '<Leader>w<Leader>t', 'n' }, { '<Leader>w<Leader>m', 'n' },
{ '<Leader>w<Leader>i', 'n' },
{ '<Leader>wn', 'n' }, { '<Leader>wd', 'n' }, { '<Leader>wr', 'n' },
{ '<Leader>wh', 'n' }, { '<Leader>whh', 'n' }, { '<Leader>wha', 'n' },
{ '<Leader>wc', 'nx' }, { '<C-Down>', 'n' }, { '<C-Up>', 'n' },
+20 -17
View File
@@ -167,13 +167,14 @@ fix site.
Neovim. Works in Vim, coc, and Neovim (pure syntax + `:highlight`, no LSP
needed). Covered by `colorize.conceal_hides_tags_shows_text` (both harnesses)
and `colorize.command_conceals_immediately` (`test-keymaps-vim.vim`).
- [ ] **`VimwikiTableMoveColumn{Left,Right}` dispatch to different backing names
per client** — Vim branch → `table_move_left/right`; Neovim branch
`table_move_column_left/right`. Harmless today (each name exists in its own
impl) but a divergence to converge.
- [ ] **`NuwikiTabIndex` lacks `-count` in the Neovim branch** (`:452`) while its
siblings (`VimwikiTabIndex`, `NuwikiIndex`, and the Vim-branch `NuwikiTabIndex`)
all carry it — `vim.v.count` is still read, so a count is honored inconsistently.
- [x] **`VimwikiTableMoveColumn{Left,Right}` dispatch to different backing names
per client** — converged: the Vim-branch commands now call
`nuwiki#commands#table_move_column_left/right` (existing aliases over the
`table_move_left/right` impls), matching the Neovim branch.
- [x] **`NuwikiTabIndex` lacks `-count` in the Neovim branch** — added `-count`;
also switched both Neovim `Vimwiki/NuwikiTabIndex` from `vim.v.count` (always 0
in command context) to `<count>`, so a `:NNuwikiTabIndex` count is now actually
honored.
- [ ] **`VimwikiToggleListItem` / `Increment` / `DecrementListItem` lack
`-range`** (both branches) vs upstream's `-range` (`:350`) — no visual-range
checkbox toggle / symbol cycle.
@@ -189,8 +190,10 @@ fix site.
page / tag / colour names at the `:` line is unavailable. _Fix:_
`ftplugin/vimwiki.vim` (both branches) — VimL completers or LSP-backed.
- [ ] **Minor command-attribute gaps** _(new)_`VimwikiNormalizeLink` lacks
upstream's `-nargs=?`; `VimwikiCheckLinks` lacks `-range`; `VimwikiColorize` is
`-nargs=1` vs upstream `-nargs=*`. Cosmetic.
upstream's `-nargs=?`; `VimwikiCheckLinks` lacks `-range`. (`VimwikiColorize`
`-nargs=1``-nargs=*` **done** — all four defs now match upstream, so a bare
`:VimwikiColorize` prompts for the colour.) The remaining two would be
accepted-but-ignored without handler work, so left open.
### Config
- [ ] `auto_header` — auto H1-from-filename on new page (server-side).
@@ -215,14 +218,14 @@ fix site.
all lists; upstream `ftplugin/vimwiki.vim:553,555,561`). nuwiki has the
lowercase forms but not the uppercase-suffix aliases. Cosmetic — same effect,
redundant keys.
- [ ] **`<D-CR>` (Cmd+Return) tab-drop alias** _(new, 2026-05-31 re-audit)_
upstream binds both `<C-S-CR>` and the macOS `<D-CR>` to `VimwikiTabDropLink`;
nuwiki binds only `<C-S-CR>` (both clients). Niche (macOS GUI). _Fix:_
`lua/nuwiki/keymaps.lua`, `ftplugin/vimwiki.vim` alongside `<C-S-CR>`.
- [ ] **`<Leader>w<Leader>m` missing from the Vim *global* map block** _(new)_
present buffer-locally in both clients, but `plugin/nuwiki.vim`'s global
`<Leader>w<Leader>*` family (usable from non-wiki buffers) binds `w`/`y`/`t`/`i`
but not `m` (tomorrow), which upstream binds globally. _Fix:_ `plugin/nuwiki.vim`.
- [x] **`<D-CR>` (Cmd+Return) tab-drop alias** _(new, 2026-05-31 re-audit)_
added `<D-CR>` `follow_link_drop` alongside `<C-S-CR>` in both clients
(`lua/nuwiki/keymaps.lua`, `ftplugin/vimwiki.vim`); docs updated. Covered by
`map[n].<D-CR>` in both harnesses.
- [x] **`<Leader>w<Leader>m` missing from the Vim *global* map block** _(new)_
`plugin/nuwiki.vim`'s global family now binds `<Leader>w<Leader>m` (tomorrow)
and `<Leader>w<Leader>t` opens today in a new tab (was the same collision the
buffer-local maps had). Covered by `map[n].<Leader>w<Leader>m` in both harnesses.
---
+1 -1
View File
@@ -436,7 +436,7 @@ Links (normal mode) ~
<S-CR> Follow in a horizontal split.
<C-CR> Follow in a vertical split.
<C-S-CR> Follow in a tab, reusing an existing tab if the file is
already open.
already open. `<D-CR>` (macOS Cmd) is an alias.
<M-CR> Add the link target to the buffer list (`:badd`, no jump).
<BS> Jump back (`<C-o>`).
<Tab> Next wikilink on or after the cursor.
+11 -10
View File
@@ -111,9 +111,9 @@ if !has('nvim')
" Tables, colorize, and clipboard paste.
command! -buffer -nargs=1 VimwikiTable call nuwiki#commands#table_insert()
command! -buffer VimwikiTableMoveColumnLeft call nuwiki#commands#table_move_left()
command! -buffer VimwikiTableMoveColumnRight call nuwiki#commands#table_move_right()
command! -buffer -nargs=1 -range VimwikiColorize call nuwiki#commands#colorize(<q-args>, <range>)
command! -buffer VimwikiTableMoveColumnLeft call nuwiki#commands#table_move_column_left()
command! -buffer VimwikiTableMoveColumnRight call nuwiki#commands#table_move_column_right()
command! -buffer -nargs=* -range VimwikiColorize call nuwiki#commands#colorize(<q-args>, <range>)
command! -buffer VimwikiPasteLink call nuwiki#commands#paste_link()
command! -buffer VimwikiPasteUrl call nuwiki#commands#paste_url()
command! -buffer VimwikiCatUrl call nuwiki#commands#cat_url()
@@ -182,9 +182,9 @@ if !has('nvim')
command! -buffer NuwikiRenumberAllLists call nuwiki#commands#list_renumber_all()
command! -buffer NuwikiTableAlign call nuwiki#commands#table_align()
command! -buffer -nargs=1 NuwikiTable call nuwiki#commands#table_insert()
command! -buffer NuwikiTableMoveColumnLeft call nuwiki#commands#table_move_left()
command! -buffer NuwikiTableMoveColumnRight call nuwiki#commands#table_move_right()
command! -buffer -nargs=1 -range NuwikiColorize call nuwiki#commands#colorize(<q-args>, <range>)
command! -buffer NuwikiTableMoveColumnLeft call nuwiki#commands#table_move_column_left()
command! -buffer NuwikiTableMoveColumnRight call nuwiki#commands#table_move_column_right()
command! -buffer -nargs=* -range NuwikiColorize call nuwiki#commands#colorize(<q-args>, <range>)
command! -buffer NuwikiPasteLink call nuwiki#commands#paste_link()
command! -buffer NuwikiPasteUrl call nuwiki#commands#paste_url()
command! -buffer NuwikiCatUrl call nuwiki#commands#cat_url()
@@ -217,6 +217,7 @@ if !has('nvim')
nnoremap <silent><buffer> <S-CR> :split<CR>:call nuwiki#commands#follow_link_or_create()<CR>
nnoremap <silent><buffer> <C-CR> :vsplit<CR>:call nuwiki#commands#follow_link_or_create()<CR>
nnoremap <silent><buffer> <C-S-CR> :call nuwiki#commands#follow_link_drop()<CR>
nnoremap <silent><buffer> <D-CR> :call nuwiki#commands#follow_link_drop()<CR>
nnoremap <silent><buffer> <M-CR> :call nuwiki#commands#badd_link()<CR>
nnoremap <silent><buffer> <BS> <C-o>
nnoremap <silent><buffer> <Tab> /\[\[<CR>:nohlsearch<CR>
@@ -384,7 +385,7 @@ endif
" or, for client-side operations, calls `vim.lsp.buf.*` directly.
command! -buffer -count VimwikiIndex lua require('nuwiki.commands').wiki_index(vim.v.count)
command! -buffer -count VimwikiTabIndex lua require('nuwiki.commands').wiki_tab_index(vim.v.count)
command! -buffer -count VimwikiTabIndex lua require('nuwiki.commands').wiki_tab_index(<count>)
command! -buffer VimwikiUISelect lua require('nuwiki.commands').wiki_ui_select()
command! -buffer VimwikiDiaryIndex lua require('nuwiki.commands').diary_index()
command! -buffer VimwikiMakeDiaryNote lua require('nuwiki.commands').diary_today()
@@ -453,14 +454,14 @@ command! -buffer -nargs=? VimwikiGenerateTags lua require('nuwiki.commands'
command! -buffer -nargs=1 VimwikiTable lua require('nuwiki.commands').table_insert()
command! -buffer VimwikiTableMoveColumnLeft lua require('nuwiki.commands').table_move_column_left()
command! -buffer VimwikiTableMoveColumnRight lua require('nuwiki.commands').table_move_column_right()
command! -buffer -nargs=1 -range VimwikiColorize lua require('nuwiki.commands').colorize(<q-args>, <range> > 0)
command! -buffer -nargs=* -range VimwikiColorize lua require('nuwiki.commands').colorize(<q-args>, <range> > 0)
command! -buffer VimwikiPasteLink lua require('nuwiki.commands').paste_link()
command! -buffer VimwikiPasteUrl lua require('nuwiki.commands').paste_url()
command! -buffer VimwikiCatUrl lua require('nuwiki.commands').cat_url()
" Canonical :Nuwiki* aliases — P10.
command! -buffer -count NuwikiIndex lua require('nuwiki.commands').wiki_index(vim.v.count)
command! -buffer NuwikiTabIndex lua require('nuwiki.commands').wiki_tab_index(vim.v.count)
command! -buffer -count NuwikiTabIndex lua require('nuwiki.commands').wiki_tab_index(<count>)
command! -buffer NuwikiUISelect lua require('nuwiki.commands').wiki_ui_select()
command! -buffer NuwikiDiaryIndex lua require('nuwiki.commands').diary_index()
command! -buffer NuwikiDiaryToday lua require('nuwiki.commands').diary_today()
@@ -525,7 +526,7 @@ command! -buffer NuwikiTableAlign lua require('nuwiki.command
command! -buffer -nargs=1 NuwikiTable lua require('nuwiki.commands').table_insert()
command! -buffer NuwikiTableMoveColumnLeft lua require('nuwiki.commands').table_move_column_left()
command! -buffer NuwikiTableMoveColumnRight lua require('nuwiki.commands').table_move_column_right()
command! -buffer -nargs=1 -range NuwikiColorize lua require('nuwiki.commands').colorize(<q-args>, <range> > 0)
command! -buffer -nargs=* -range NuwikiColorize lua require('nuwiki.commands').colorize(<q-args>, <range> > 0)
command! -buffer NuwikiPasteLink lua require('nuwiki.commands').paste_link()
command! -buffer NuwikiPasteUrl lua require('nuwiki.commands').paste_url()
command! -buffer NuwikiCatUrl lua require('nuwiki.commands').cat_url()
+2
View File
@@ -166,6 +166,8 @@ function M.attach(bufnr, mappings)
{ desc = 'nuwiki: follow link in vsplit' }, bufnr)
map('n', '<C-S-CR>', cmd.follow_link_drop,
{ desc = 'nuwiki: follow link in tab (reuse existing)' }, bufnr)
map('n', '<D-CR>', cmd.follow_link_drop,
{ desc = 'nuwiki: follow link in tab (macOS Cmd alias of <C-S-CR>)' }, bufnr)
map('n', '<M-CR>', cmd.badd_link,
{ desc = 'nuwiki: add link target to buffer list' }, bufnr)
map('n', '<BS>', '<C-o>', { desc = 'nuwiki: go back', remap = true }, bufnr)
+2 -1
View File
@@ -57,6 +57,7 @@ if !get(g:, 'nuwiki_no_default_mappings', 0)
nnoremap <silent> <Leader>wi :call nuwiki#commands#open_diary_index_path()<CR>
nnoremap <silent> <Leader>w<Leader>w :call nuwiki#commands#open_diary_path(0)<CR>
nnoremap <silent> <Leader>w<Leader>y :call nuwiki#commands#open_diary_path(-1)<CR>
nnoremap <silent> <Leader>w<Leader>t :call nuwiki#commands#open_diary_path(1)<CR>
nnoremap <silent> <Leader>w<Leader>t :tabnew<CR>:call nuwiki#commands#open_diary_path(0)<CR>
nnoremap <silent> <Leader>w<Leader>m :call nuwiki#commands#open_diary_path(1)<CR>
nnoremap <silent> <Leader>w<Leader>i :call nuwiki#commands#diary_generate_index()<CR>
endif