From dc6a4bfb76eb92519c3d17d790055a546cdb9df5 Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Tue, 7 Apr 2020 13:13:35 +0200 Subject: Add autocommand to reload colors --- vim/.vim/after/colors/colors.vim | 4 ++++ vim/.vim/after/syntax/vim.vim | 4 ++-- vim/.vimrc | 20 +++++++++++--------- 3 files changed, 17 insertions(+), 11 deletions(-) create mode 100644 vim/.vim/after/colors/colors.vim diff --git a/vim/.vim/after/colors/colors.vim b/vim/.vim/after/colors/colors.vim new file mode 100644 index 0000000..7c8c10a --- /dev/null +++ b/vim/.vim/after/colors/colors.vim @@ -0,0 +1,4 @@ +for i in range(1, 255) + exe "highlight vimHiNmbrFg".i." ctermfg=".i + exe "highlight vimHiNmbrBg".i." ctermfg=black ctermbg=".i +endfor diff --git a/vim/.vim/after/syntax/vim.vim b/vim/.vim/after/syntax/vim.vim index f6b389e..78e8d37 100644 --- a/vim/.vim/after/syntax/vim.vim +++ b/vim/.vim/after/syntax/vim.vim @@ -5,6 +5,8 @@ syntax cluster vimHiCluster add=vimHiCtermFg,vimHiCtermBg " Modification of default rule: @vimHiNmbrFgCluster,@vimHiNmbrBgCluster instead of vimHiNmbr syntax match vimHiCtermFg /\cctermfg=/ contained nextgroup=@vimHiNmbrFgCluster,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError syntax match vimHiCtermBg /\cctermbg=/ contained nextgroup=@vimHiNmbrBgCluster,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError +hi def link vimHiCtermFg vimHiCtermFgBg +hi def link vimHiCtermBg vimHiCtermFgBg " Assemble syntax groups let syntax_groups_fg = "vimHiNmbrFg1" @@ -20,6 +22,4 @@ exe "syntax cluster vimHiNmbrBgCluster contains=".syntax_groups_bg for i in range(1, 255) exe "syntax match vimHiNmbrFg".i." /".i."/ contained" exe "syntax match vimHiNmbrBg".i." /".i."/ contained" - exe "highlight vimHiNmbrFg".i." ctermfg=".i - exe "highlight vimHiNmbrBg".i." ctermfg=black ctermbg=".i endfor diff --git a/vim/.vimrc b/vim/.vimrc index 443a14d..16a8d73 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -382,18 +382,11 @@ nnoremap ,e :E " Unimpaired nmap co yo -"" Colorscheme {{{1 -nnoremap ,c :colorscheme -nnoremap ,cl :set background=light:colorscheme solarized -nnoremap ,cl :set background=dark:colorscheme solarized -nnoremap ,cs :colorscheme seoul256 -nnoremap ,cn :colorscheme nord -set notermguicolors -colo seoul256 - "" Autocommands {{{1 augroup vimrc autocmd! + autocmd ColorScheme * source $HOME/dotfiles/vim/.vim/after/colors/colors.vim + autocmd BufWritePost *vimrc,*exrc :call feedkeys(":source %\") autocmd BufNewFile,Bufread /tmp/mutt-* setlocal tw=72 autocmd BufWritePre * @@ -423,6 +416,15 @@ augroup vimrc autocmd FileType dirvish silent! unmap augroup END +"" Colorscheme {{{1 +nnoremap ,c :colorscheme +nnoremap ,cl :set background=light:colorscheme solarized +nnoremap ,cl :set background=dark:colorscheme solarized +nnoremap ,cs :colorscheme seoul256 +nnoremap ,cn :colorscheme nord +set notermguicolors +colo seoul256 + "" My search {{{1 " http://vim.wikia.com/wiki/Searching_for_files -- cgit v1.2.3