guix/misc/vim/syntax/nix.vim

38 lines
1.5 KiB
VimL
Raw Normal View History

2007-12-10 21:17:29 +00:00
" Vim syntax file
" Language: nix
" Maintainer: Marc Weber <marco-oweber@gmx.de>
" Modify and commit if you feel that way
" Last Change: 2007 Dec
" Quit when a (custom) syntax file was already loaded
if exists("b:current_syntax")
finish
endif
2007-12-12 02:12:58 +00:00
syn keyword nixKeyword let throw inherit import true false null with
2007-12-10 21:17:29 +00:00
syn keyword nixConditional if else then
syn keyword nixBrace ( ) { } =
syn keyword nixBuiltin __currentSystem __currentTime __isFunction __getEnv __trace __toPath __pathExists
\ __readFile __toXML __toFile __filterSource __attrNames __getAttr __hasAttr __isAttrs __listToAttrs __isList
\ __head __tail __add __sub __lessThan __substring __stringLength
syn match nixAttr "\w\+\ze\s*="
2007-12-12 02:12:58 +00:00
syn match nixFuncArg "\zs\w\+\ze\s*:"
2007-12-10 21:17:29 +00:00
syn region nixStringParam start=+\${+ end=+}+
syn region nixMultiLineComment start=+/\*+ skip=+\\"+ end=+\*/+
syn match nixEndOfLineComment "#.*$"
syn region nixStringIndented start=+''+ skip=+'''\|''${\|"+ end=+''+ contains=nixStringParam
syn region nixString start=+"+ skip=+\\"+ end=+"+ contains=nixStringParam
2007-12-10 21:17:29 +00:00
hi def link nixKeyword Keyword
hi def link nixConditional Conditional
hi def link nixBrace Special
hi def link nixString String
hi def link nixStringIndented String
2007-12-10 21:17:29 +00:00
hi def link nixBuiltin Special
2007-12-12 02:12:58 +00:00
hi def link nixStringParam Macro
2007-12-10 21:17:29 +00:00
hi def link nixMultiLineComment Comment
hi def link nixEndOfLineComment Comment
hi def link nixAttr Identifier
2007-12-12 02:12:58 +00:00
hi def link nixFuncArg Identifier