annotate runtime/scripts.vim @ 26668:f2579ccc97db v8.2.3863

patch 8.2.3863: various build flags accidentally enabled Commit: https://github.com/vim/vim/commit/8d95d7091da08d0a236be4a16616e3dda388e58d Author: Bram Moolenaar <Bram@vim.org> Date: Mon Dec 20 22:12:53 2021 +0000 patch 8.2.3863: various build flags accidentally enabled Problem: Various build flags accidentally enabled. Solution: Revert several lines in Makefile.
author Bram Moolenaar <Bram@vim.org>
date Mon, 20 Dec 2021 23:15:03 +0100
parents ce3678583211
children 733295e9d755
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim support file to detect file types in scripts
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Bram Moolenaar <Bram@vim.org>
23931
5b37a0bf7e3a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 23701
diff changeset
4 " Last change: 2021 Jan 22
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " This file is called by an autocommand for every file that has just been
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " loaded into a buffer. It checks if the type of file can be recognized by
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " the file contents. The autocommand is in $VIMRUNTIME/filetype.vim.
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
9 "
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
10 " Note that the pattern matches are done with =~# to avoid the value of the
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
11 " 'ignorecase' option making a difference. Where case is to be ignored use
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
12 " =~? instead. Do not use =~ anywhere.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 " Only do the rest when the FileType autocommand has not been triggered yet.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 if did_filetype()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 " Load the user defined scripts file first
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 " Only do this when the FileType autocommand has not been triggered yet
279
946f0cbdd535 updated for version 7.0074
vimboss
parents: 179
diff changeset
22 if exists("myscriptsfile") && filereadable(expand(myscriptsfile))
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 execute "source " . myscriptsfile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 if did_filetype()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 " Line continuation is used here, remove 'C' from 'cpoptions'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 let s:cpo_save = &cpo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 set cpo&vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 let s:line1 = getline(1)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
35 if s:line1 =~# "^#!"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 " A script that starts with "#!".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
20756
33a14786a0e4 patch 8.2.0930: script filetype detection trips over env -S argument
Bram Moolenaar <Bram@vim.org>
parents: 19646
diff changeset
38 " Check for a line like "#!/usr/bin/env {options} bash". Turn it into
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 " "#!/usr/bin/bash" to make matching easier.
20756
33a14786a0e4 patch 8.2.0930: script filetype detection trips over env -S argument
Bram Moolenaar <Bram@vim.org>
parents: 19646
diff changeset
40 " Recognize only a few {options} that are commonly used.
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
41 if s:line1 =~# '^#!\s*\S*\<env\s'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 let s:line1 = substitute(s:line1, '\S\+=\S\+', '', 'g')
20756
33a14786a0e4 patch 8.2.0930: script filetype detection trips over env -S argument
Bram Moolenaar <Bram@vim.org>
parents: 19646
diff changeset
43 let s:line1 = substitute(s:line1, '\(-[iS]\|--ignore-environment\|--split-string\)', '', '')
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 let s:line1 = substitute(s:line1, '\<env\s\+', '', '')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 " Get the program name.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 " Only accept spaces in PC style paths: "#!c:/program files/perl [args]".
279
946f0cbdd535 updated for version 7.0074
vimboss
parents: 179
diff changeset
49 " If the word env is used, use the first word after the space:
946f0cbdd535 updated for version 7.0074
vimboss
parents: 179
diff changeset
50 " "#!/usr/bin/env perl [path/args]"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 " If there is no path use the first word: "#!perl [path/args]".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 " Otherwise get the last word after a slash: "#!/usr/bin/perl [path/args]".
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
53 if s:line1 =~# '^#!\s*\a:[/\\]'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 let s:name = substitute(s:line1, '^#!.*[/\\]\(\i\+\).*', '\1', '')
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
55 elseif s:line1 =~# '^#!.*\<env\>'
279
946f0cbdd535 updated for version 7.0074
vimboss
parents: 179
diff changeset
56 let s:name = substitute(s:line1, '^#!.*\<env\>\s\+\(\i\+\).*', '\1', '')
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
57 elseif s:line1 =~# '^#!\s*[^/\\ ]*\>\([^/\\]\|$\)'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 let s:name = substitute(s:line1, '^#!\s*\([^/\\ ]*\>\).*', '\1', '')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 let s:name = substitute(s:line1, '^#!\s*\S*[/\\]\(\i\+\).*', '\1', '')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62
923
b31702c473ae updated for version 7.0-049
vimboss
parents: 816
diff changeset
63 " tcl scripts may have #!/bin/sh in the first line and "exec wish" in the
b31702c473ae updated for version 7.0-049
vimboss
parents: 816
diff changeset
64 " third line. Suggested by Steven Atkinson.
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
65 if getline(3) =~# '^exec wish'
923
b31702c473ae updated for version 7.0-049
vimboss
parents: 816
diff changeset
66 let s:name = 'wish'
b31702c473ae updated for version 7.0-049
vimboss
parents: 816
diff changeset
67 endif
b31702c473ae updated for version 7.0-049
vimboss
parents: 816
diff changeset
68
22
cc049b00ee70 updated for version 7.0014
vimboss
parents: 7
diff changeset
69 " Bourne-like shell scripts: bash bash2 ksh ksh93 sh
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
70 if s:name =~# '^\(bash\d*\|\|ksh\d*\|sh\)\>'
12816
218102da5226 patch 8.0.1285: occasional crash when using a channel
Christian Brabandt <cb@256bit.org>
parents: 12808
diff changeset
71 call dist#ft#SetFileTypeSH(s:line1) " defined in filetype.vim
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 " csh scripts
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
74 elseif s:name =~# '^csh\>'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 if exists("g:filetype_csh")
12816
218102da5226 patch 8.0.1285: occasional crash when using a channel
Christian Brabandt <cb@256bit.org>
parents: 12808
diff changeset
76 call dist#ft#SetFileTypeShell(g:filetype_csh)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 else
12816
218102da5226 patch 8.0.1285: occasional crash when using a channel
Christian Brabandt <cb@256bit.org>
parents: 12808
diff changeset
78 call dist#ft#SetFileTypeShell("csh")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 " tcsh scripts
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
82 elseif s:name =~# '^tcsh\>'
12816
218102da5226 patch 8.0.1285: occasional crash when using a channel
Christian Brabandt <cb@256bit.org>
parents: 12808
diff changeset
83 call dist#ft#SetFileTypeShell("tcsh")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 " Z shell scripts
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
86 elseif s:name =~# '^zsh\>'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 set ft=zsh
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 " TCL scripts
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
90 elseif s:name =~# '^\(tclsh\|wish\|expectk\|itclsh\|itkwish\)\>'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 set ft=tcl
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 " Expect scripts
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
94 elseif s:name =~# '^expect\>'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 set ft=expect
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 " Gnuplot scripts
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
98 elseif s:name =~# '^gnuplot\>'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 set ft=gnuplot
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 " Makefiles
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
102 elseif s:name =~# 'make\>'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 set ft=make
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104
13125
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12816
diff changeset
105 " Pike
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12816
diff changeset
106 elseif s:name =~# '^pike\%(\>\|[0-9]\)'
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12816
diff changeset
107 set ft=pike
371ceeebbdaa Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 12816
diff changeset
108
279
946f0cbdd535 updated for version 7.0074
vimboss
parents: 179
diff changeset
109 " Lua
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
110 elseif s:name =~# 'lua'
279
946f0cbdd535 updated for version 7.0074
vimboss
parents: 179
diff changeset
111 set ft=lua
946f0cbdd535 updated for version 7.0074
vimboss
parents: 179
diff changeset
112
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 " Perl
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
114 elseif s:name =~# 'perl'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 set ft=perl
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 " PHP
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
118 elseif s:name =~# 'php'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 set ft=php
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 " Python
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
122 elseif s:name =~# 'python'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 set ft=python
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 " Groovy
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
126 elseif s:name =~# '^groovy\>'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 set ft=groovy
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128
24500
54b6455e637c patch 8.2.2790: filetype test fails
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
129 " Raku
54b6455e637c patch 8.2.2790: filetype test fails
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
130 elseif s:name =~# 'raku'
54b6455e637c patch 8.2.2790: filetype test fails
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
131 set ft=raku
54b6455e637c patch 8.2.2790: filetype test fails
Bram Moolenaar <Bram@vim.org>
parents: 23931
diff changeset
132
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 " Ruby
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
134 elseif s:name =~# 'ruby'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 set ft=ruby
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136
11062
1218c5353e2b Runtime file updates.
Christian Brabandt <cb@256bit.org>
parents: 9116
diff changeset
137 " JavaScript
13182
181ddaf5e467 patch 8.0.1465: python2 and python3 detection not tested
Christian Brabandt <cb@256bit.org>
parents: 13166
diff changeset
138 elseif s:name =~# 'node\(js\)\=\>\|js\>' || s:name =~# 'rhino\>'
11062
1218c5353e2b Runtime file updates.
Christian Brabandt <cb@256bit.org>
parents: 9116
diff changeset
139 set ft=javascript
1218c5353e2b Runtime file updates.
Christian Brabandt <cb@256bit.org>
parents: 9116
diff changeset
140
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 " BC calculator
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
142 elseif s:name =~# '^bc\>'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 set ft=bc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 " sed
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
146 elseif s:name =~# 'sed\>'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 set ft=sed
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 " OCaml-scripts
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
150 elseif s:name =~# 'ocaml'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 set ft=ocaml
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152
21825
0db0640e16e0 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 20756
diff changeset
153 " Awk scripts; also finds "gawk"
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
154 elseif s:name =~# 'awk\>'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 set ft=awk
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 " Website MetaLanguage
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
158 elseif s:name =~# 'wml'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 set ft=wml
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 " Scheme scripts
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
162 elseif s:name =~# 'scheme'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163 set ft=scheme
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164
556
f9eaf0a9872d updated for version 7.0157
vimboss
parents: 531
diff changeset
165 " CFEngine scripts
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
166 elseif s:name =~# 'cfengine'
556
f9eaf0a9872d updated for version 7.0157
vimboss
parents: 531
diff changeset
167 set ft=cfengine
f9eaf0a9872d updated for version 7.0157
vimboss
parents: 531
diff changeset
168
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4681
diff changeset
169 " Erlang scripts
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
170 elseif s:name =~# 'escript'
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4681
diff changeset
171 set ft=erlang
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4681
diff changeset
172
11062
1218c5353e2b Runtime file updates.
Christian Brabandt <cb@256bit.org>
parents: 9116
diff changeset
173 " Haskell
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
174 elseif s:name =~# 'haskell'
11062
1218c5353e2b Runtime file updates.
Christian Brabandt <cb@256bit.org>
parents: 9116
diff changeset
175 set ft=haskell
1218c5353e2b Runtime file updates.
Christian Brabandt <cb@256bit.org>
parents: 9116
diff changeset
176
1218c5353e2b Runtime file updates.
Christian Brabandt <cb@256bit.org>
parents: 9116
diff changeset
177 " Scala
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
178 elseif s:name =~# 'scala\>'
11062
1218c5353e2b Runtime file updates.
Christian Brabandt <cb@256bit.org>
parents: 9116
diff changeset
179 set ft=scala
1218c5353e2b Runtime file updates.
Christian Brabandt <cb@256bit.org>
parents: 9116
diff changeset
180
13166
b009ab2c1a8f patch 8.0.1457: clojure now supports a shebang line
Christian Brabandt <cb@256bit.org>
parents: 13125
diff changeset
181 " Clojure
b009ab2c1a8f patch 8.0.1457: clojure now supports a shebang line
Christian Brabandt <cb@256bit.org>
parents: 13125
diff changeset
182 elseif s:name =~# 'clojure'
b009ab2c1a8f patch 8.0.1457: clojure now supports a shebang line
Christian Brabandt <cb@256bit.org>
parents: 13125
diff changeset
183 set ft=clojure
b009ab2c1a8f patch 8.0.1457: clojure now supports a shebang line
Christian Brabandt <cb@256bit.org>
parents: 13125
diff changeset
184
23584
397f95f103e8 patch 8.2.2334: Pascal-like filetypes not always detected
Bram Moolenaar <Bram@vim.org>
parents: 21825
diff changeset
185 " Free Pascal
397f95f103e8 patch 8.2.2334: Pascal-like filetypes not always detected
Bram Moolenaar <Bram@vim.org>
parents: 21825
diff changeset
186 elseif s:name =~# 'instantfpc\>'
397f95f103e8 patch 8.2.2334: Pascal-like filetypes not always detected
Bram Moolenaar <Bram@vim.org>
parents: 21825
diff changeset
187 set ft=pascal
397f95f103e8 patch 8.2.2334: Pascal-like filetypes not always detected
Bram Moolenaar <Bram@vim.org>
parents: 21825
diff changeset
188
23701
c5b5e7520fe2 patch 8.2.2392: fennel filetype not recognized
Bram Moolenaar <Bram@vim.org>
parents: 23584
diff changeset
189 " Fennel
c5b5e7520fe2 patch 8.2.2392: fennel filetype not recognized
Bram Moolenaar <Bram@vim.org>
parents: 23584
diff changeset
190 elseif s:name =~# 'fennel\>'
c5b5e7520fe2 patch 8.2.2392: fennel filetype not recognized
Bram Moolenaar <Bram@vim.org>
parents: 23584
diff changeset
191 set ft=fennel
c5b5e7520fe2 patch 8.2.2392: fennel filetype not recognized
Bram Moolenaar <Bram@vim.org>
parents: 23584
diff changeset
192
26135
7922e1972d58 patch 8.2.3600: filetype test fails
Bram Moolenaar <Bram@vim.org>
parents: 24500
diff changeset
193 " MikroTik RouterOS script
7922e1972d58 patch 8.2.3600: filetype test fails
Bram Moolenaar <Bram@vim.org>
parents: 24500
diff changeset
194 elseif s:name =~# 'rsc\>'
7922e1972d58 patch 8.2.3600: filetype test fails
Bram Moolenaar <Bram@vim.org>
parents: 24500
diff changeset
195 set ft=routeros
7922e1972d58 patch 8.2.3600: filetype test fails
Bram Moolenaar <Bram@vim.org>
parents: 24500
diff changeset
196
26141
77ad8ea01c00 patch 8.2.3603: fish filetype not recognized
Bram Moolenaar <Bram@vim.org>
parents: 26135
diff changeset
197 " Fish shell
77ad8ea01c00 patch 8.2.3603: fish filetype not recognized
Bram Moolenaar <Bram@vim.org>
parents: 26135
diff changeset
198 elseif s:name =~# 'fish\>'
77ad8ea01c00 patch 8.2.3603: fish filetype not recognized
Bram Moolenaar <Bram@vim.org>
parents: 26135
diff changeset
199 set ft=fish
77ad8ea01c00 patch 8.2.3603: fish filetype not recognized
Bram Moolenaar <Bram@vim.org>
parents: 26135
diff changeset
200
26311
ce3678583211 patch 8.2.3686: filetype detection often mixes up Forth and F#
Bram Moolenaar <Bram@vim.org>
parents: 26141
diff changeset
201 " Gforth
ce3678583211 patch 8.2.3686: filetype detection often mixes up Forth and F#
Bram Moolenaar <Bram@vim.org>
parents: 26141
diff changeset
202 elseif s:name =~# 'gforth\>'
ce3678583211 patch 8.2.3686: filetype detection often mixes up Forth and F#
Bram Moolenaar <Bram@vim.org>
parents: 26141
diff changeset
203 set ft=forth
ce3678583211 patch 8.2.3686: filetype detection often mixes up Forth and F#
Bram Moolenaar <Bram@vim.org>
parents: 26141
diff changeset
204
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
205 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206 unlet s:name
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209 " File does not start with "#!".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211 let s:line2 = getline(2)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212 let s:line3 = getline(3)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213 let s:line4 = getline(4)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
214 let s:line5 = getline(5)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216 " Bourne-like shell scripts: sh ksh bash bash2
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
217 if s:line1 =~# '^:$'
12816
218102da5226 patch 8.0.1285: occasional crash when using a channel
Christian Brabandt <cb@256bit.org>
parents: 12808
diff changeset
218 call dist#ft#SetFileTypeSH(s:line1) " defined in filetype.vim
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219
17188
93cb37b45636 patch 8.1.1593: filetype not detected for C++ header files without extension
Bram Moolenaar <Bram@vim.org>
parents: 13341
diff changeset
220 " Z shell scripts
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
221 elseif s:line1 =~# '^#compdef\>' || s:line1 =~# '^#autoload\>' ||
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
222 \ "\n".s:line1."\n".s:line2."\n".s:line3."\n".s:line4."\n".s:line5 =~# '\n\s*emulate\s\+\%(-[LR]\s\+\)\=[ckz]\=sh\>'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
223 set ft=zsh
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
224
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
225 " ELM Mail files
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
226 elseif s:line1 =~# '^From \([a-zA-Z][a-zA-Z_0-9\.=-]*\(@[^ ]*\)\=\|-\) .* \(19\|20\)\d\d$'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
227 set ft=mail
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
228
17188
93cb37b45636 patch 8.1.1593: filetype not detected for C++ header files without extension
Bram Moolenaar <Bram@vim.org>
parents: 13341
diff changeset
229 " Mason
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
230 elseif s:line1 =~# '^<[%&].*>'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
231 set ft=mason
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
232
17188
93cb37b45636 patch 8.1.1593: filetype not detected for C++ header files without extension
Bram Moolenaar <Bram@vim.org>
parents: 13341
diff changeset
233 " Vim scripts (must have '" vim' as the first line to trigger this)
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
234 elseif s:line1 =~# '^" *[vV]im$'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
235 set ft=vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
236
17188
93cb37b45636 patch 8.1.1593: filetype not detected for C++ header files without extension
Bram Moolenaar <Bram@vim.org>
parents: 13341
diff changeset
237 " libcxx and libstdc++ standard library headers like "iostream" do not have
93cb37b45636 patch 8.1.1593: filetype not detected for C++ header files without extension
Bram Moolenaar <Bram@vim.org>
parents: 13341
diff changeset
238 " an extension, recognize the Emacs file mode.
93cb37b45636 patch 8.1.1593: filetype not detected for C++ header files without extension
Bram Moolenaar <Bram@vim.org>
parents: 13341
diff changeset
239 elseif s:line1 =~? '-\*-.*C++.*-\*-'
93cb37b45636 patch 8.1.1593: filetype not detected for C++ header files without extension
Bram Moolenaar <Bram@vim.org>
parents: 13341
diff changeset
240 set ft=cpp
93cb37b45636 patch 8.1.1593: filetype not detected for C++ header files without extension
Bram Moolenaar <Bram@vim.org>
parents: 13341
diff changeset
241
93cb37b45636 patch 8.1.1593: filetype not detected for C++ header files without extension
Bram Moolenaar <Bram@vim.org>
parents: 13341
diff changeset
242 " MOO
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
243 elseif s:line1 =~# '^\*\* LambdaMOO Database, Format Version \%([1-3]\>\)\@!\d\+ \*\*$'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
244 set ft=moo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
245
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
246 " Diff file:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
247 " - "diff" in first line (context diff)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
248 " - "Only in " in first line
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
249 " - "--- " in first line and "+++ " in second line (unified diff).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
250 " - "*** " in first line and "--- " in second line (context diff).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
251 " - "# It was generated by makepatch " in the second line (makepatch diff).
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
252 " - "Index: <filename>" in the first line (CVS file)
809
4f1b94b51e99 updated for version 7.0b02
vimboss
parents: 807
diff changeset
253 " - "=== ", line of "=", "---", "+++ " (SVK diff)
816
4a79d6d376f0 updated for version 7.0c02
vimboss
parents: 809
diff changeset
254 " - "=== ", "--- ", "+++ " (bzr diff, common case)
4a79d6d376f0 updated for version 7.0c02
vimboss
parents: 809
diff changeset
255 " - "=== (removed|added|renamed|modified)" (bzr diff, alternative)
3830
04592728474a Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2596
diff changeset
256 " - "# HG changeset patch" in first line (Mercurial export format)
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
257 elseif s:line1 =~# '^\(diff\>\|Only in \|\d\+\(,\d\+\)\=[cda]\d\+\>\|# It was generated by makepatch \|Index:\s\+\f\+\r\=$\|===== \f\+ \d\+\.\d\+ vs edited\|==== //\f\+#\d\+\|# HG changeset patch\)'
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
258 \ || (s:line1 =~# '^--- ' && s:line2 =~# '^+++ ')
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
259 \ || (s:line1 =~# '^\* looking for ' && s:line2 =~# '^\* comparing to ')
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
260 \ || (s:line1 =~# '^\*\*\* ' && s:line2 =~# '^--- ')
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
261 \ || (s:line1 =~# '^=== ' && ((s:line2 =~# '^=\{66\}' && s:line3 =~# '^--- ' && s:line4 =~# '^+++') || (s:line2 =~# '^--- ' && s:line3 =~# '^+++ ')))
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
262 \ || (s:line1 =~# '^=== \(removed\|added\|renamed\|modified\)')
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
263 set ft=diff
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
264
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
265 " PostScript Files (must have %!PS as the first line, like a2ps output)
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
266 elseif s:line1 =~# '^%![ \t]*PS'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
267 set ft=postscr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
268
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
269 " M4 scripts: Guess there is a line that starts with "dnl".
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
270 elseif s:line1 =~# '^\s*dnl\>'
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
271 \ || s:line2 =~# '^\s*dnl\>'
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
272 \ || s:line3 =~# '^\s*dnl\>'
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
273 \ || s:line4 =~# '^\s*dnl\>'
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
274 \ || s:line5 =~# '^\s*dnl\>'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
275 set ft=m4
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
276
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
277 " AmigaDos scripts
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
278 elseif $TERM == "amiga"
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
279 \ && (s:line1 =~# "^;" || s:line1 =~? '^\.bra')
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
280 set ft=amiga
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
281
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
282 " SiCAD scripts (must have procn or procd as the first line to trigger this)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
283 elseif s:line1 =~? '^ *proc[nd] *$'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
284 set ft=sicad
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
285
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
286 " Purify log files start with "**** Purify"
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
287 elseif s:line1 =~# '^\*\*\*\* Purify'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
288 set ft=purifylog
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
289
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
290 " XML
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
291 elseif s:line1 =~# '<?\s*xml.*?>'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
292 set ft=xml
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
293
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
294 " XHTML (e.g.: PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN")
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
295 elseif s:line1 =~# '\<DTD\s\+XHTML\s'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
296 set ft=xhtml
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
297
1708
33d28f1c4d1d updated for version 7.2-006
vimboss
parents: 1702
diff changeset
298 " HTML (e.g.: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN")
9116
bc38030aec7d commit https://github.com/vim/vim/commit/26852128a2b713ef49341a0c18daba928444e7eb
Christian Brabandt <cb@256bit.org>
parents: 6180
diff changeset
299 " Avoid "doctype html", used by slim.
bc38030aec7d commit https://github.com/vim/vim/commit/26852128a2b713ef49341a0c18daba928444e7eb
Christian Brabandt <cb@256bit.org>
parents: 6180
diff changeset
300 elseif s:line1 =~? '<!DOCTYPE\s\+html\>'
1708
33d28f1c4d1d updated for version 7.2-006
vimboss
parents: 1702
diff changeset
301 set ft=html
33d28f1c4d1d updated for version 7.2-006
vimboss
parents: 1702
diff changeset
302
1648
58cad056e608 updated for version 7.2a-00
vimboss
parents: 1145
diff changeset
303 " PDF
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
304 elseif s:line1 =~# '^%PDF-'
1648
58cad056e608 updated for version 7.2a-00
vimboss
parents: 1145
diff changeset
305 set ft=pdf
58cad056e608 updated for version 7.2a-00
vimboss
parents: 1145
diff changeset
306
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
307 " XXD output
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
308 elseif s:line1 =~# '^\x\{7}: \x\{2} \=\x\{2} \=\x\{2} \=\x\{2} '
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
309 set ft=xxd
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
310
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
311 " RCS/CVS log output
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
312 elseif s:line1 =~# '^RCS file:' || s:line2 =~# '^RCS file:'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
313 set ft=rcslog
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
314
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
315 " CVS commit
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
316 elseif s:line2 =~# '^CVS:' || getline("$") =~# '^CVS: '
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
317 set ft=cvs
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
318
179
7fd70926e2e1 updated for version 7.0055
vimboss
parents: 26
diff changeset
319 " Prescribe
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
320 elseif s:line1 =~# '^!R!'
179
7fd70926e2e1 updated for version 7.0055
vimboss
parents: 26
diff changeset
321 set ft=prescribe
7fd70926e2e1 updated for version 7.0055
vimboss
parents: 26
diff changeset
322
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
323 " Send-pr
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
324 elseif s:line1 =~# '^SEND-PR:'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
325 set ft=sendpr
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
326
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
327 " SNNS files
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
328 elseif s:line1 =~# '^SNNS network definition file'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
329 set ft=snnsnet
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
330 elseif s:line1 =~# '^SNNS pattern definition file'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
331 set ft=snnspat
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
332 elseif s:line1 =~# '^SNNS result file'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
333 set ft=snnsres
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
334
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
335 " Virata
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
336 elseif s:line1 =~# '^%.\{-}[Vv]irata'
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
337 \ || s:line2 =~# '^%.\{-}[Vv]irata'
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
338 \ || s:line3 =~# '^%.\{-}[Vv]irata'
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
339 \ || s:line4 =~# '^%.\{-}[Vv]irata'
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
340 \ || s:line5 =~# '^%.\{-}[Vv]irata'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
341 set ft=virata
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
342
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
343 " Strace
12254
8d76a56861ec Update runtime files
Christian Brabandt <cb@256bit.org>
parents: 11504
diff changeset
344 elseif s:line1 =~# '[0-9:.]* *execve(' || s:line1 =~# '^__libc_start_main'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
345 set ft=strace
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
346
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
347 " VSE JCL
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
348 elseif s:line1 =~# '^\* $$ JOB\>' || s:line1 =~# '^// *JOB\>'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
349 set ft=vsejcl
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
350
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
351 " TAK and SINDA
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
352 elseif s:line4 =~# 'K & K Associates' || s:line2 =~# 'TAK 2000'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
353 set ft=takout
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
354 elseif s:line3 =~# 'S Y S T E M S I M P R O V E D '
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
355 set ft=sindaout
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
356 elseif getline(6) =~# 'Run Date: '
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
357 set ft=takcmp
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
358 elseif getline(9) =~# 'Node File 1'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
359 set ft=sindacmp
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
360
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
361 " DNS zone files
12756
3b26420fc639 Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents: 12254
diff changeset
362 elseif s:line1.s:line2.s:line3.s:line4 =~# '^; <<>> DiG [0-9.]\+.* <<>>\|$ORIGIN\|$TTL\|IN\s\+SOA'
807
8d284e3d8112 updated for version 7.0b01
vimboss
parents: 651
diff changeset
363 set ft=bindzone
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
364
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
365 " BAAN
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
366 elseif s:line1 =~# '|\*\{1,80}' && s:line2 =~# 'VRC '
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
367 \ || s:line2 =~# '|\*\{1,80}' && s:line3 =~# 'VRC '
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
368 set ft=baan
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
369
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
370 " Valgrind
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
371 elseif s:line1 =~# '^==\d\+== valgrind' || s:line3 =~# '^==\d\+== Using valgrind'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
372 set ft=valgrind
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
373
6180
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4780
diff changeset
374 " Go docs
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
375 elseif s:line1 =~# '^PACKAGE DOCUMENTATION$'
6180
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4780
diff changeset
376 set ft=godoc
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4780
diff changeset
377
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
378 " Renderman Interface Bytestream
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
379 elseif s:line1 =~# '^##RenderMan'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
380 set ft=rib
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
381
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
382 " Scheme scripts
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
383 elseif s:line1 =~# 'exec\s\+\S*scheme' || s:line2 =~# 'exec\s\+\S*scheme'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
384 set ft=scheme
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
385
1648
58cad056e608 updated for version 7.2a-00
vimboss
parents: 1145
diff changeset
386 " Git output
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
387 elseif s:line1 =~# '^\(commit\|tree\|object\) \x\{40\}\>\|^tag \S\+$'
1648
58cad056e608 updated for version 7.2a-00
vimboss
parents: 1145
diff changeset
388 set ft=git
58cad056e608 updated for version 7.2a-00
vimboss
parents: 1145
diff changeset
389
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
390 " Gprof (gnu profiler)
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
391 elseif s:line1 == 'Flat profile:'
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
392 \ && s:line2 == ''
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
393 \ && s:line3 =~# '^Each sample counts as .* seconds.$'
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
394 set ft=gprof
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3830
diff changeset
395
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4681
diff changeset
396 " Erlang terms
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4681
diff changeset
397 " (See also: http://www.gnu.org/software/emacs/manual/html_node/emacs/Choosing-Modes.html#Choosing-Modes)
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4681
diff changeset
398 elseif s:line1 =~? '-\*-.*erlang.*-\*-'
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4681
diff changeset
399 set ft=erlang
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4681
diff changeset
400
19607
d24e6844aabd patch 8.2.0360: yaml files are only recognized by the file extension
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
401 " YAML
d24e6844aabd patch 8.2.0360: yaml files are only recognized by the file extension
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
402 elseif s:line1 =~# '^%YAML'
d24e6844aabd patch 8.2.0360: yaml files are only recognized by the file extension
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
403 set ft=yaml
d24e6844aabd patch 8.2.0360: yaml files are only recognized by the file extension
Bram Moolenaar <Bram@vim.org>
parents: 17261
diff changeset
404
26135
7922e1972d58 patch 8.2.3600: filetype test fails
Bram Moolenaar <Bram@vim.org>
parents: 24500
diff changeset
405 " MikroTik RouterOS script
7922e1972d58 patch 8.2.3600: filetype test fails
Bram Moolenaar <Bram@vim.org>
parents: 24500
diff changeset
406 elseif s:line1 =~# '^#.*by RouterOS.*$'
7922e1972d58 patch 8.2.3600: filetype test fails
Bram Moolenaar <Bram@vim.org>
parents: 24500
diff changeset
407 set ft=routeros
7922e1972d58 patch 8.2.3600: filetype test fails
Bram Moolenaar <Bram@vim.org>
parents: 24500
diff changeset
408
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
409 " CVS diff
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
410 else
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1708
diff changeset
411 let s:lnum = 1
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
412 while getline(s:lnum) =~# "^? " && s:lnum < line("$")
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1708
diff changeset
413 let s:lnum += 1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
414 endwhile
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
415 if getline(s:lnum) =~# '^Index:\s\+\f\+$'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
416 set ft=diff
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
417
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
418 " locale input files: Formal Definitions of Cultural Conventions
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
419 " filename must be like en_US, fr_FR@euro or en_US.UTF-8
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
420 elseif expand("%") =~# '\a\a_\a\a\($\|[.@]\)\|i18n$\|POSIX$\|translit_'
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1708
diff changeset
421 let s:lnum = 1
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1708
diff changeset
422 while s:lnum < 100 && s:lnum < line("$")
11504
a58229e3aff6 patch 8.0.0635: when 'ignorecase' is set script detection is inaccurate
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
423 if getline(s:lnum) =~# '^LC_\(IDENTIFICATION\|CTYPE\|COLLATE\|MONETARY\|NUMERIC\|TIME\|MESSAGES\|PAPER\|TELEPHONE\|MEASUREMENT\|NAME\|ADDRESS\)$'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
424 setf fdcc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
425 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
426 endif
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1708
diff changeset
427 let s:lnum += 1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
428 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
429 endif
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1708
diff changeset
430 unlet s:lnum
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
431
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
432 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
433
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
434 unlet s:line2 s:line3 s:line4 s:line5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
435
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
436 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
437
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
438 " Restore 'cpoptions'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
439 let &cpo = s:cpo_save
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
440
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
441 unlet s:cpo_save s:line1