Add mongo core syntax changes.

Some of these I'll port into my new central file arrangements.
This commit is contained in:
ADAM David Alan Martin
2018-06-21 00:05:42 -04:00
parent 0f518cb3e0
commit 0dd3953f81
6 changed files with 78 additions and 21 deletions

View File

@ -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 "\<C::[A-Za-z_][A-Z_a-z0-9]*\>"
syn match cxxConstants "\<k[A-Z][A-Za-z_][A-Z_a-z0-9]*\>"
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 "\(\<std::\)\@<=string\>"
syn match cxxStlKeywords "\(\<std::\)\@<=mutex\>"
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

View File

@ -1 +1,40 @@
syn keyword doxygenParam contained tparam nextgroup=doxygenParamName,doxygenParamDirection skipwhite
syn region doxygenBody contained start=+\(/\*[*!]\)\@<!<\|[^<]\|$+ matchgroup=doxygenEndComment end=+\*/+re=e-2,me=e-2 contains=doxygenContinueCommentWhite,doxygenTODO,doxygenSpecial,doxygenOtherTags,doxygenSmallSpecial,doxygenHyperLink,doxygenHashLink,@doxygenHtmlGroup,@Spell,doxygenFixedWidth
syn region doxygenBriefLine contained start=+\<\k+ skip=+^\s*\(\*/\@!\s*\)\=\(\<\|[@\\]\<\([npcbea]\>\|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]\>\|\<em\>\|\<ref\|\<link\>\>\|\<f\$\|[$\\&<>#]\)\@!+ 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

View File

@ -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

View File

@ -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

View File

@ -15,3 +15,8 @@ function! MyFoldText()
return v:folddashes . sub
endif
endfunction
function! SyntaxItem()
return synIDattr(synID(line("."),col("."),1),"name")
endfunction

View File

@ -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')}