# Invoked from "scripts.vim" in 'runtimepath'
#
# Maintainer: Bram Moolenaar <Bram@vim.org>
-# Last Change: 2023 May 06
+# Last Change: 2023 Jun 08
export def DetectFiletype()
var line1 = getline(1)
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
elseif name =~ 'guile'
setl ft=scheme
+ # Nix
+ elseif name =~ 'nix-shell'
+ setl ft=nix
+
endif
enddef
expect: [['#!/path/expect']],
gnuplot: [['#!/path/gnuplot']],
make: [['#!/path/make']],
+ nix: [['#!/path/nix-shell']],
pike: [['#!/path/pike'],
['#!/path/pike0'],
['#!/path/pike9']],
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