<commit_before>diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index a8e6261..2b008fc 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -2258,6 +2258,9 @@ au BufNewFile,BufRead *.zsql			call s:SQL()
 " Z80 assembler asz80
 au BufNewFile,BufRead *.z8a			setf z8a
 
+" NIX
+au BufNewFile,BufRead *.nix		setf nix
+
 augroup END
 
 
@@ -2440,3 +2443,5 @@ endfunc
 " Restore 'cpoptions'
 let &cpo = s:cpo_save
 unlet s:cpo_save
+
+
diff --git a/runtime/syntax/nix.vim b/runtime/syntax/nix.vim
new file mode 100644
index 0000000..a2f9918
--- /dev/null
+++ b/runtime/syntax/nix.vim
@@ -0,0 +1,42 @@
+" Vim syntax file
+" Language:	nix
+" Maintainer:	<NAME> <<EMAIL>>
+"               Modify and commit if you feel that way
+" Last Change:	2007 Dec
+"
+" this syntax file can be still be enhanced very much..
+" Don't ask, do it :-)
+
+" Quit when a (custom) syntax file was already loaded
+if exists("b:current_syntax")
+  finish
+endif
+
+syn keyword	nixKeyword	let in rec assert inherit import true false null with ...
+syn keyword	nixBuiltin	import abort baseNameOf dirOf isNull builtins map removeAttrs throw toString derivation
+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 "[a-zA-Z0-9-_]\+\ze\s*="
+syn match nixFuncArg "\zs[a-zA-Z0-9-_]\+\ze\s*:"
+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
+
+hi def link nixKeyword       Keyword
+hi def link nixBuiltin       Function
+hi def link nixConditional   Conditional
+hi def link nixBrace         Special
+hi def link nixString        String
+hi def link nixStringIndented String
+hi def link nixBuiltin       Special
+hi def link nixStringParam   Macro
+hi def link nixMultiLineComment Comment
+hi def link nixEndOfLineComment Comment
+hi def link nixAttr        Identifier
+hi def link nixFuncArg     Identifier
+
+let b:current_syntax = "nix"<commit_msg>vim ft: address the problem with broken highlighting in big files<commit_after>diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index a8e6261..2b008fc 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -2258,6 +2258,9 @@ au BufNewFile,BufRead *.zsql			call s:SQL()
 " Z80 assembler asz80
 au BufNewFile,BufRead *.z8a			setf z8a
 
+" NIX
+au BufNewFile,BufRead *.nix		setf nix
+
 augroup END
 
 
@@ -2440,3 +2443,5 @@ endfunc
 " Restore 'cpoptions'
 let &cpo = s:cpo_save
 unlet s:cpo_save
+
+
diff --git a/runtime/syntax/nix.vim b/runtime/syntax/nix.vim
new file mode 100644
index 0000000..a2f9918
--- /dev/null
+++ b/runtime/syntax/nix.vim
@@ -0,0 +1,47 @@
+" Vim syntax file
+" Language:	nix
+" Maintainer:	<NAME> <<EMAIL>>
+"               Modify and commit if you feel that way
+" Last Change:	2007 Dec
+"
+" this syntax file can be still be enhanced very much..
+" Don't ask, do it :-)
+
+" Quit when a (custom) syntax file was already loaded
+if exists("b:current_syntax")
+  finish
+endif
+
+syn keyword	nixKeyword	let in rec assert inherit import true false null with ...
+syn keyword	nixBuiltin	import abort baseNameOf dirOf isNull builtins map removeAttrs throw toString derivation
+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 "[a-zA-Z0-9-_]\+\ze\s*="
+syn match nixFuncArg "\zs[a-zA-Z0-9-_]\+\ze\s*:"
+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
+
+hi def link nixKeyword       Keyword
+hi def link nixBuiltin       Function
+hi def link nixConditional   Conditional
+hi def link nixBrace         Special
+hi def link nixString        String
+hi def link nixStringIndented String
+hi def link nixBuiltin       Special
+hi def link nixStringParam   Macro
+hi def link nixMultiLineComment Comment
+hi def link nixEndOfLineComment Comment
+hi def link nixAttr        Identifier
+hi def link nixFuncArg     Identifier
+
+let b:current_syntax = "nix"
+
+" scan backwards to find begining of multiline statements
+syn sync ccomment nixMultiLineComment minlines=10 maxlines=500
+syn sync ccomment nixStringIndented minlines=10 maxlines=500
+syn sync ccomment nixString maxlines=10
{'fraction_non_alphanumeric': 0.11455938697318008, 'fraction_numerical': 0.029885057471264367, 'mean_word_length': 3.9723809523809526, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2974359', 'n_tokens_mistral': 1959, 'n_tokens_neox': 1780, 'n_words': 564}