diff --git a/vim/after/syntax/cpp.vim b/vim/after/syntax/cpp.vim index 6644ef3..3aa68a9 100644 --- a/vim/after/syntax/cpp.vim +++ b/vim/after/syntax/cpp.vim @@ -8,7 +8,7 @@ else endif syn match cxxObjects "\<[A-Z][A-Za-z0-9_]*[a-z][A-Za-z0-9_]*\>" -syn match cxxMetaFunction "\<[a-z][a-z0-9]*_[a-z0-9_]*[a-z0-9]\>" +"syn match cxxMetaFunction "\<[a-z][a-z0-9]*_[a-z0-9_]*[a-z0-9]\>" syn keyword cppType noexcept decltype @@ -19,8 +19,7 @@ syn keyword cppStatement static_assert syn keyword cxxConstants nullptr -syn match cxxConstants "\" -syn match cxxConstants "\" +syn match cxxConstants "\<\(C::[A-Za-z_]\|k[A-Z]\)[A-Z_a-z0-9]*\>" syn keyword cxxExceptionNames Exception Exceptions syn match cxxExceptionNames "\<[A-Z][A-Za-z0-9_]*Exception\>" @@ -44,13 +43,17 @@ syn match cxxStlConstant "\(std::\)\@<=\(endl\|flush\)\>" syn match cxxStlKeywords "\(\" syn match cxxStlKeywords "\(\" -syn match cxxStlKeywords "\(std::\)\@<=\(unique\|shared\|weak\)_ptr\(<\)\@=" +" syn match cxxStlTypes "\(std::\)\@<=\(vector\|array\|deque\|list\|pair\|\(priority_\)\?queue\|stack\|\(unordered_\)\?\(multi\)\?\(set\|map\)\)\(<\|;\| \)\@=" +syn match cxxStlKeywords "\(std::\)\@<=\(unique_ptr\)\(<\|;\| \|\>\)\@=" +syn match cxxStlKeywords "\(std::\)\@<=\(shared_ptr\)\(<\|;\| \|\>\)\@=" +syn match cxxStlKeywords "\(std::\)\@<=\(weak_ptr\)\(<\|;\| \|\>\)\@=" syn match cxxStlKeywords "\(std::\)\@<=nullptr_t\>" syn match cxxStlKeywords "\(std::\)\@<=function\>" syn match cxxStlFunctions "\(std::\)\@<=make_\(unique\|shared\)\(<\)\@=" syn match cxxStlFunctions "\(std::\)\@<=make_\(pair\|tuple\)\((\|<\)\@=" +syn match cxxStlFunctions "\(std::\)\@<=addressof\((\)\@=" syn match cxxStlFunctions "\(std::\)\@<=tie\((\)\@=" syn match cxxStlFunctions "\(std::\)\@<=copy\(_\(n\|backward\|if\)\)\?\((\)\@=" syn match cxxStlFunctions "\(std::\)\@<=find\(_\(if\|first_of\|end\)\?\)\((\)\@=" @@ -122,6 +125,7 @@ if version >= 508 || !exists("did_cxx_syntax_inits") HiLink cxxStlFunctions cppStatement HiLink cxxStlPrefix Caller HiLink cxxStlTraits MetaFunction + HiLink cxxMetaFunction MetaFunction HiLink cxxStlDangerousFunction Dangerous diff --git a/vim/after/syntax/doxygen.vim b/vim/after/syntax/doxygen.vim index ff7c6b9..bd349bf 100644 --- a/vim/after/syntax/doxygen.vim +++ b/vim/after/syntax/doxygen.vim @@ -1 +1,40 @@ syn keyword doxygenParam contained tparam nextgroup=doxygenParamName,doxygenParamDirection skipwhite + +syn region doxygenBody contained start=+\(/\*[*!]\)\@\|em\>\|ref\|link\>\>\|f\$\|[$\\&<>#]\)\|[^ \t\\@*]\)+ end=+^+ contains=doxygenFixedWidth skipwhite keepend matchgroup=xxx + +" Permit Ticked parameters +syn match doxygenParamName contained +`[A-Za-z0-9_:]\+`+ nextgroup=doxygenSpecialMultilineDesc,doxygenSpecialSingleLineDesc + +" Too Recursive +" syn al @cxxInDoxygen syntax/cpp.vim + +" Make all C++ code in a doxygen block look kinda like natural C++ +"syn match doxygenSpecialMultilineDesc "`" + +syn match doxygenCommentPreprocHighlight " \+\* " contained + +syn region doxygenFixedWidth matchgroup=Comment start=+`+ skip=+ * + end=+`+ contained contains=cxxObjects,cxxMetaFunction,cxxConstants,cppStatement,cxxExceptionNames,cxxErrorNames,cxxCast,cxxStlPrefix,cxxStlTypes,cxxStlService,cxxStlKeywords,cxxStlFunctions,cxxStlTraits,cxxStlExceptionNames,cxxStlDangerousFunction,cppAccess,cppModifier,cppType,cppExceptions,cppOperator,cppCast,cppStorageClass,cppStructure,cppBoolean,cppConstant,cppModifier,cppRawString,cppNumber,cppRawStringDelimiter,cStatement,cLabel,cRepeat,cTodo,cBadContinuation,cSpecial,cFormat,cString,cCppString,cCppSkip,cStringGroup,cCharacter,cSpecialCharacter,cBlock,cParenGroup,cParen,cCppParen,cBadBlock,cNumber,cNumbers,cNumbersCom,cOctal,cOctalZero,cFloat,cOctalError,cCommentSkip,cCommentL,cCommentString,cComment2String,cComment,cOperator,cStatement,cStructure,cStorageClass,cConstant,cBitField,cUserCont,cPreProcGroup,doxygenCommentPreprocHighlight,cDefine,cNamedConstant + +"syn region doxygenFixedWidth start=+`+ skip=+ * + end=+`+ contained contains=@cxx,@cpp + +syn region doxygenFixedWidth start=+\~\~\~+ skip=+ * + end=+\~\~\~+ contained contains=cxxObjects,cxxMetaFunction,cxxConstants,cppStatement,cxxExceptionNames,cxxErrorNames,cxxCast,cxxStlPrefix,cxxStlTypes,cxxStlService,cxxStlKeywords,cxxStlFunctions,cxxStlTraits,cxxStlExceptionNames,cxxStlDangerousFunction,cppAccess,cppModifier,cppType,cppExceptions,cppOperator,cppCast,cppStorageClass,cppStructure,cppBoolean,cppConstant,cppModifier,cppRawString,cppNumber,cppRawStringDelimiter,cStatement,cLabel,cRepeat,cTodo,cBadContinuation,cSpecial,cFormat,cString,cCppString,cCppSkip,cStringGroup,cCharacter,cSpecialCharacter,cBlock,cParenGroup,cParen,cCppParen,cBadBlock,cNumber,cNumbers,cNumbersCom,cOctal,cOctalZero,cFloat,cOctalError,cCommentSkip,cCommentL,cCommentString,cComment2String,cComment,cOperator,cStatement,cStructure,cStorageClass,cConstant,cBitField,cUserCont,cPreProc,cPreProcGroup,doxygenCommentPreprocHighlight,cDefine,cNamedConstant + +"syn region doxygenFixedWidth start=+\~\~\~+ skip=+ * + end=+\~\~\~+ contained contains=@cxx,@cpp + +"syn match doxygenFixedWidth +`.\+`+ contained + +syn region doxygenSpecialMultilineDesc start=+.\++ skip=+^\s*\(\*/\@!\s*\)\=\(\<\|[@\\]\<\([npcbea]\>\|em\>\|ref\|link\>\>\|f\$\|[$\\&<>#]\)\|[^ \t\\@*]\)+ end=+^+ contained contains=doxygenSpecialContinueCommentWhite,doxygenSmallSpecial,doxygenHyperLink,doxygenHashLink,doxygenFixedWidth,@doxygenHtmlGroup,@Spell skipwhite keepend +syn region doxygenSpecialSingleLineDesc start=+.\++ skip=+^\s*\(\*/\@!\s*\)\=\(\<\|[@\\]\<\([npcbea]\>\|em\>\|ref\|link\>\>\|f\$\|[$\\&<>#]\)\|[^ \t\\@*]\)+ end=+^+ contained contains=doxygenOtherTags,doxygenSpecialContinueCommentWhite,doxygenSmallSpecial,doxygenHyperLink,doxygenFixedWidth,doxygenHashLink,@doxygenHtmlGroup,doxygenTODO,@Spell skipwhite keepend + +"syn keyword doxygenOther contained : nextgroup=doxygenSpecialMultilineDesc skipwhite + +"syn match doxygenMagic + +" +\(\<[npcbea]\>\|\\|\\>\|\#]\)\@!+ nextgroup=doxygenParam,doxygenRetval,doxygenBriefWord,doxygenBold,doxygenBOther,doxygenOther,doxygenOtherTODO,doxygenOtherWARN,doxygenOtherBUG,doxygenPage,doxygenGroupDefine,doxygenCodeRegion,doxygenVerbatimRegion,doxygenDotRegion + +hi link doxygenFixedWidth None +hi link doxygenOtherTags doxygenOther +hi link doxygenSpecialSingleLineDesc doxygenSpecialMultilineDesc +hi link doxygenCommentPreprocHighlight PreProc diff --git a/vim/colors/adam.vim b/vim/colors/adam.vim index 0eea801..98b4bca 100644 --- a/vim/colors/adam.vim +++ b/vim/colors/adam.vim @@ -78,6 +78,10 @@ hi cIf0 ctermfg=gray " End of ron above. "set t_Co=8 +"hi StatusUnwrap ctermfg=236 ctermbg=none cterm=none +"hi StatusUnwrap ctermfg=brown ctermbg=none cterm=none +"hi StatusUnwrap ctermfg=236 ctermbg=none cterm=none +hi StatusUnwrap ctermfg=58 ctermbg=none cterm=none hi Comment ctermfg=darkgrey cterm=bold hi Identifier ctermfg=cyan hi Object ctermfg=red diff --git a/vim/vimrc.fileprefs b/vim/vimrc.fileprefs index 8eea182..b0b6be1 100644 --- a/vim/vimrc.fileprefs +++ b/vim/vimrc.fileprefs @@ -1,11 +1,10 @@ "au BufNewFile,BufRead *.i,*.l setf c -au BufNewFile,BufRead mk* setf make +au BufNewFile,BufRead mk* set filetype=make "au BufNewFile,BufRead *.slogo setf c au BufNewFile,BufRead *.tex map _ {!}fmt -p -s -w 70 au BufNewFile,BufRead *.tex set textwidth=78 au BufNewFile,BufRead *.java set tabstop=4 au BufNewFile,BufRead *.java set shiftwidth=4 -au BufNewFile,BufRead *.cpp,*.hpp,*.cc,*.h setf cpp " Alephaish au BufNewFile,BufRead *.cpp,*.hpp,*.cc,*.h set sw=4 @@ -15,7 +14,7 @@ au BufNewFile,BufRead *.cpp,*.hpp,*.cc,*.h set sta au BufNewFile,BufRead *.cpp,*.hpp,*.cc,*.h set noet au BufNewFile,BufRead *.cpp,*.hpp,*.cc,*.h set tw=150 -au BufNewFile,BufRead */cshenv/tcshrc.* setf tcsh +au BufNewFile,BufRead */cshenv/tcshrc.* set filetype=tcsh " falcish "au BufNewFile,BufRead *.cpp,*.hpp,*.cc,*.h set ts=3 @@ -31,8 +30,10 @@ au BufNewFile,BufRead */cshenv/tcshrc.* setf tcsh "au BufNewFile,BufRead *.cpp,*.hpp,*.cc,*.h set et "au BufNewFile,BufRead *.cpp,*.hpp,*.cc,*.h set tw=100 +"au BufNewFile,BufRead *.cpp,*.hpp,*.cc,*.h setf cpp + au FileType * setlocal formatoptions=tcq -if has("syntax") - syntax on -endif +"if has("syntax") +" syntax on +"endif diff --git a/vim/vimrc.functions b/vim/vimrc.functions index 54c1329..a9cc43d 100644 --- a/vim/vimrc.functions +++ b/vim/vimrc.functions @@ -15,3 +15,8 @@ function! MyFoldText() return v:folddashes . sub endif endfunction + +function! SyntaxItem() + return synIDattr(synID(line("."),col("."),1),"name") +endfunction + diff --git a/vim/vimrc.statusline b/vim/vimrc.statusline index 1ef5ddf..fcd2a0d 100644 --- a/vim/vimrc.statusline +++ b/vim/vimrc.statusline @@ -1,5 +1,5 @@ function! GetYearGlyph() - " TODO Write a full parser which adjusts for some "second centry" + " TODO Write a full parser which adjusts for some "second century" " point generates: " 00 - 09 as \`0 - \`9 " 10 - 19 as \'0 - \'9 @@ -36,16 +36,20 @@ endfunction " when I start. -set statusline= " reset the status line, for ADAM's colorful status line -set statusline+=%1*[%02.03n]%0* " max/min for buf #, in [] -set statusline+=Pos:\ %4*%3l/%3L%0* " Pos: '.'/'$', -set statusline+=\ %2*%c%2V%0* " Column # and tab detect -set statusline+=\ %5*@%0* " Colored @ for percent -set statusline+=\ %6*%P%0* " Percent thru file -set statusline+=\ File:\ %3*%<%-f%0* " File: Path left trim and align -set statusline+=%4*%(\ (%M%R%H)%)%0* " File editing mode (+/-,RO,HLP) -set statusline+=%= " Divider between left & right align -set statusline+=\ %9*X=%02B " Current char byte val in hex +set statusline= " reset the status line, for ADAM's colorful status line +set statusline+=%1*[%02.05n]%0* " max/min for buf #, in [] +set statusline+=Pos:\ %4*%3l/%3L%0* " Pos: '.'/'$', +set statusline+=\ %2*%c%2V%0* " Column # and tab detect +set statusline+=\ %5*@%0* " Colored @ for percent +set statusline+=\ %6*%P%0* " Percent thru file +set statusline+=\ File:\ %3*%<%-f%0* " File: Path left trim and align +set statusline+=%4*%(\ (%M%R%H)%)%0* " File editing mode (+/-,RO,HLP) + +set statusline+=%= " Divider between left & right align + +set statusline+=\ Syn:\ %2*%{SyntaxItem()}%0* " Setup syntax highlighting group display + +set statusline+=\ %9*X=%02B " Current char byte val in hex "Lastly put the time in classic Magenta, like my TCSH prompt: set statusline+=\ %8*%{GetYearGlyph()}-%{strftime('%m-%d\ %H:%M')}