feat(client): bind bare gl/gL to remove-checkbox for vimwiki parity

Upstream vimwiki binds bare gl/gL to remove-checkbox (item / whole list);
nuwiki had rebound the conceptual keys to gl<Space>/gL<Space> as remove-done,
a same-keys-different-effect parity trap. Bind bare gl/gL to remove-checkbox
instead — they share the gl… prefix so they fire after 'timeoutlen', exactly
as upstream. Remove-done becomes command-only; add -bang to *RemoveDone so
:NuwikiRemoveDone! reaches the whole-buffer sweep that gL<Space> previously
held (its only entry point).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-31 08:41:22 -03:00
parent a53ba167d6
commit a15ae184a0
2 changed files with 18 additions and 10 deletions
+10 -6
View File
@@ -74,7 +74,7 @@ if !has('nvim')
command! -buffer -nargs=1 VimwikiChangeSymbolTo call nuwiki#commands#list_change_symbol(<q-args>, 0)
command! -buffer -nargs=1 VimwikiListChangeSymbolI call nuwiki#commands#list_change_symbol(<q-args>, 0)
command! -buffer -nargs=1 VimwikiChangeSymbolInListTo call nuwiki#commands#list_change_symbol(<q-args>, 1)
command! -buffer VimwikiRemoveDone call nuwiki#commands#list_remove_done()
command! -buffer -bang VimwikiRemoveDone if <bang>0 | call nuwiki#commands#list_remove_done_all() | else | call nuwiki#commands#list_remove_done() | endif
command! -buffer -range VimwikiRemoveSingleCB call nuwiki#commands#list_remove_checkbox()
command! -buffer VimwikiRemoveCBInList call nuwiki#commands#list_remove_checkbox_in_list()
command! -buffer -nargs=? VimwikiListChangeLvl call nuwiki#commands#list_change_lvl()
@@ -158,7 +158,7 @@ if !has('nvim')
command! -buffer Nuwiki2HTMLBrowse call nuwiki#commands#export_browse()
command! -buffer -bang NuwikiAll2HTML if <bang>0 | call nuwiki#commands#export_all_force() | else | call nuwiki#commands#export_all() | endif
command! -buffer NuwikiRemoveDone call nuwiki#commands#list_remove_done()
command! -buffer -bang NuwikiRemoveDone if <bang>0 | call nuwiki#commands#list_remove_done_all() | else | call nuwiki#commands#list_remove_done() | endif
command! -buffer -range NuwikiRemoveCheckbox call nuwiki#commands#list_remove_checkbox()
command! -buffer NuwikiRemoveCheckboxInList call nuwiki#commands#list_remove_checkbox_in_list()
command! -buffer -nargs=? NuwikiListChangeLvl call nuwiki#commands#list_change_lvl()
@@ -264,8 +264,12 @@ if !has('nvim')
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>
" Bare gl/gL: remove the checkbox marker, keep the item text (upstream
" VimwikiRemoveSingleCB / RemoveCBInList). They share the `gl…` prefix
" with the maps above, so they fire after 'timeoutlen' — exactly as
" upstream. Remove-done is command-only (:NuwikiRemoveDone[!]).
nnoremap <silent><buffer> gl :call nuwiki#commands#list_remove_checkbox()<CR>
nnoremap <silent><buffer> gL :call nuwiki#commands#list_remove_checkbox_in_list()<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>
@@ -409,7 +413,7 @@ command! -buffer VimwikiDecrementListItem lua require('nuwiki.commands
command! -buffer -nargs=1 VimwikiChangeSymbolTo lua require('nuwiki.commands').list_change_symbol(<q-args>, false)
command! -buffer -nargs=1 VimwikiListChangeSymbolI lua require('nuwiki.commands').list_change_symbol(<q-args>, false)
command! -buffer -nargs=1 VimwikiChangeSymbolInListTo lua require('nuwiki.commands').list_change_symbol(<q-args>, true)
command! -buffer VimwikiRemoveDone lua require('nuwiki.commands').list_remove_done()
command! -buffer -bang VimwikiRemoveDone lua require('nuwiki.commands')[('<bang>' == '!') and 'list_remove_done_all' or 'list_remove_done']()
command! -buffer -range VimwikiRemoveSingleCB lua require('nuwiki.commands').list_remove_checkbox()
command! -buffer VimwikiRemoveCBInList lua require('nuwiki.commands').list_remove_checkbox_in_list()
command! -buffer -nargs=? VimwikiListChangeLvl lua require('nuwiki.commands').list_change_lvl()
@@ -494,7 +498,7 @@ command! -buffer NuwikiSplitLink split | lua vim.lsp.buf.definition()
command! -buffer NuwikiVSplitLink vsplit | lua vim.lsp.buf.definition()
command! -buffer NuwikiTabnewLink tabnew | lua vim.lsp.buf.definition()
command! -buffer NuwikiTabDropLink lua require('nuwiki.commands').follow_link_drop()
command! -buffer NuwikiRemoveDone lua require('nuwiki.commands').list_remove_done()
command! -buffer -bang NuwikiRemoveDone lua require('nuwiki.commands')[('<bang>' == '!') and 'list_remove_done_all' or 'list_remove_done']()
command! -buffer -range NuwikiRemoveCheckbox lua require('nuwiki.commands').list_remove_checkbox()
command! -buffer NuwikiRemoveCheckboxInList lua require('nuwiki.commands').list_remove_checkbox_in_list()
command! -buffer -nargs=? NuwikiListChangeLvl lua require('nuwiki.commands').list_change_lvl()
+8 -4
View File
@@ -231,10 +231,14 @@ function M.attach(bufnr, mappings)
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,
{ desc = 'nuwiki: remove done items (whole doc)' }, bufnr)
-- Bare gl/gL: remove the checkbox marker, keep the item text (upstream
-- VimwikiRemoveSingleCB / RemoveCBInList). They share the `gl…` prefix
-- with the maps above, so they fire after `timeoutlen` — exactly as
-- upstream. Remove-done is command-only (`:NuwikiRemoveDone[!]`).
map('n', 'gl', cmd.list_remove_checkbox,
{ desc = 'nuwiki: remove checkbox (current item)' }, bufnr)
map('n', 'gL', cmd.list_remove_checkbox_in_list,
{ desc = 'nuwiki: remove checkboxes (whole list)' }, bufnr)
map('n', 'o', open_below_with_bullet, { desc = 'nuwiki: open below + bullet' }, bufnr)
map('n', 'O', open_above_with_bullet, { desc = 'nuwiki: open above + bullet' }, bufnr)