From 49d2add0fc7f6edb48b0a5956f9596fa4782d3dd Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Wed, 3 Mar 2021 18:30:27 -0500 Subject: [PATCH 1/3] Make vim load the top line, always. --- vim/vimrc.fileprefs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vim/vimrc.fileprefs b/vim/vimrc.fileprefs index 19072d4..27283ad 100644 --- a/vim/vimrc.fileprefs +++ b/vim/vimrc.fileprefs @@ -38,3 +38,8 @@ au FileType * setlocal formatoptions=tcq " Statusline workaround: au BufWinEnter quickfix source ~/.vim/vimrc.statusline + +" Sometimes some distros make us load up on the last line edited, when reading for the first time... +" This should fix this. +au BufReadPost * :1 +au BufNewFile * :1 From 5b266ff8fde48326893d355637908f16d1c2479a Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Sat, 6 Mar 2021 01:10:36 -0500 Subject: [PATCH 2/3] A few more C++ names in libraries. Also support for the `exports` namespace convention. --- vim/after/syntax/cpp.vim | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/vim/after/syntax/cpp.vim b/vim/after/syntax/cpp.vim index 7b52659..76f5753 100644 --- a/vim/after/syntax/cpp.vim +++ b/vim/after/syntax/cpp.vim @@ -12,6 +12,8 @@ syn keyword cppStatement try throw catch syn keyword cxxConstants nullptr +syn keyword cxxExportNamespace exports + syn match cxxConstants "\<\(C::[A-Za-z_]\|k[A-Z]\)[A-Z_a-z0-9]*\>" syn keyword cxxExceptionNames Exception Exceptions @@ -42,8 +44,14 @@ syn region cxxBoostLibrary matchgroup=cxxLibPrefix start="\<\(boost\)\z(::\)\@=" -syn keyword cxxStlKeywords containedin=cxxStlLibrary,cxxBoostLibrary string_view mutex thread contained +" Threading +syn keyword cxxStlKeywords contained containedin=cxxStlLibrary,cxxBoostLibrary mutex condition_variable thread lock_guard scoped_lock unique_lock + +syn keyword cxxStlKeywords containedin=cxxStlLibrary byte contained + +" Strings syn keyword cxxStlKeywords containedin=cxxStlLibrary string contained +syn keyword cxxStlKeywords contained containedin=cxxStlLibrary,cxxBoostLibrary string_view syn keyword cxxStlKeywords containedin=cxxStlLibrary,cxxBoostLibrary function contained @@ -87,8 +95,13 @@ 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 +syn keyword cxxLibStatement contained containedin=cxxStlLibrary decay_t +syn keyword cxxStlTypes contained containedin=cxxStlLibrary type_identity type_identity_t +syn keyword cxxStlTraits contained containedin=cxxStlLibrary is_convertible is_base_of +syn keyword cxxStlTraits contained containedin=cxxStlLibrary is_constructible is_default_constructible is_same +syn keyword cxxStlTraits contained containedin=cxxStlLibrary,cxxBoostLibrary enable_if enable_if_t +syn keyword cxxStlConstant contained containedin=cxxStlLibrary bool_constant is_same_v is_convertible_v is_constructible_v +syn keyword cxxStlConstant contained containedin=cxxStlLibrary,cxxBoostLibrary bool_constant true_type false_type is_base_of_v " Free floating STL functions syn keyword cxxStlFreeFunctions back_inserter front_inserter inserter begin end @@ -111,7 +124,8 @@ syn keyword cxxStlExceptionNames containedin=cxxStlLibrary overflow_error contai syn keyword cxxStlExceptionNames containedin=cxxStlLibrary underflow_error contained " Some common boost-only bits I use -syn keyword cxxStlKeywords contained containedin=cxxBoostLibrary lexical_cast +syn keyword cxxStlKeywords contained containedin=cxxBoostLibrary +syn keyword cxxLibStatement contained containedin=cxxBoostLibrary lexical_cast noncopyable " Highlight dangerous things syn match cxxStlDangerousFunction "\(\.\)\@<=release()" @@ -149,11 +163,15 @@ if version >= 508 || !exists("did_cxx_syntax_inits") HiLink cxxStlKeywords cppType HiLink cxxStlFunctions cppStatement HiLink cxxStlFreeFunctions cppStatement + HiLink cxxLibStatement cppStatement HiLink cxxLibPrefix Caller + HiLink cxxExportNamespace cppModule + HiLink cxxStlTraits MetaFunction HiLink cxxMetaFunction MetaFunction + HiLink cxxLibMetaFunction cxxMetaFunction HiLink cxxStlDangerousFunction Dangerous From 974530dfd97c5bcbc974b5153da11cd15fcad14a Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Sat, 6 Mar 2021 01:12:20 -0500 Subject: [PATCH 3/3] Disable hard tabs for a codebase. --- vim/vimrc.fileprefs | 1 + 1 file changed, 1 insertion(+) diff --git a/vim/vimrc.fileprefs b/vim/vimrc.fileprefs index 1726510..7441f4c 100644 --- a/vim/vimrc.fileprefs +++ b/vim/vimrc.fileprefs @@ -18,6 +18,7 @@ au BufNewFile,BufRead */cshenv/tcshrc.* set filetype=tcsh au BufNewFile,BufRead */src/bp/*.cpp,*/src/bp/*.hpp syn region cxxBoostLibrary matchgroup=cxxLibPrefix start="\<\(bp_boost\)\z(::\)\@=" matchgroup=NONE skip="\z1" end="\>" transparent au BufNewFile,BufRead */src/bp/*.cpp,*/src/bp/*.hpp syn region cxxBoostVerbotenLibrary matchgroup=cxxStlDangerousFunction start="\<\(boost\)\z(::\)\@=" matchgroup=NONE skip="\z1" end="\>" transparent +au BufNewFile,BufRead */src/bp/*.cpp,*/src/bp/*.hpp set et " falcish "au BufNewFile,BufRead *.cpp,*.hpp,*.cc,*.h set ts=3