From fde3ddf2be95941c787cc235cadf703b70371dbd Mon Sep 17 00:00:00 2001 From: ray Date: Fri, 31 Jul 2020 15:42:06 +0100 Subject: [PATCH] add comment highlight visibility function --- init.vim | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/init.vim b/init.vim index ee051ee..e1e6958 100644 --- a/init.vim +++ b/init.vim @@ -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 s :syntax on nnoremap S :syntax off " miscallaneous {{{ nnoremap l :colorscheme paper-custom +nnoremap c :call ToggleHighlights() nnoremap d :colorscheme monotonous-dark nnoremap 0 ^ nnoremap cs :let @/=""