diff --git a/runtime/autoload/dist/script.vim b/runtime/autoload/dist/script.vim index b55fab354f..0079f4b4e2 100644 --- a/runtime/autoload/dist/script.vim +++ b/runtime/autoload/dist/script.vim @@ -4,7 +4,7 @@ vim9script # Invoked from "scripts.vim" in 'runtimepath' # # Maintainer: Bram Moolenaar -# Last Change: 2023 May 06 +# Last Change: 2023 Jun 08 export def DetectFiletype() var line1 = getline(1) @@ -44,7 +44,7 @@ def DetectFromHashBang(firstline: string) elseif line1 =~ '^#!\s*[^/\\ ]*\>\([^/\\]\|$\)' name = substitute(line1, '^#!\s*\([^/\\ ]*\>\).*', '\1', '') else - name = substitute(line1, '^#!\s*\S*[/\\]\(\i\+\).*', '\1', '') + name = substitute(line1, '^#!\s*\S*[/\\]\(\f\+\).*', '\1', '') endif # tcl scripts may have #!/bin/sh in the first line and "exec wish" in the @@ -197,6 +197,10 @@ def DetectFromHashBang(firstline: string) elseif name =~ 'guile' setl ft=scheme + # Nix + elseif name =~ 'nix-shell' + setl ft=nix + endif enddef diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim index d5e003848a..ae76969a5a 100644 --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -852,6 +852,7 @@ def s:GetScriptChecks(): dict>> expect: [['#!/path/expect']], gnuplot: [['#!/path/gnuplot']], make: [['#!/path/make']], + nix: [['#!/path/nix-shell']], pike: [['#!/path/pike'], ['#!/path/pike0'], ['#!/path/pike9']], @@ -902,6 +903,7 @@ def s:GetScriptEnvChecks(): dict>> scheme: [['#!/usr/bin/env VAR=val --ignore-environment scheme']], python: [['#!/usr/bin/env VAR=val -S python -w -T']], wml: [['#!/usr/bin/env VAR=val --split-string wml']], + nix: [['#!/usr/bin/env nix-shell']], } enddef diff --git a/src/version.c b/src/version.c index 90331ed8e2..bad9e5428c 100644 --- a/src/version.c +++ b/src/version.c @@ -695,6 +695,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1620, /**/ 1619, /**/