From 061785c6a039e0397e3102da7aa9f44f2b520bef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Fr=C3=B3es=20Franco?= Date: Sun, 31 May 2026 08:10:05 -0300 Subject: [PATCH] feat(client): add gl/gL one-key list change-symbol mappings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- ftplugin/vimwiki.vim | 18 ++++++++++++++++++ lua/nuwiki/keymaps.lua | 12 ++++++++++++ 2 files changed, 30 insertions(+) diff --git a/ftplugin/vimwiki.vim b/ftplugin/vimwiki.vim index 836243f..509f997 100644 --- a/ftplugin/vimwiki.vim +++ b/ftplugin/vimwiki.vim @@ -246,6 +246,24 @@ if !has('nvim') nnoremap gLl :call nuwiki#commands#list_change_level(1, 1) nnoremap glr :call nuwiki#commands#list_renumber() nnoremap gLr :call nuwiki#commands#list_renumber_all() + " gl/gL: set the current item's / whole list's marker (upstream + " VimwikiChangeSymbolTo / ChangeSymbolInListTo). 1) is command-only. + nnoremap gl- :call nuwiki#commands#list_change_symbol('-', 0) + nnoremap gL- :call nuwiki#commands#list_change_symbol('-', 1) + nnoremap gl* :call nuwiki#commands#list_change_symbol('*', 0) + nnoremap gL* :call nuwiki#commands#list_change_symbol('*', 1) + nnoremap gl# :call nuwiki#commands#list_change_symbol('#', 0) + nnoremap gL# :call nuwiki#commands#list_change_symbol('#', 1) + nnoremap gl1 :call nuwiki#commands#list_change_symbol('1.', 0) + nnoremap gL1 :call nuwiki#commands#list_change_symbol('1.', 1) + nnoremap gli :call nuwiki#commands#list_change_symbol('i)', 0) + nnoremap gLi :call nuwiki#commands#list_change_symbol('i)', 1) + nnoremap glI :call nuwiki#commands#list_change_symbol('I)', 0) + nnoremap gLI :call nuwiki#commands#list_change_symbol('I)', 1) + nnoremap gla :call nuwiki#commands#list_change_symbol('a)', 0) + nnoremap gLa :call nuwiki#commands#list_change_symbol('a)', 1) + nnoremap glA :call nuwiki#commands#list_change_symbol('A)', 0) + nnoremap gLA :call nuwiki#commands#list_change_symbol('A)', 1) nnoremap gl :call nuwiki#commands#list_remove_done() nnoremap gL :call nuwiki#commands#list_remove_done_all() nnoremap o :call nuwiki#commands#open_below_with_bullet() diff --git a/lua/nuwiki/keymaps.lua b/lua/nuwiki/keymaps.lua index 431688b..5591671 100644 --- a/lua/nuwiki/keymaps.lua +++ b/lua/nuwiki/keymaps.lua @@ -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/gL: 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', cmd.list_remove_done, { desc = 'nuwiki: remove done items (current list)' }, bufnr) map('n', 'gL', cmd.list_remove_done_all,