diff options
Diffstat (limited to 'vim')
-rw-r--r-- | vim/.vimrc | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -87,6 +87,29 @@ highlight SpellLocal cterm=underline,bold ctermfg=black ctermbg=blue highlight SpellRare cterm=underline,bold ctermfg=black ctermbg=white highlight ColorColumn ctermfg=black ctermbg=yellow +" The terminal background (set in .Xresources) is the background for that part +" of the terminal where characters can be placed. The padding at the bottom +" and right side are the line border (color 708 in .Xresources). This is not +" colored by Vim by default. When the color scheme is changed, we check the +" current background color and update the line border of the terminal. +function! s:set_terminal_line_border() + let bg=synIDattr(synIDtrans(hlID('Normal')), 'bg', 'cterm') + if bg == '255' + silent execute ':!echo -e "\033]708;\#eeeeee\007"' + else + if bg != '234' + echohl WarningMsg + echo 'Vim background was set to '.bg.', which is unknown; resetting terminal lineBorder to default...' + echohl None + call getchar() + endif + silent execute ':!echo -e "\033]708;\#1c1c1c\007"' + endif +endfunction +autocmd ColorScheme * call s:set_terminal_line_border() +" When we leave vim we restore the value set also in .Xresources +autocmd VimLeave * silent execute ':!echo -e "\033]708;\#002b36\007"' + let network = system("iwconfig wlp2s0 | grep ESSID | cut -d'\"' -f2") let network = substitute(network, '\n', '', '') if index(["WiFi in de trein", "Syntus-Utrecht"], network) >= 0 |