From 681a546eb774d1c47c9fd7ab685cbb278c51a7c2 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Tue, 26 Jul 2022 17:41:23 +0200 Subject: [PATCH] Load codedark colorscheme only if available --- vimrc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vimrc b/vimrc index 9995640..6ee3bb9 100644 --- a/vimrc +++ b/vimrc @@ -30,7 +30,12 @@ " For all default colorschemes, see `ls -l /usr/share/vim/vim*/colors/` " For extra colorschemes, see `ls -l ~/.vim/colors` set t_Co=256 " for tmux 256 colors -colorscheme codedark " default colorscheme +if filereadable ($HOME."/.vim/colors/codedark.vim") + colorscheme codedark " codedark colorscheme if available + let g:HLColorScheme = g:colors_name +else + colorscheme default " default colorscheme +endif set background=dark syntax on " activation de la coloration syntaxique set number " numérotation des lignes @@ -928,7 +933,6 @@ autocmd BufWritePre * :%s/\s\+$//e " Search for 2 whitespaces and highlight it (red and underline) set hls let g:HLSpace = 1 -let g:HLColorScheme = g:colors_name function! ToggleSpaceUnderscoring() if g:HLSpace highlight Search cterm=underline gui=underline ctermbg=red ctermfg=none