diff --git a/runtime/scripts.vim b/runtime/scripts.vim index c552f0202f..6aae2b1ec3 100644 --- a/runtime/scripts.vim +++ b/runtime/scripts.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types in scripts " " Maintainer: Bram Moolenaar -" Last change: 2019 Jun 25 +" Last change: 2020 Jun 07 " This file is called by an autocommand for every file that has just been " loaded into a buffer. It checks if the type of file can be recognized by @@ -35,10 +35,12 @@ let s:line1 = getline(1) if s:line1 =~# "^#!" " A script that starts with "#!". - " Check for a line like "#!/usr/bin/env VAR=val bash". Turn it into + " Check for a line like "#!/usr/bin/env {options} bash". Turn it into " "#!/usr/bin/bash" to make matching easier. + " Recognize only a few {options} that are commonly used. if s:line1 =~# '^#!\s*\S*\\\"\", 'tx') call assert_equal('"setfiletype java javacc javascript javascriptreact', @:)