From 716bebad486a4364ae5383f7c25aa9919f15143a Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 6 Mar 2020 19:04:42 -0500 Subject: vim-patch:8.2.0360: yaml files are only recognized by the file extension Problem: Yaml files are only recognized by the file extension. Solution: Check for a line starting with "%YAML". (Jason Franklin) https://github.com/vim/vim/commit/8eab73132838e977092d7b46f70b4ecf6274fd6a --- runtime/scripts.vim | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'runtime/scripts.vim') diff --git a/runtime/scripts.vim b/runtime/scripts.vim index a690431014..c552f0202f 100644 --- a/runtime/scripts.vim +++ b/runtime/scripts.vim @@ -376,6 +376,10 @@ else elseif s:line1 =~? '-\*-.*erlang.*-\*-' set ft=erlang + " YAML + elseif s:line1 =~# '^%YAML' + set ft=yaml + " CVS diff else let s:lnum = 1 -- cgit From 9d565c5ba3866fd5e754daef26f2937ed8193836 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 7 Jun 2020 18:56:28 -0400 Subject: vim-patch:8.2.0930: script filetype detection trips over env -S argument Problem: Script filetype detection trips over env -S argument. Solution: Remove "-S" and "--ignore-environment". (closes vim/vim#5013) Add tests. https://github.com/vim/vim/commit/b5e18f29fac9253b0ccf1fde5e74bff72fa1ba60 --- runtime/scripts.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'runtime/scripts.vim') 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*\