add comment highlight visibility function

This commit is contained in:
Ray Elliott 2020-07-31 15:42:06 +01:00
parent 2f9388a650
commit fde3ddf2be
1 changed files with 16 additions and 0 deletions

View File

@ -173,6 +173,21 @@ function! AleLinterStatus() abort "{{{
\)
endfunction
"}}}
function! ToggleHighlights() abort "{{{
if ! exists('b:toggle_highlights_state')
" state 1 is normal, state 0 is faded
let b:toggle_highlights_state = 1
else
let b:toggle_highlights_state = ! b:toggle_highlights_state
endif
if b:toggle_highlights_state == 1
hi Comment guifg=#9d9d9d
else
hi Comment guifg=#d6d6d6
endif
endfunction
"}}}
"----------------------------------------------------------------------------}}}
"#commands{{{
" TrimWhitespace{{{
@ -333,6 +348,7 @@ nnoremap <silent> <cr>s :syntax on<cr>
nnoremap <silent> <cr>S :syntax off<cr>
" miscallaneous {{{
nnoremap <cr>l :colorscheme paper-custom<cr>
nnoremap <cr>c :call ToggleHighlights()<cr>
nnoremap <cr>d :colorscheme monotonous-dark<cr>
nnoremap 0 ^
nnoremap <silent><space>cs :let @/=""<cr>