diff --git a/ftplugin/vimwiki.vim b/ftplugin/vimwiki.vim index e628756..cf1bf62 100644 --- a/ftplugin/vimwiki.vim +++ b/ftplugin/vimwiki.vim @@ -19,7 +19,12 @@ setlocal formatoptions+=ron setlocal suffixesadd=.wiki setlocal iskeyword+=- setlocal conceallevel=2 -setlocal concealcursor=nc +" Reveal the cursor line's raw markup in normal mode so left/right motions +" move over visible characters instead of stalling on hidden conceal regions +" (e.g. the `[[`, target, and `]]` of a wikilink). Other lines stay concealed. +" Insert/visual already reveal the cursor line; only incsearch (`c`) keeps it +" concealed so `/` highlighting isn't disrupted. +setlocal concealcursor=c let b:undo_ftplugin = 'setlocal commentstring< comments< formatoptions< suffixesadd< iskeyword< conceallevel< concealcursor<' diff --git a/scripts/test-keymaps-vim.vim b/scripts/test-keymaps-vim.vim index 5b7c401..908bed4 100644 --- a/scripts/test-keymaps-vim.vim +++ b/scripts/test-keymaps-vim.vim @@ -307,6 +307,20 @@ call s:record( \ 'folding.starts_with_all_folds_open', \ '&l:foldlevel=' . &l:foldlevel) +" ===== Conceal ===== + +" The ftplugin reveals the cursor line in normal mode (concealcursor has no +" `n`) so left/right motions move over visible characters instead of stalling +" on hidden conceal regions like a wikilink's `[[`/`]]`. +call s:record( + \ &l:conceallevel == 2 ? 1 : 0, + \ 'conceal.level_is_two', + \ '&l:conceallevel=' . &l:conceallevel) +call s:record( + \ &l:concealcursor !~# 'n' ? 1 : 0, + \ 'conceal.cursor_line_revealed_in_normal_mode', + \ '&l:concealcursor=' . &l:concealcursor) + " ===== Wrap up ===== call add(s:results, '')