diff --git a/vimrc.plugins.vim b/vimrc.plugins.vim index 0baa2ef..9ab3a52 100644 --- a/vimrc.plugins.vim +++ b/vimrc.plugins.vim @@ -314,14 +314,16 @@ nnoremap cc :call ToggleColorPreview() nnoremap ci :ColorVInsert nnoremap cp :ColorVPicker -let g:colorv_is_previewing = 0 function! ToggleColorPreview() abort - if g:colorv_is_previewing == 0 + if !exists('b:colorv_is_previewing') + let b:colorv_is_previewing = 0 + endif + if b:colorv_is_previewing == 0 execute 'ColorVPreview' - let g:colorv_is_previewing = 1 + let b:colorv_is_previewing = 1 else execute 'ColorVClear' - let g:colorv_is_previewing = 0 + let b:colorv_is_previewing = 0 endif endfunction "}}}