Skip to content

Commit dec1f71

Browse files
committed
Add toggle yoe for conceallevel
[oe and ]oe cycle through the conceallevel 0-4.
1 parent 4afbe5e commit dec1f71

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

doc/unimpaired.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ On Off Toggle Option
7878
*[ob* *]ob* *yob* 'background' (dark is off, light is on)
7979
*[oc* *]oc* *yoc* 'cursorline'
8080
*[od* *]od* *yod* 'diff' (actually |:diffthis| / |:diffoff|)
81+
*[oe* *]oe* *yoe* 'conceallevel' (|[oe| and |]oe| cycle conceallevel)
8182
*[oh* *]oh* *yoh* 'hlsearch'
8283
*[oi* *]oi* *yoi* 'ignorecase'
8384
*[ol* *]ol* *yol* 'list'

plugin/unimpaired.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,9 @@ call s:option_map('<Bar>', 'cursorcolumn', 'setlocal')
271271
call s:map('n', '[od', ':diffthis<CR>')
272272
call s:map('n', ']od', ':diffoff<CR>')
273273
call s:map('n', 'yod', ':<C-R>=&diff ? "diffoff" : "diffthis"<CR><CR>')
274+
call s:map('n', '[oe', ':setlocal <C-R>="conceallevel=".(&conceallevel+1)%4<CR><CR>')
275+
call s:map('n', ']oe', ':setlocal <C-R>="conceallevel=".float2nr(&conceallevel-1-(4*floor((&conceallevel-1)/4.0)))<CR><CR>')
276+
call s:map('n', 'yoe', ':setlocal <C-R>=&conceallevel ? "conceallevel=0" : "conceallevel=2"<CR><CR>')
274277
call s:option_map('h', 'hlsearch', 'set')
275278
call s:option_map('i', 'ignorecase', 'set')
276279
call s:option_map('l', 'list', 'setlocal')

0 commit comments

Comments
 (0)