summaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2017-03-30 17:31:44 +0300
committerJari Vetoniemi <mailroxas@gmail.com>2017-04-13 14:49:46 +0300
commit76b8c9e03c97b16d9ff97f3b79c0ecbff0f5e7f2 (patch)
tree70f1d22a923d1c01b22b2fade3b6e96365990dda /vim
Initial commit
Diffstat (limited to 'vim')
-rw-r--r--vim/filespec.vim56
1 files changed, 56 insertions, 0 deletions
diff --git a/vim/filespec.vim b/vim/filespec.vim
new file mode 100644
index 0000000..5e43fc5
--- /dev/null
+++ b/vim/filespec.vim
@@ -0,0 +1,56 @@
+" Vim syntax file
+" Language: Filespec
+" Author: Jari Vetoniemi
+
+syntax clear
+
+syn match fsBadContinuation contained "\\\s\+$"
+syn keyword fsTodo contained TODO FIXME XXX
+syn cluster fsCommentGroup contains=fsTodo,fsBadContinuation
+syn region fsComment start="//" skip="\\$" end="$" keepend contains=@fsCommentGroup,@Spell
+
+syn keyword fsStructure struct union
+syn keyword fsType s8 s16 s32 s64
+syn keyword fsType u8 u16 u32 u64
+syn keyword fsKind ascii utf8 sjis pad hex
+
+syn case ignore
+syn match fsNumbers display transparent "\<\d\|\.\d" contains=fsNumber,fsFloat,fsOctalError,fsOctal
+syn match fsNumbersCom display contained transparent "\<\d\|\.\d" contains=fsNumber,fsFloat,fsOctal
+syn match fsNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
+syn match fsNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
+syn match fsOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=fsOctalZero
+syn match fsOctalZero display contained "\<0"
+syn match fsFloat display contained "\d\+f"
+syn match fsFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
+syn match fsFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
+syn match fsFloat display contained "\d\+e[-+]\=\d\+[fl]\=\>"
+syn match fsOctalError display contained "0\o*[89]\d*"
+syn case match
+
+syn match fsSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
+syn region fsString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=fsSpecial,@Spell extend
+syn match fsCharacter "'[^']*'" contains=fsSpecial
+
+syn match fsBlock "[{}]"
+syn match fsBracket "[\[\]]"
+syn match fsOperator display "[-+&|<>=!*\/~.,;:%&^?()]" contains=fsComment,fsKind
+
+" Define the default highlighting.
+" Only used when an item doesn't have highlighting yet
+hi def link fsTodo Todo
+hi def link fsComment Comment
+hi def link fsStructure Structure
+hi def link fsType Type
+hi def link fsKind Constant
+hi def link fsNumber Number
+hi def link fsOctal Number
+hi def link fsOctalZero PreProc
+hi def link fsFloat Float
+hi def link fsOctalError Error
+hi def link fsString Constant
+hi def link fsCharacter Character
+hi def link fsSpecial SpecialChar
+hi def link fsBlock Constant
+hi def link fsBracket Constant
+hi def link fsOperator Operator