about summary refs log tree commit diff
path: root/misc
diff options
context:
space:
mode:
authorMarc Weber <marco-oweber@gmx.de>2007-12-10T21·17+0000
committerMarc Weber <marco-oweber@gmx.de>2007-12-10T21·17+0000
commit764b0115d5abd529d08d16f7bac2976e4a7e0cda (patch)
treed7f6d4d628d1e0841ae0d0a71b792ae8640d05c7 /misc
parentb42ef9c0544009b372e3da0275553ce08cf0ea2a (diff)
Very basic nix vim syntax highlighting
Diffstat (limited to 'misc')
-rw-r--r--misc/vim/syntax/nix.vim35
1 files changed, 35 insertions, 0 deletions
diff --git a/misc/vim/syntax/nix.vim b/misc/vim/syntax/nix.vim
new file mode 100644
index 000000000000..1f19ce6382f9
--- /dev/null
+++ b/misc/vim/syntax/nix.vim
@@ -0,0 +1,35 @@
+" Vim syntax file
+" Language:	nix
+" Maintainer:	Marc Weber <marco-oweber@gmx.de>
+"               Modify and commit if you feel that way
+" Last Change:	2007 Dec
+"
+" TODO What about headings (### header ) ?
+
+" Quit when a (custom) syntax file was already loaded
+if exists("b:current_syntax")
+  finish
+endif
+
+syn keyword	nixKeyword	let throw inherit import true false null
+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*="
+syn region nixStringParam start=+\${+ end=+}+
+syn region nixMultiLineComment start=+/\*+ skip=+\\"+ end=+\*/+
+syn match  nixEndOfLineComment "#.*$"
+syn region nixString      start=+"+ skip=+\\"+ end=+"+ contains=nixStringParam
+
+hi def link nixKeyword       Keyword
+hi def link nixConditional   Conditional
+hi def link nixBrace         Special
+hi def link nixString        String
+hi def link nixBuiltin       Special
+hi def link nixStringParam   Label
+hi def link nixMultiLineComment Comment
+hi def link nixEndOfLineComment Comment
+hi def link nixAttr        Identifier