feat(client): add gl/gL one-key list change-symbol mappings

Upstream's one-key marker-change keys had no nuwiki binding — the
functionality was reachable only via :NuwikiChangeSymbol. Add normal-mode
gl{-,*,#,1,i,I,a,A} (current item) and gL{...} (whole list) to both
clients, wired to the existing list_change_symbol command. NumericParen
1) stays command-only, matching upstream's default number_types shadowing.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-31 08:10:05 -03:00
parent 214707e327
commit 061785c6a0
2 changed files with 30 additions and 0 deletions
+18
View File
@@ -246,6 +246,24 @@ if !has('nvim')
nnoremap <silent><buffer> gLl :call nuwiki#commands#list_change_level(1, 1)<CR>
nnoremap <silent><buffer> glr :call nuwiki#commands#list_renumber()<CR>
nnoremap <silent><buffer> gLr :call nuwiki#commands#list_renumber_all()<CR>
" gl<sym>/gL<sym>: set the current item's / whole list's marker (upstream
" VimwikiChangeSymbolTo / ChangeSymbolInListTo). 1) is command-only.
nnoremap <silent><buffer> gl- :call nuwiki#commands#list_change_symbol('-', 0)<CR>
nnoremap <silent><buffer> gL- :call nuwiki#commands#list_change_symbol('-', 1)<CR>
nnoremap <silent><buffer> gl* :call nuwiki#commands#list_change_symbol('*', 0)<CR>
nnoremap <silent><buffer> gL* :call nuwiki#commands#list_change_symbol('*', 1)<CR>
nnoremap <silent><buffer> gl# :call nuwiki#commands#list_change_symbol('#', 0)<CR>
nnoremap <silent><buffer> gL# :call nuwiki#commands#list_change_symbol('#', 1)<CR>
nnoremap <silent><buffer> gl1 :call nuwiki#commands#list_change_symbol('1.', 0)<CR>
nnoremap <silent><buffer> gL1 :call nuwiki#commands#list_change_symbol('1.', 1)<CR>
nnoremap <silent><buffer> gli :call nuwiki#commands#list_change_symbol('i)', 0)<CR>
nnoremap <silent><buffer> gLi :call nuwiki#commands#list_change_symbol('i)', 1)<CR>
nnoremap <silent><buffer> glI :call nuwiki#commands#list_change_symbol('I)', 0)<CR>
nnoremap <silent><buffer> gLI :call nuwiki#commands#list_change_symbol('I)', 1)<CR>
nnoremap <silent><buffer> gla :call nuwiki#commands#list_change_symbol('a)', 0)<CR>
nnoremap <silent><buffer> gLa :call nuwiki#commands#list_change_symbol('a)', 1)<CR>
nnoremap <silent><buffer> glA :call nuwiki#commands#list_change_symbol('A)', 0)<CR>
nnoremap <silent><buffer> gLA :call nuwiki#commands#list_change_symbol('A)', 1)<CR>
nnoremap <silent><buffer> gl<Space> :call nuwiki#commands#list_remove_done()<CR>
nnoremap <silent><buffer> gL<Space> :call nuwiki#commands#list_remove_done_all()<CR>
nnoremap <silent><buffer> o :call nuwiki#commands#open_below_with_bullet()<CR>
+12
View File
@@ -219,6 +219,18 @@ function M.attach(bufnr, mappings)
{ desc = 'nuwiki: renumber list' }, bufnr)
map('n', 'gLr', cmd.list_renumber_all,
{ desc = 'nuwiki: renumber all lists' }, bufnr)
-- gl<sym>/gL<sym>: set the current item's / whole list's marker (upstream
-- VimwikiChangeSymbolTo / ChangeSymbolInListTo). 1) is command-only.
for _, pair in ipairs({
{ '-', '-' }, { '*', '*' }, { '#', '#' }, { '1', '1.' },
{ 'i', 'i)' }, { 'I', 'I)' }, { 'a', 'a)' }, { 'A', 'A)' },
}) do
local key, sym = pair[1], pair[2]
map('n', 'gl' .. key, function() cmd.list_change_symbol(sym, false) end,
{ desc = 'nuwiki: set item marker to ' .. sym }, bufnr)
map('n', 'gL' .. key, function() cmd.list_change_symbol(sym, true) end,
{ desc = 'nuwiki: set list markers to ' .. sym }, bufnr)
end
map('n', 'gl<Space>', cmd.list_remove_done,
{ desc = 'nuwiki: remove done items (current list)' }, bufnr)
map('n', 'gL<Space>', cmd.list_remove_done_all,