feat(vim): close keymap gap with Neovim (47 → 63 maps)
The previous commit registered the parity surface on Neovim but only ported ~75% to plain Vim. Filling the remaining 16: autoload/nuwiki/commands.vim — new functions: - `wiki_ui_select` — Vim has no `vim.ui.select`, so route through `inputlist()` after fetching the wiki list via the LSP. - `open_below_with_bullet` / `open_above_with_bullet` — port of the Lua `o` / `O` continuation that preserves the list marker (and a `[ ]` checkbox when present) on the new line. - `next_header` / `prev_header` / `next_sibling_header` / `prev_sibling_header` / `parent_header` — port of the Lua heading jumper. Pure VimL, no LSP round-trip. ftplugin/vimwiki.vim (Vim path) new mappings: - `<Leader>ws` → `wiki_ui_select` - `]=` / `[=` → next / prev sibling header - `]u` / `[u` → parent header - `o` / `O` → bullet continuation - `gl<Space>` / `gL<Space>` → :VimwikiRemove*CB stubs - `gq1` / `gw1` → :VimwikiTableAlignQ1/W1 stubs - x-mode variants for `+`, `<Leader>wc`, `gln`, `glp`, `glx` Replaced the regex-based `]]` / `[[` (which just searched `^\s*=\+\s`) with calls into the new heading nav so they skip non-heading `=` runs and respect heading levels. Verified end-to-end: `silent map <buffer>` reports 63 maps on Vim, matching Neovim's 63. All 377 Rust tests still pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+18
-2
@@ -113,6 +113,7 @@ if !has('nvim')
|
||||
" Wiki prefix
|
||||
nnoremap <silent><buffer> <Leader>ww :call nuwiki#commands#diary_today()<CR>
|
||||
nnoremap <silent><buffer> <Leader>wt :call nuwiki#commands#diary_today()<CR>
|
||||
nnoremap <silent><buffer> <Leader>ws :call nuwiki#commands#wiki_ui_select()<CR>
|
||||
nnoremap <silent><buffer> <Leader>wi :call nuwiki#commands#diary_index()<CR>
|
||||
nnoremap <silent><buffer> <Leader>w<Leader>w :call nuwiki#commands#diary_today()<CR>
|
||||
nnoremap <silent><buffer> <Leader>w<Leader>y :call nuwiki#commands#diary_yesterday()<CR>
|
||||
@@ -129,10 +130,12 @@ if !has('nvim')
|
||||
nnoremap <silent><buffer> <Tab> /\[\[<CR>:nohlsearch<CR>
|
||||
nnoremap <silent><buffer> <S-Tab> ?\[\[<CR>:nohlsearch<CR>
|
||||
nnoremap <silent><buffer> + :echohl WarningMsg<bar>echom 'nuwiki: :VimwikiNormalizeLink not yet implemented — see SPEC §13.1'<bar>echohl None<CR>
|
||||
xnoremap <silent><buffer> + :<C-u>echohl WarningMsg<bar>echom 'nuwiki: :VimwikiNormalizeLink not yet implemented — see SPEC §13.1'<bar>echohl None<CR>
|
||||
nnoremap <silent><buffer> <Leader>wn :call nuwiki#commands#wiki_goto_page('')<CR>
|
||||
nnoremap <silent><buffer> <Leader>wd :call nuwiki#commands#delete_file()<CR>
|
||||
nnoremap <silent><buffer> <Leader>wr :call nuwiki#commands#rename_file()<CR>
|
||||
nnoremap <silent><buffer> <Leader>wc :echohl WarningMsg<bar>echom 'nuwiki: :VimwikiColorize not yet implemented — see SPEC §13.1'<bar>echohl None<CR>
|
||||
xnoremap <silent><buffer> <Leader>wc :<C-u>echohl WarningMsg<bar>echom 'nuwiki: :VimwikiColorize not yet implemented — see SPEC §13.1'<bar>echohl None<CR>
|
||||
|
||||
" Diary nav
|
||||
nnoremap <silent><buffer> <C-Down> :call nuwiki#commands#diary_next()<CR>
|
||||
@@ -145,20 +148,31 @@ if !has('nvim')
|
||||
xnoremap <silent><buffer> <C-@> :<C-u>call nuwiki#commands#toggle_list_item()<CR>
|
||||
nnoremap <silent><buffer> gnt :call nuwiki#commands#next_task()<CR>
|
||||
nnoremap <silent><buffer> gln :call nuwiki#commands#cycle_list_item()<CR>
|
||||
xnoremap <silent><buffer> gln :<C-u>call nuwiki#commands#cycle_list_item()<CR>
|
||||
nnoremap <silent><buffer> glp :call nuwiki#commands#cycle_list_item()<CR>
|
||||
xnoremap <silent><buffer> glp :<C-u>call nuwiki#commands#cycle_list_item()<CR>
|
||||
nnoremap <silent><buffer> glx :call nuwiki#commands#reject_list_item()<CR>
|
||||
xnoremap <silent><buffer> glx :<C-u>call nuwiki#commands#reject_list_item()<CR>
|
||||
nnoremap <silent><buffer> glh :echohl WarningMsg<bar>echom 'nuwiki: list level not yet implemented — see SPEC §13.1'<bar>echohl None<CR>
|
||||
nnoremap <silent><buffer> gll :echohl WarningMsg<bar>echom 'nuwiki: list level not yet implemented — see SPEC §13.1'<bar>echohl None<CR>
|
||||
nnoremap <silent><buffer> gLh :echohl WarningMsg<bar>echom 'nuwiki: list level subtree not yet implemented — see SPEC §13.1'<bar>echohl None<CR>
|
||||
nnoremap <silent><buffer> gLl :echohl WarningMsg<bar>echom 'nuwiki: list level subtree not yet implemented — see SPEC §13.1'<bar>echohl None<CR>
|
||||
nnoremap <silent><buffer> glr :echohl WarningMsg<bar>echom 'nuwiki: list renumber not yet implemented — see SPEC §13.1'<bar>echohl None<CR>
|
||||
nnoremap <silent><buffer> gLr :echohl WarningMsg<bar>echom 'nuwiki: list renumber-all not yet implemented — see SPEC §13.1'<bar>echohl None<CR>
|
||||
nnoremap <silent><buffer> gl<Space> :echohl WarningMsg<bar>echom 'nuwiki: :VimwikiRemoveSingleCB not yet implemented — see SPEC §13.1'<bar>echohl None<CR>
|
||||
nnoremap <silent><buffer> gL<Space> :echohl WarningMsg<bar>echom 'nuwiki: :VimwikiRemoveCBInList not yet implemented — see SPEC §13.1'<bar>echohl None<CR>
|
||||
nnoremap <silent><buffer> o :call nuwiki#commands#open_below_with_bullet()<CR>
|
||||
nnoremap <silent><buffer> O :call nuwiki#commands#open_above_with_bullet()<CR>
|
||||
|
||||
" Headers
|
||||
nnoremap <silent><buffer> = :call nuwiki#commands#heading_add()<CR>
|
||||
nnoremap <silent><buffer> - :call nuwiki#commands#heading_remove()<CR>
|
||||
nnoremap <silent><buffer> ]] /^\s*=\+\s<CR>:nohlsearch<CR>
|
||||
nnoremap <silent><buffer> [[ ?^\s*=\+\s<CR>:nohlsearch<CR>
|
||||
nnoremap <silent><buffer> ]] :call nuwiki#commands#next_header()<CR>
|
||||
nnoremap <silent><buffer> [[ :call nuwiki#commands#prev_header()<CR>
|
||||
nnoremap <silent><buffer> ]= :call nuwiki#commands#next_sibling_header()<CR>
|
||||
nnoremap <silent><buffer> [= :call nuwiki#commands#prev_sibling_header()<CR>
|
||||
nnoremap <silent><buffer> ]u :call nuwiki#commands#parent_header()<CR>
|
||||
nnoremap <silent><buffer> [u :call nuwiki#commands#parent_header()<CR>
|
||||
|
||||
" HTML export
|
||||
nnoremap <silent><buffer> <Leader>wh :call nuwiki#commands#export_current()<CR>
|
||||
@@ -167,7 +181,9 @@ if !has('nvim')
|
||||
|
||||
" Tables (deferred §13.1)
|
||||
nnoremap <silent><buffer> gqq :echohl WarningMsg<bar>echom 'nuwiki: :VimwikiTableAlignQ not yet implemented — see SPEC §13.1'<bar>echohl None<CR>
|
||||
nnoremap <silent><buffer> gq1 :echohl WarningMsg<bar>echom 'nuwiki: :VimwikiTableAlignQ1 not yet implemented — see SPEC §13.1'<bar>echohl None<CR>
|
||||
nnoremap <silent><buffer> gww :echohl WarningMsg<bar>echom 'nuwiki: :VimwikiTableAlignW not yet implemented — see SPEC §13.1'<bar>echohl None<CR>
|
||||
nnoremap <silent><buffer> gw1 :echohl WarningMsg<bar>echom 'nuwiki: :VimwikiTableAlignW1 not yet implemented — see SPEC §13.1'<bar>echohl None<CR>
|
||||
nnoremap <silent><buffer> <A-Left> :echohl WarningMsg<bar>echom 'nuwiki: :VimwikiTableMoveColumnLeft not yet implemented'<bar>echohl None<CR>
|
||||
nnoremap <silent><buffer> <A-Right> :echohl WarningMsg<bar>echom 'nuwiki: :VimwikiTableMoveColumnRight not yet implemented'<bar>echohl None<CR>
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user