diff options
Diffstat (limited to '.vim/syntax')
-rw-r--r-- | .vim/syntax/git.vim | 36 | ||||
-rw-r--r-- | .vim/syntax/objc.vim | 110 | ||||
-rw-r--r-- | .vim/syntax/udev.vim | 40 |
3 files changed, 186 insertions, 0 deletions
diff --git a/.vim/syntax/git.vim b/.vim/syntax/git.vim new file mode 100644 index 0000000..81cddb8 --- /dev/null +++ b/.vim/syntax/git.vim @@ -0,0 +1,36 @@ +" Vim syntax file +" Language: git commit message + +" Quit when a (custom) syntax file was already loaded +if exists("b:current_syntax") + finish +endif + +syn region gitSignedOff start=/^Signed-off-by:/ end=/$/ contains=gitAuthor,gitEmail +syn region gitAuthor contained start=/\s/ end=/$/ + +syn region gitLine start=/^#/ end=/$/ +syn region gitCommit start=/^# Changes to be committed:$/ end=/^#$/ contains=gitHead,gitCommitFile +syn region gitHead contained start=/^# (.*)/ end=/^#$/ +syn region gitChanged start=/^# Changed but not updated:/ end=/^#$/ contains=gitHead,gitChangedFile +syn region gitUntracked start=/^# Untracked files:/ end=/^#$/ contains=gitHead,gitUntrackedFile + +syn match gitCommitFile contained /^#\t.*/hs=s+2 +syn match gitChangedFile contained /^#\t.*/hs=s+2 +syn match gitUntrackedFile contained /^#\t.*/hs=s+2 + +hi def link gitSignedOff Keyword +hi def link gitAuthor Normal + +hi def link gitLine Comment +hi def link gitCommit Comment +hi def link gitChanged Comment +hi def link gitHead Comment +hi def link gitUntracked Comment +hi def link gitCommitFile Type +hi def link gitChangedFile Constant +hi def link gitUntrackedFile Constant + +let b:current_syntax = "git" + +" vim: ts=8 sw=2 diff --git a/.vim/syntax/objc.vim b/.vim/syntax/objc.vim new file mode 100644 index 0000000..3aa1177 --- /dev/null +++ b/.vim/syntax/objc.vim @@ -0,0 +1,110 @@ +" Vim syntax file +" Language: Objective C +" Maintainer: Kazunobu Kuriyama <kazunobu.kuriyama@nifty.com> +" Ex-maintainer: Anthony Hodsdon <ahodsdon@fastmail.fm> +" First Author: Valentino Kyriakides <1kyriaki@informatik.uni-hamburg.de> +" Last Change: 2006 Mar 4 + +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +if &filetype != 'objcpp' + " Read the C syntax to start with + if version < 600 + source <sfile>:p:h/c.vim + else + runtime! syntax/c.vim + endif +endif + +" Objective C extentions follow below +" +" NOTE: Objective C is abbreviated to ObjC/objc +" and uses *.h, *.m as file extensions! + + +" ObjC keywords, types, type qualifiers etc. +syn keyword objcStatement self super _cmd +syn keyword objcType id Class SEL IMP BOOL +syn keyword objcTypeModifier bycopy in out inout oneway +syn keyword objcConstant nil Nil + +" Match the ObjC #import directive (like C's #include) +syn region objcImported display contained start=+"+ skip=+\\\\\|\\"+ end=+"+ +syn match objcImported display contained "<[_0-9a-zA-Z.\/]*>" +syn match objcImport display "^\s*\(%:\|#\)\s*import\>\s*["<]" contains=objcImported + +" Match the important ObjC directives +syn match objcScopeDecl "@public\|@private\|@protected" +syn match objcDirective "@interface\|@implementation" +syn match objcDirective "@class\|@end\|@defs" +syn match objcDirective "@encode\|@protocol\|@selector" +syn match objcDirective "@try\|@catch\|@finally\|@throw\|@synchronized" + +" Match the ObjC method types +" +" NOTE: here I match only the indicators, this looks +" much nicer and reduces cluttering color highlightings. +" However, if you prefer full method declaration matching +" append .* at the end of the next two patterns! +" +syn match objcInstMethod "^\s*-\s*" +syn match objcFactMethod "^\s*+\s*" + +" To distinguish from a header inclusion from a protocol list. +syn match objcProtocol display "<[_a-zA-Z][_a-zA-Z0-9]*>" contains=objcType,cType,Type + + +" To distinguish labels from the keyword for a method's parameter. +syn region objcKeyForMethodParam display + \ start="^\s*[_a-zA-Z][_a-zA-Z0-9]*\s*:\s*(" + \ end=")\s*[_a-zA-Z][_a-zA-Z0-9]*" + \ contains=objcType,objcTypeModifier,cType,cStructure,cStorageClass,Type + +" Objective-C Constant Strings +syn match objcSpecial display "%@" contained +syn region objcString start=+\(@"\|"\)+ skip=+\\\\\|\\"+ end=+"+ contains=cFormat,cSpecial,objcSpecial + +" Objective-C Message Expressions +syn region objcMessage display start="\[" end="\]" contains=objcMessage,objcStatement,objcType,objcTypeModifier,objcString,objcConstant,objcDirective,cType,cStructure,cStorageClass,cString,cCharacter,cSpecialCharacter,cNumbers,cConstant,cOperator,cComment,cCommentL,Type + +syn cluster cParenGroup add=objcMessage +syn cluster cPreProcGroup add=objcMessage + +" Define the default highlighting. +" For version 5.7 and earlier: only when not done already +" For version 5.8 and later: only when an item doesn't have highlighting yet +if version >= 508 || !exists("did_objc_syntax_inits") + if version < 508 + let did_objc_syntax_inits = 1 + command -nargs=+ HiLink hi link <args> + else + command -nargs=+ HiLink hi def link <args> + endif + + HiLink objcImport Include + HiLink objcImported cString + HiLink objcTypeModifier objcType + HiLink objcType Type + HiLink objcScopeDecl Statement + HiLink objcInstMethod Function + HiLink objcFactMethod Function + HiLink objcStatement Statement + HiLink objcDirective Statement + HiLink objcKeyForMethodParam None + HiLink objcString cString + HiLink objcSpecial Special + HiLink objcProtocol None + HiLink objcConstant cConstant + + delcommand HiLink +endif + +let b:current_syntax = "objc" + +" vim: ts=8 diff --git a/.vim/syntax/udev.vim b/.vim/syntax/udev.vim new file mode 100644 index 0000000..239183e --- /dev/null +++ b/.vim/syntax/udev.vim @@ -0,0 +1,40 @@ +" Vim syntax file +" Language: udev rules files +" Maintainer: Marco d'Itri <md@linux.it> +" Last Change: 2005 August 16 + +if exists("b:current_syntax") + finish +endif + +let b:current_syntax = "udev" + +syn keyword Ucondition ACTION BUS DRIVER ENV ID KERNEL RESULT SUBSYSTEM SYSFS +syn keyword Ucondition nextgroup=Uparambr,Uoperator +syn keyword Uaction PROGRAM NAME SYMLINK OWNER GROUP MODE RUN OPTIONS +syn keyword Uaction IMPORT GOTO LABEL +syn keyword Uaction nextgroup=Uparambr,Uoperator +syn region Uparambr start=/{/ end=/}/ contains=Uparam +syn match Uparam '[A-Za-z0-9_]*' contained +syn match Ufnmatch "[?*|]" contained +syn region Ufnmatch start=/\[/ skip=/\\\]/ end=/\]/ contained +syn match Uprintf '%[beknMmps%]\|%c{[0-9]}' contained +syn match Ustringvar '\$[a-z]*' nextgroup=Uparambr +syn match Ustring '"[^"]*"' contains=Uprintf,Ufnmatch,Ustringvar +syn match Uoperator "==\|!=\|=\|+=\|:=\|," +syn match Ueol '\\$' +syn region Ucomment start=/#/ end=/$/ +syn keyword Utodo contained TODO FIXME XXX + +hi def link Ucondition Identifier +hi def link Uaction Identifier +hi def link Uparambr Delimiter +hi def link Uparam PreProc +hi def link Ufnmatch Special +hi def link Uprintf Special +hi def link Ustringvar Function +hi def link Ustring String +hi def link Uoperator Operator +hi def link Ueol Delimiter +hi def link Ucomment Comment +hi def link Utodo Todo |