@@ -6,7 +6,7 @@ index a8e6261..2b008fc 100644
66 " Z80 assembler asz80
77 au BufNewFile,BufRead *.z8a setf z8a
88
9−+" NIX
9++" Nix
1010+au BufNewFile,BufRead *.nix setf nix
1111+
1212 augroup END
@@ -18,79 +18,3 @@ index a8e6261..2b008fc 100644
1818 unlet s:cpo_save
1919+
2020+
21−diff --git a/runtime/syntax/nix.vim b/runtime/syntax/nix.vim
22−new file mode 100644
23−index 0000000..a2f9918
24−--- /dev/null
25−+++ b/runtime/syntax/nix.vim
26−@@ -0,0 +1,56 @@
27−+" Vim syntax file
28−+" Language: nix
29−+" Maintainer: Marc Weber <marco-oweber@gmx.de>
30−+" Modify and commit if you feel that way
31−+" Last Change: 2011 Jun
32−+"
33−+" this syntax file can be still be enhanced very much..
34−+" Don't ask, do it :-)
35−+" This file (github.com/MarcWeber/vim-addon-nix) is periodically synced with
36−+" the patch found in vim_configurable (nixpkgs)
37−+
38−+" Quit when a (custom) syntax file was already loaded
39−+if exists("b:current_syntax")
40−+ finish
41−+endif
42−+
43−+
44−+sy cluster nixStrings contains=nixStringParam,nixStringIndented
45−+
46−+syn keyword nixKeyword let throw inherit import true false null with
47−+syn keyword nixConditional if else then
48−+syn keyword nixBrace ( ) { } =
49−+syn keyword nixBuiltin __currentSystem __currentTime __isFunction __getEnv __trace __toPath __pathExists
50−+ \ __readFile __toXML __toFile __filterSource __attrNames __getAttr __hasAttr __isAttrs __listToAttrs __isList
51−+ \ __head __tail __add __sub __lessThan __substring __stringLength
52−+
53−+syn region nixStringIndented start=+''+ skip=+'''\|''${\|"+ end=+''+ contains=nixStringParam
54−+" syn region nixString start=+"+ skip=+\\"+ end=+"+
55−+syn match nixAttr "\w\+\ze\s*="
56−+syn match nixFuncArg "\zs\w\+\ze\s*:"
57−+syn region nixStringParam start=+\${+ end=+}+ contains=@nixStrings
58−+syn region nixMultiLineComment start=+/\*+ skip=+\\"+ end=+\*/+
59−+syn match nixEndOfLineComment "#.*$"
60−+
61−+hi def link nixKeyword Keyword
62−+hi def link nixConditional Conditional
63−+hi def link nixBrace Special
64−+hi def link nixString String
65−+hi def link nixStringIndented String
66−+hi def link nixBuiltin Special
67−+hi def link nixStringParam Macro
68−+hi def link nixMultiLineComment Comment
69−+hi def link nixEndOfLineComment Comment
70−+hi def link nixAttr Identifier
71−+hi def link nixFuncArg Identifier
72−+
73−+syn sync maxlines=20000
74−+syn sync minlines=50000
75−+
76−+let b:current_syntax = "nix"
77−+
78−+" thanks to domenkozar
79−+" scan backwards to find begining of multiline statements
80−+syn sync ccomment nixMultiLineComment minlines=10 maxlines=500
81−+syn sync ccomment nixStringIndented minlines=10 maxlines=500
82−+syn sync ccomment nixString maxlines=10
83−diff --git a/runtime/ftplugin/nix.vim b/runtime/ftplugin/nix.vim
84−new file mode 100644
85−--- /dev/null
86−+++ b/runtime/ftplugin/nix.vim
87−@@ -0,0 +1,2 @@
88−+" Only do this when not done yet for this buffer
89−+if exists("b:did_ftplugin")
90−+ finish
91−+endif
92−+let b:did_ftplugin = 1
93−+
94−+" coding conventions
95−+setlocal shiftwidth=2 expandtab softtabstop=2
96−+let b:undo_ftplugin = "setlocal sw< et< sts<"