endif
+" HELPER FUNCTIONS
+
+" Check if the given syntax group is available. Thanks to bairui in #vim on
+" Freenode (2012-02-19 01:15 CET) for the try/catch silent highlight idea.
+if has('eval')
+ function! s:HasSyntaxGroup(group)
+ try
+ execute 'silent highlight ' . a:group
+ " \a = [A-Za-z]
+ catch /^Vim\%((\a\+)\)\=:E411/ " 'highlight group not found'
+ return 0
+ endtry
+ return 1
+ endfunction
+endif
+
+
" EDIT SETTINGS
" Enable automatic file detection, plugin and indention support.
" <antoine.mechelynck@gmail.com> from the Vim mailing list. It can easily be
" disabled when necessary with :2match (in Vim >= 700).
if !&diff && exists(':2match')
- 2match Todo /\%>78v./
+ " Use ColorColumn for overlong lines if available and my color
+ " scheme is used.
+ if &t_Co == 256 && <SID>HasSyntaxGroup('ColorColumn')
+ 2match ColorColumn /\%>78v./
+ else
+ 2match Todo /\%>78v./
+ endif
elseif !&diff
match Todo /\%>78v./
endif
execute ' for l:x in l:spaces'
\ '| call matchadd("Error", "\\%u" . l:x)'
\ '| endfor'
+
+" Reduce visibility of tabs in contrast to normal SpecialKeys.
+ if &t_Co == 256 && <SID>HasSyntaxGroup('specialKeyTab')
+ call matchadd('specialKeyTab', '\t')
+ endif
endif
endfunction
" Enable highlights for the current and all new windows. Thanks to bairui in