Improve the vim highlighting a bit.

This commit is contained in:
2021-03-02 13:58:07 -05:00
parent d6419881ec
commit a7b57e8554
4 changed files with 33 additions and 11 deletions

View File

@ -8,7 +8,7 @@ syn keyword cppType noexcept decltype
" I dislike the exception highlighting for these control statements. " I dislike the exception highlighting for these control statements.
syn keyword cppStatement try throw catch syn keyword cppStatement try throw catch
syn keyword cppStatement static_assert "syn keyword cppStatement static_assert
syn keyword cxxConstants nullptr syn keyword cxxConstants nullptr
@ -45,8 +45,6 @@ syn region cxxBoostLibrary matchgroup=cxxLibPrefix start="\<\(boost\)\z(::\)\@="
syn keyword cxxStlKeywords containedin=cxxStlLibrary,cxxBoostLibrary string_view mutex thread contained syn keyword cxxStlKeywords containedin=cxxStlLibrary,cxxBoostLibrary string_view mutex thread contained
syn keyword cxxStlKeywords containedin=cxxStlLibrary string contained syn keyword cxxStlKeywords containedin=cxxStlLibrary string contained
syn keyword cxxStlKeywords containedin=cxxStlLibrary,cxxBoostLibrary shared_ptr weak_ptr contained
syn keyword cxxStlKeywords containedin=cxxStlLibrary unique_ptr nullptr_t contained
syn keyword cxxStlKeywords containedin=cxxStlLibrary,cxxBoostLibrary function contained syn keyword cxxStlKeywords containedin=cxxStlLibrary,cxxBoostLibrary function contained
syn keyword cxxStlTypes containedin=cxxStlLibrary iostream istream ostream fstream ifstream ofstream contained syn keyword cxxStlTypes containedin=cxxStlLibrary iostream istream ostream fstream ifstream ofstream contained
@ -61,8 +59,15 @@ syn keyword cxxStlTypes containedin=cxxStlLibrary,cxxBoostLibrary unordered_set
syn keyword cxxStlService containedin=cxxStlLibrary cout clog cerr contained syn keyword cxxStlService containedin=cxxStlLibrary cout clog cerr contained
syn keyword cxxStlConstant containedin=cxxStlLibrary endl flush contained syn keyword cxxStlConstant containedin=cxxStlLibrary endl flush contained
" Smart pointers
syn keyword cxxStlFunctions containedin=cxxStlLibrary,cxxBoostLibrary make_shared make_tuple contained syn keyword cxxStlFunctions containedin=cxxStlLibrary,cxxBoostLibrary make_shared make_tuple contained
syn keyword cxxStlFunctions containedin=cxxStlLibrary make_unique make_pair tie addressof contained syn keyword cxxStlKeywords containedin=cxxBoostLibrary scoped_ptr contained
syn keyword cxxStlKeywords containedin=cxxStlLibrary,cxxBoostLibrary shared_ptr weak_ptr contained
syn keyword cxxStlFunctions containedin=cxxStlLibrary make_unique contained
syn keyword cxxStlKeywords containedin=cxxStlLibrary unique_ptr nullptr_t contained
" Algorithms
syn keyword cxxStlFunctions containedin=cxxStlLibrary make_pair tie addressof contained
syn keyword cxxStlFunctions containedin=cxxStlLibrary copy copy_n copy_if copy_backward replace_copy_if replace_copy contained syn keyword cxxStlFunctions containedin=cxxStlLibrary copy copy_n copy_if copy_backward replace_copy_if replace_copy contained
syn keyword cxxStlFunctions containedin=cxxStlLibrary find find_if find_first_of find_end contained syn keyword cxxStlFunctions containedin=cxxStlLibrary find find_if find_first_of find_end contained
syn keyword cxxStlFunctions containedin=cxxStlLibrary count count_if search search_n contained syn keyword cxxStlFunctions containedin=cxxStlLibrary count count_if search search_n contained
@ -81,12 +86,15 @@ syn keyword cxxStlFunctions containedin=cxxStlLibrary min max min_element max_el
syn keyword cxxStlFunctions containedin=cxxStlLibrary getline contained syn keyword cxxStlFunctions containedin=cxxStlLibrary getline contained
" Metafunctions/Traits
syn keyword cxxStlTraits containedin=cxxStlLibrary is_convertible contained syn keyword cxxStlTraits containedin=cxxStlLibrary is_convertible contained
syn keyword cxxStlTraits containedin=cxxStlLibrary is_constructible is_default_constructible contained syn keyword cxxStlTraits containedin=cxxStlLibrary is_constructible is_default_constructible contained
" Free floating STL functions
syn keyword cxxStlFreeFunctions back_inserter front_inserter inserter begin end syn keyword cxxStlFreeFunctions back_inserter front_inserter inserter begin end
" Exceptions
syn keyword cxxStlExceptionNames containedin=cxxStlLibrary exception contained syn keyword cxxStlExceptionNames containedin=cxxStlLibrary exception contained
syn keyword cxxStlExceptionNames containedin=cxxStlLibrary runtime_error contained syn keyword cxxStlExceptionNames containedin=cxxStlLibrary runtime_error contained
syn keyword cxxStlExceptionNames containedin=cxxStlLibrary logic_error contained syn keyword cxxStlExceptionNames containedin=cxxStlLibrary logic_error contained
@ -102,6 +110,10 @@ syn keyword cxxStlExceptionNames containedin=cxxStlLibrary range_error contained
syn keyword cxxStlExceptionNames containedin=cxxStlLibrary overflow_error contained syn keyword cxxStlExceptionNames containedin=cxxStlLibrary overflow_error contained
syn keyword cxxStlExceptionNames containedin=cxxStlLibrary underflow_error contained syn keyword cxxStlExceptionNames containedin=cxxStlLibrary underflow_error contained
" Some common boost-only bits I use
syn keyword cxxStlKeywords contained containedin=cxxBoostLibrary lexical_cast
" Highlight dangerous things
syn match cxxStlDangerousFunction "\(\.\)\@<=release()" syn match cxxStlDangerousFunction "\(\.\)\@<=release()"

View File

@ -44,6 +44,8 @@ hi Todo ctermfg=Black ctermbg=yellow term=none start=<esc>[103;90m stop=<esc>[
hi Cursor ctermfg=blue term=none start=<esc>[94m stop=<esc>[0m hi Cursor ctermfg=blue term=none start=<esc>[94m stop=<esc>[0m
hi Directory ctermfg=Blue term=none start=<esc>[94m stop=<esc>[0m hi Directory ctermfg=Blue term=none start=<esc>[94m stop=<esc>[0m
hi ModeMsg ctermfg=white cterm=bold term=bold start=<esc>[97m stop=<esc>[0m
" Directory thru netrw " Directory thru netrw
hi netrwHelpCmd ctermfg=Green hi netrwHelpCmd ctermfg=Green
@ -55,9 +57,9 @@ hi netrwSymLink ctermfg=Cyan
"hi Cursor guibg=#60a060 guifg=#00ff00 "hi Cursor guibg=#60a060 guifg=#00ff00
" ctermfg=#00ff00 " ctermfg=#00ff00
hi Search ctermbg=brown ctermfg=white cterm=bold hi Search ctermbg=brown ctermfg=white cterm=bold term=bold start=<esc>[48;5;130;97m stop=<esc>[0m
"hi IncSearch cterm=NONE ctermbg=steelblue "hi IncSearch cterm=NONE ctermbg=steelblue
hi LineNr ctermfg=yellow hi LineNr ctermfg=yellow term=none start=<esc>[93m stop=<esc>[0m
hi title ctermbg=yellow ctermfg=white hi title ctermbg=yellow ctermfg=white
hi ShowMarksHL ctermbg=yellow ctermfg=black cterm=bold hi ShowMarksHL ctermbg=yellow ctermfg=black cterm=bold
hi CursorLine ctermbg=yellow ctermfg=black cterm=bold hi CursorLine ctermbg=yellow ctermfg=black cterm=bold
@ -154,11 +156,12 @@ hi NamedConstant ctermfg=blue term=none start=<esc>[94m stop=<esc>[0m
" This is from vimrc.colors -- I may reintegrate it back together. " This is from vimrc.colors -- I may reintegrate it back together.
"hi User0 ctermfg=green ctermbg=green term=bold "hi User0 ctermfg=green ctermbg=green term=bold
hi statusline ctermfg=white ctermbg=black term=none start=<esc>[107;30m stop=<esc>[0m hi statusline ctermfg=white ctermbg=black cterm=reverse term=reverse start=<esc>[97;40m stop=<esc>[0m
hi statuslinenc ctermfg=grey ctermbg=grey cterm=reverse term=reverse start=<esc>[37;47m stop=<esc>[0m
hi User1 ctermfg=red ctermbg=white term=standout term=none start=<esc>[91;107m stop=<esc>[0m hi User1 ctermfg=red ctermbg=white term=standout term=none start=<esc>[91;107m stop=<esc>[0m
hi User2 ctermfg=darkmagenta ctermbg=white term=standout term=none start=<esc>[35;107m stop=<esc>[0m hi User2 ctermfg=darkmagenta ctermbg=white term=standout term=none start=<esc>[35;107m stop=<esc>[0m
hi User3 ctermfg=blue ctermbg=white term=standout term=none start=<esc>[34;107m stop=<esc>[0m hi User3 ctermfg=blue ctermbg=white term=standout term=none start=<esc>[34;107m stop=<esc>[0m
hi User4 ctermfg=cyan ctermbg=white term=standout term=none start=<esc>[36;107m stop=<esc>[0m hi User4 ctermfg=darkcyan ctermbg=white term=standout term=none start=<esc>[36;107m stop=<esc>[0m
hi User5 ctermfg=brown ctermbg=white term=standout term=none start=<esc>[33;107m stop=<esc>[0m hi User5 ctermfg=brown ctermbg=white term=standout term=none start=<esc>[33;107m stop=<esc>[0m
hi User6 ctermfg=darkgreen ctermbg=white term=standout term=none start=<esc>[32;107m stop=<esc>[0m hi User6 ctermfg=darkgreen ctermbg=white term=standout term=none start=<esc>[32;107m stop=<esc>[0m
hi User8 ctermfg=magenta ctermbg=black term=bold term=none start=<esc>[95;40m stop=<esc>[0m hi User8 ctermfg=magenta ctermbg=black term=bold term=none start=<esc>[95;40m stop=<esc>[0m
@ -166,6 +169,13 @@ hi User9 ctermfg=white ctermbg=black term=bold term=none start=<e
hi NonText ctermfg=blue term=none start=<esc>[94m stop=<esc>[0m hi NonText ctermfg=blue term=none start=<esc>[94m stop=<esc>[0m
hi EndOfBuffer ctermfg=blue term=none start=<esc>[94m stop=<esc>[0m hi EndOfBuffer ctermfg=blue term=none start=<esc>[94m stop=<esc>[0m
hi MoreMsg ctermfg=2 gui=bold guifg=SeaGreen term=none start=<esc>[92m stop=<esc>[0m
hi Question ctermfg=2 gui=bold guifg=SeaGreen term=none start=<esc>[92m stop=<esc>[0m
hi TabLine term=underline cterm=underline ctermfg=15 ctermbg=242 gui=underline guibg=DarkGrey start=<esc>[48;5;242;38;5;15m stop=<esc>[0m
hi TabLineSel term=bold cterm=bold gui=bold
hi TabLineFill term=reverse cterm=reverse gui=reverse
" The vim colorscheme does everything, and some of the non-status-bar colors affect non-source bits. " The vim colorscheme does everything, and some of the non-status-bar colors affect non-source bits.
" I may have to maintain everything in this combined form " I may have to maintain everything in this combined form

View File

@ -24,4 +24,4 @@ source ~/.vim/vimrc.fileprefs
source ~/.vim/vimrc.statusline source ~/.vim/vimrc.statusline
set shell=/bin/tcsh set shell=/bin/tcsh
set t_Co=1 "set t_Co=1

View File

@ -17,12 +17,12 @@ function! MyFoldText()
endfunction endfunction
function! SyntaxItem() function! SyntaxItem()
"return synIDattr(synID(line("."),col("."),1),"name") return synIDattr(synID(line("."),col("."),1),"name")
let res = [] let res = []
for id in synstack(line("."), col(".")) for id in synstack(line("."), col("."))
let res = res + [ synIDattr( id, "name" ) ] let res = res + [ synIDattr( id, "name" ) ]
endfor endfor
"return synIDattr(synID(line("."),col("."),1),"name") "return synIDattr(synID(line("."),col("."),1),"name")
return join( res, ":" ) "return join( res, ":" )
endfunction endfunction