From a7b57e855436e7d50b58915d1156d7f94259eb45 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Tue, 2 Mar 2021 13:58:07 -0500 Subject: [PATCH] Improve the vim highlighting a bit. --- vim/after/syntax/cpp.vim | 20 ++++++++++++++++---- vim/colors/adam.vim | 18 ++++++++++++++---- vim/vimrc | 2 +- vim/vimrc.functions | 4 ++-- 4 files changed, 33 insertions(+), 11 deletions(-) diff --git a/vim/after/syntax/cpp.vim b/vim/after/syntax/cpp.vim index e32b73b..7b52659 100644 --- a/vim/after/syntax/cpp.vim +++ b/vim/after/syntax/cpp.vim @@ -8,7 +8,7 @@ syn keyword cppType noexcept decltype " I dislike the exception highlighting for these control statements. syn keyword cppStatement try throw catch -syn keyword cppStatement static_assert +"syn keyword cppStatement static_assert 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 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 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 cxxStlConstant containedin=cxxStlLibrary endl flush contained +" Smart pointers 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 find find_if find_first_of find_end 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 +" Metafunctions/Traits syn keyword cxxStlTraits containedin=cxxStlLibrary is_convertible 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 +" Exceptions syn keyword cxxStlExceptionNames containedin=cxxStlLibrary exception contained syn keyword cxxStlExceptionNames containedin=cxxStlLibrary runtime_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 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()" diff --git a/vim/colors/adam.vim b/vim/colors/adam.vim index ae34993..4ff3e01 100644 --- a/vim/colors/adam.vim +++ b/vim/colors/adam.vim @@ -44,6 +44,8 @@ hi Todo ctermfg=Black ctermbg=yellow term=none start=[103;90m stop=[ hi Cursor ctermfg=blue term=none start=[94m stop=[0m hi Directory ctermfg=Blue term=none start=[94m stop=[0m +hi ModeMsg ctermfg=white cterm=bold term=bold start=[97m stop=[0m + " Directory thru netrw hi netrwHelpCmd ctermfg=Green @@ -55,9 +57,9 @@ hi netrwSymLink ctermfg=Cyan "hi Cursor guibg=#60a060 guifg=#00ff00 " ctermfg=#00ff00 -hi Search ctermbg=brown ctermfg=white cterm=bold +hi Search ctermbg=brown ctermfg=white cterm=bold term=bold start=[48;5;130;97m stop=[0m "hi IncSearch cterm=NONE ctermbg=steelblue -hi LineNr ctermfg=yellow +hi LineNr ctermfg=yellow term=none start=[93m stop=[0m hi title ctermbg=yellow ctermfg=white hi ShowMarksHL 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=[94m stop=[0m " This is from vimrc.colors -- I may reintegrate it back together. "hi User0 ctermfg=green ctermbg=green term=bold -hi statusline ctermfg=white ctermbg=black term=none start=[107;30m stop=[0m +hi statusline ctermfg=white ctermbg=black cterm=reverse term=reverse start=[97;40m stop=[0m +hi statuslinenc ctermfg=grey ctermbg=grey cterm=reverse term=reverse start=[37;47m stop=[0m hi User1 ctermfg=red ctermbg=white term=standout term=none start=[91;107m stop=[0m hi User2 ctermfg=darkmagenta ctermbg=white term=standout term=none start=[35;107m stop=[0m hi User3 ctermfg=blue ctermbg=white term=standout term=none start=[34;107m stop=[0m -hi User4 ctermfg=cyan ctermbg=white term=standout term=none start=[36;107m stop=[0m +hi User4 ctermfg=darkcyan ctermbg=white term=standout term=none start=[36;107m stop=[0m hi User5 ctermfg=brown ctermbg=white term=standout term=none start=[33;107m stop=[0m hi User6 ctermfg=darkgreen ctermbg=white term=standout term=none start=[32;107m stop=[0m hi User8 ctermfg=magenta ctermbg=black term=bold term=none start=[95;40m stop=[0m @@ -166,6 +169,13 @@ hi User9 ctermfg=white ctermbg=black term=bold term=none start=[94m stop=[0m hi EndOfBuffer ctermfg=blue term=none start=[94m stop=[0m +hi MoreMsg ctermfg=2 gui=bold guifg=SeaGreen term=none start=[92m stop=[0m +hi Question ctermfg=2 gui=bold guifg=SeaGreen term=none start=[92m stop=[0m + +hi TabLine term=underline cterm=underline ctermfg=15 ctermbg=242 gui=underline guibg=DarkGrey start=[48;5;242;38;5;15m stop=[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. " I may have to maintain everything in this combined form diff --git a/vim/vimrc b/vim/vimrc index 12b0d5e..533641f 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -24,4 +24,4 @@ source ~/.vim/vimrc.fileprefs source ~/.vim/vimrc.statusline set shell=/bin/tcsh -set t_Co=1 +"set t_Co=1 diff --git a/vim/vimrc.functions b/vim/vimrc.functions index 1adaaea..4fb6a6e 100644 --- a/vim/vimrc.functions +++ b/vim/vimrc.functions @@ -17,12 +17,12 @@ function! MyFoldText() endfunction function! SyntaxItem() - "return synIDattr(synID(line("."),col("."),1),"name") + return synIDattr(synID(line("."),col("."),1),"name") let res = [] for id in synstack(line("."), col(".")) let res = res + [ synIDattr( id, "name" ) ] endfor "return synIDattr(synID(line("."),col("."),1),"name") - return join( res, ":" ) + "return join( res, ":" ) endfunction