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,