Mercurial > vim
annotate runtime/filetype.vim @ 10930:126405b39964 v8.0.0354
patch 8.0.0354: test to check that setting termcap key fails sometimes
commit https://github.com/vim/vim/commit/1c410400fad79068b16dc4c6c7a023463a0858cf
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Feb 23 15:20:03 2017 +0100
patch 8.0.0354: test to check that setting termcap key fails sometimes
Problem: Test to check that setting termcap key fails sometimes.
Solution: Check for "t_k1" to exist. (Christian Brabandt, closes https://github.com/vim/vim/issues/1459)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 23 Feb 2017 15:30:05 +0100 |
parents | 9a75c8a1b8b1 |
children | 1218c5353e2b |
rev | line source |
---|---|
7 | 1 " Vim support file to detect file types |
2 " | |
3 " Maintainer: Bram Moolenaar <Bram@vim.org> | |
10548
74effdaa369e
Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents:
10348
diff
changeset
|
4 " Last Change: 2017 Jan 06 |
7 | 5 |
6 " Listen very carefully, I will say this only once | |
7 if exists("did_load_filetypes") | |
8 finish | |
9 endif | |
10 let did_load_filetypes = 1 | |
11 | |
12 " Line continuation is used here, remove 'C' from 'cpoptions' | |
13 let s:cpo_save = &cpo | |
14 set cpo&vim | |
15 | |
16 augroup filetypedetect | |
17 | |
18 " Ignored extensions | |
1586 | 19 if exists("*fnameescape") |
9041
34c45ee4210d
commit https://github.com/vim/vim/commit/06481427005a9dae39721087df94855f7d4d1feb
Christian Brabandt <cb@256bit.org>
parents:
7301
diff
changeset
|
20 au BufNewFile,BufRead ?\+.orig,?\+.bak,?\+.old,?\+.new,?\+.dpkg-dist,?\+.dpkg-old,?\+.dpkg-new,?\+.dpkg-bak,?\+.rpmsave,?\+.rpmnew,?\+.pacsave,?\+.pacnew |
1586 | 21 \ exe "doau filetypedetect BufRead " . fnameescape(expand("<afile>:r")) |
7 | 22 au BufNewFile,BufRead *~ |
23 \ let s:name = expand("<afile>") | | |
24 \ let s:short = substitute(s:name, '\~$', '', '') | | |
25 \ if s:name != s:short && s:short != "" | | |
1586 | 26 \ exe "doau filetypedetect BufRead " . fnameescape(s:short) | |
7 | 27 \ endif | |
1698 | 28 \ unlet! s:name s:short |
532 | 29 au BufNewFile,BufRead ?\+.in |
7 | 30 \ if expand("<afile>:t") != "configure.in" | |
1586 | 31 \ exe "doau filetypedetect BufRead " . fnameescape(expand("<afile>:r")) | |
7 | 32 \ endif |
1586 | 33 elseif &verbose > 0 |
34 echomsg "Warning: some filetypes will not be recognized because this version of Vim does not have fnameescape()" | |
35 endif | |
7 | 36 |
37 " Pattern used to match file names which should not be inspected. | |
38 " Currently finds compressed files. | |
39 if !exists("g:ft_ignore_pat") | |
40 let g:ft_ignore_pat = '\.\(Z\|gz\|bz2\|zip\|tgz\)$' | |
41 endif | |
42 | |
216 | 43 " Function used for patterns that end in a star: don't set the filetype if the |
44 " file name matches ft_ignore_pat. | |
1219 | 45 func! s:StarSetf(ft) |
216 | 46 if expand("<amatch>") !~ g:ft_ignore_pat |
47 exe 'setf ' . a:ft | |
48 endif | |
1219 | 49 endfunc |
216 | 50 |
7 | 51 " Abaqus or Trasys |
216 | 52 au BufNewFile,BufRead *.inp call s:Check_inp() |
7 | 53 |
1219 | 54 func! s:Check_inp() |
7 | 55 if getline(1) =~ '^\*' |
56 setf abaqus | |
57 else | |
58 let n = 1 | |
59 if line("$") > 500 | |
60 let nmax = 500 | |
61 else | |
62 let nmax = line("$") | |
63 endif | |
64 while n <= nmax | |
65 if getline(n) =~? "^header surface data" | |
66 setf trasys | |
67 break | |
68 endif | |
69 let n = n + 1 | |
70 endwhile | |
71 endif | |
1219 | 72 endfunc |
7 | 73 |
74 " A-A-P recipe | |
75 au BufNewFile,BufRead *.aap setf aap | |
76 | |
389 | 77 " A2ps printing utility |
2751 | 78 au BufNewFile,BufRead */etc/a2ps.cfg,*/etc/a2ps/*.cfg,a2psrc,.a2psrc setf a2ps |
389 | 79 |
22 | 80 " ABAB/4 |
81 au BufNewFile,BufRead *.abap setf abap | |
82 | |
7 | 83 " ABC music notation |
84 au BufNewFile,BufRead *.abc setf abc | |
85 | |
86 " ABEL | |
87 au BufNewFile,BufRead *.abl setf abel | |
88 | |
89 " AceDB | |
90 au BufNewFile,BufRead *.wrm setf acedb | |
91 | |
92 " Ada (83, 9X, 95) | |
93 au BufNewFile,BufRead *.adb,*.ads,*.ada setf ada | |
1125 | 94 if has("vms") |
1676 | 95 au BufNewFile,BufRead *.gpr,*.ada_m,*.adc setf ada |
1125 | 96 else |
1676 | 97 au BufNewFile,BufRead *.gpr setf ada |
1125 | 98 endif |
7 | 99 |
100 " AHDL | |
101 au BufNewFile,BufRead *.tdf setf ahdl | |
102 | |
103 " AMPL | |
104 au BufNewFile,BufRead *.run setf ampl | |
105 | |
106 " Ant | |
107 au BufNewFile,BufRead build.xml setf ant | |
108 | |
5577 | 109 " Arduino |
110 au BufNewFile,BufRead *.ino,*.pde setf arduino | |
111 | |
7 | 112 " Apache style config file |
216 | 113 au BufNewFile,BufRead proftpd.conf* call s:StarSetf('apachestyle') |
7 | 114 |
115 " Apache config file | |
2751 | 116 au BufNewFile,BufRead .htaccess,*/etc/httpd/*.conf setf apache |
7 | 117 |
118 " XA65 MOS6510 cross assembler | |
119 au BufNewFile,BufRead *.a65 setf a65 | |
120 | |
2034 | 121 " Applescript |
122 au BufNewFile,BufRead *.scpt setf applescript | |
123 | |
7 | 124 " Applix ELF |
125 au BufNewFile,BufRead *.am | |
126 \ if expand("<afile>") !~? 'Makefile.am\>' | setf elf | endif | |
127 | |
24 | 128 " ALSA configuration |
2788 | 129 au BufNewFile,BufRead .asoundrc,*/usr/share/alsa/alsa.conf,*/etc/asound.conf setf alsaconf |
24 | 130 |
7 | 131 " Arc Macro Language |
132 au BufNewFile,BufRead *.aml setf aml | |
133 | |
3854 | 134 " APT config file |
5362
ab1508486b12
Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents:
5277
diff
changeset
|
135 au BufNewFile,BufRead apt.conf setf aptconf |
3854 | 136 au BufNewFile,BufRead */.aptitude/config setf aptconf |
137 au BufNewFile,BufRead */etc/apt/apt.conf.d/{[-_[:alnum:]]\+,[-_.[:alnum:]]\+.conf} setf aptconf | |
138 | |
7 | 139 " Arch Inventory file |
140 au BufNewFile,BufRead .arch-inventory,=tagging-method setf arch | |
141 | |
142 " ART*Enterprise (formerly ART-IM) | |
143 au BufNewFile,BufRead *.art setf art | |
144 | |
4229 | 145 " AsciiDoc |
7147
c590de398af9
commit https://github.com/vim/vim/commit/ca63501fbcd1cf9c8aa9ff12c093c95b62a89ed7
Christian Brabandt <cb@256bit.org>
parents:
7094
diff
changeset
|
146 au BufNewFile,BufRead *.asciidoc,*.adoc setf asciidoc |
4229 | 147 |
7 | 148 " ASN.1 |
149 au BufNewFile,BufRead *.asn,*.asn1 setf asn | |
150 | |
151 " Active Server Pages (with Visual Basic Script) | |
152 au BufNewFile,BufRead *.asa | |
153 \ if exists("g:filetype_asa") | | |
154 \ exe "setf " . g:filetype_asa | | |
155 \ else | | |
156 \ setf aspvbs | | |
157 \ endif | |
158 | |
159 " Active Server Pages (with Perl or Visual Basic Script) | |
160 au BufNewFile,BufRead *.asp | |
161 \ if exists("g:filetype_asp") | | |
162 \ exe "setf " . g:filetype_asp | | |
163 \ elseif getline(1) . getline(2) . getline(3) =~? "perlscript" | | |
164 \ setf aspperl | | |
165 \ else | | |
166 \ setf aspvbs | | |
167 \ endif | |
168 | |
169 " Grub (must be before catch *.lst) | |
2788 | 170 au BufNewFile,BufRead */boot/grub/menu.lst,*/boot/grub/grub.conf,*/etc/grub.conf setf grub |
7 | 171 |
172 " Assembly (all kinds) | |
173 " *.lst is not pure assembly, it has two extra columns (address, byte codes) | |
216 | 174 au BufNewFile,BufRead *.asm,*.[sS],*.[aA],*.mac,*.lst call s:FTasm() |
7 | 175 |
176 " This function checks for the kind of assembly that is wanted by the user, or | |
177 " can be detected from the first five lines of the file. | |
1219 | 178 func! s:FTasm() |
7 | 179 " make sure b:asmsyntax exists |
180 if !exists("b:asmsyntax") | |
181 let b:asmsyntax = "" | |
182 endif | |
183 | |
184 if b:asmsyntax == "" | |
216 | 185 call s:FTasmsyntax() |
7 | 186 endif |
187 | |
188 " if b:asmsyntax still isn't set, default to asmsyntax or GNU | |
189 if b:asmsyntax == "" | |
190 if exists("g:asmsyntax") | |
191 let b:asmsyntax = g:asmsyntax | |
192 else | |
193 let b:asmsyntax = "asm" | |
194 endif | |
195 endif | |
196 | |
1698 | 197 exe "setf " . fnameescape(b:asmsyntax) |
1219 | 198 endfunc |
199 | |
200 func! s:FTasmsyntax() | |
7 | 201 " see if file contains any asmsyntax=foo overrides. If so, change |
202 " b:asmsyntax appropriately | |
203 let head = " ".getline(1)." ".getline(2)." ".getline(3)." ".getline(4). | |
204 \" ".getline(5)." " | |
1698 | 205 let match = matchstr(head, '\sasmsyntax=\zs[a-zA-Z0-9]\+\ze\s') |
206 if match != '' | |
207 let b:asmsyntax = match | |
7 | 208 elseif ((head =~? '\.title') || (head =~? '\.ident') || (head =~? '\.macro') || (head =~? '\.subtitle') || (head =~? '\.library')) |
209 let b:asmsyntax = "vmasm" | |
210 endif | |
1219 | 211 endfunc |
7 | 212 |
213 " Macro (VAX) | |
214 au BufNewFile,BufRead *.mar setf vmasm | |
215 | |
216 " Atlas | |
217 au BufNewFile,BufRead *.atl,*.as setf atlas | |
218 | |
1125 | 219 " Autoit v3 |
220 au BufNewFile,BufRead *.au3 setf autoit | |
221 | |
1219 | 222 " Autohotkey |
223 au BufNewFile,BufRead *.ahk setf autohotkey | |
224 | |
7 | 225 " Automake |
809 | 226 au BufNewFile,BufRead [mM]akefile.am,GNUmakefile.am setf automake |
7 | 227 |
375 | 228 " Autotest .at files are actually m4 |
229 au BufNewFile,BufRead *.at setf m4 | |
230 | |
7 | 231 " Avenue |
232 au BufNewFile,BufRead *.ave setf ave | |
233 | |
234 " Awk | |
235 au BufNewFile,BufRead *.awk setf awk | |
236 | |
237 " B | |
238 au BufNewFile,BufRead *.mch,*.ref,*.imp setf b | |
239 | |
240 " BASIC or Visual Basic | |
216 | 241 au BufNewFile,BufRead *.bas call s:FTVB("basic") |
7 | 242 |
243 " Check if one of the first five lines contains "VB_Name". In that case it is | |
244 " probably a Visual Basic file. Otherwise it's assumed to be "alt" filetype. | |
1219 | 245 func! s:FTVB(alt) |
7 | 246 if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'VB_Name\|Begin VB\.\(Form\|MDIForm\|UserControl\)' |
247 setf vb | |
248 else | |
249 exe "setf " . a:alt | |
250 endif | |
1219 | 251 endfunc |
7 | 252 |
3465 | 253 " Visual Basic Script (close to Visual Basic) or Visual Basic .NET |
254 au BufNewFile,BufRead *.vb,*.vbs,*.dsm,*.ctl setf vb | |
7 | 255 |
1125 | 256 " IBasic file (similar to QBasic) |
257 au BufNewFile,BufRead *.iba,*.ibi setf ibasic | |
258 | |
259 " FreeBasic file (similar to QBasic) | |
260 au BufNewFile,BufRead *.fb,*.bi setf freebasic | |
261 | |
7 | 262 " Batch file for MSDOS. |
15 | 263 au BufNewFile,BufRead *.bat,*.sys setf dosbatch |
7 | 264 " *.cmd is close to a Batch file, but on OS/2 Rexx files also use *.cmd. |
265 au BufNewFile,BufRead *.cmd | |
266 \ if getline(1) =~ '^/\*' | setf rexx | else | setf dosbatch | endif | |
267 | |
268 " Batch file for 4DOS | |
216 | 269 au BufNewFile,BufRead *.btm call s:FTbtm() |
1219 | 270 func! s:FTbtm() |
15 | 271 if exists("g:dosbatch_syntax_for_btm") && g:dosbatch_syntax_for_btm |
272 setf dosbatch | |
273 else | |
274 setf btm | |
275 endif | |
1219 | 276 endfunc |
7 | 277 |
278 " BC calculator | |
279 au BufNewFile,BufRead *.bc setf bc | |
280 | |
281 " BDF font | |
282 au BufNewFile,BufRead *.bdf setf bdf | |
283 | |
284 " BibTeX bibliography database file | |
285 au BufNewFile,BufRead *.bib setf bib | |
286 | |
846 | 287 " BibTeX Bibliography Style |
288 au BufNewFile,BufRead *.bst setf bst | |
289 | |
7 | 290 " BIND configuration |
45 | 291 au BufNewFile,BufRead named.conf,rndc.conf setf named |
7 | 292 |
293 " BIND zone | |
294 au BufNewFile,BufRead named.root setf bindzone | |
805 | 295 au BufNewFile,BufRead *.db call s:BindzoneCheck('') |
296 | |
297 func! s:BindzoneCheck(default) | |
298 if getline(1).getline(2).getline(3).getline(4) =~ '^; <<>> DiG [0-9.]\+ <<>>\|BIND.*named\|$ORIGIN\|$TTL\|IN\s\+SOA' | |
299 setf bindzone | |
300 elseif a:default != '' | |
301 exe 'setf ' . a:default | |
302 endif | |
303 endfunc | |
7 | 304 |
305 " Blank | |
306 au BufNewFile,BufRead *.bl setf blank | |
307 | |
1676 | 308 " Blkid cache file |
2751 | 309 au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old setf xml |
1676 | 310 |
7176
30042ddff503
commit https://github.com/vim/vim/commit/60cce2fb736c8ff6fdb9603f502d3c15f1f7a25d
Christian Brabandt <cb@256bit.org>
parents:
7147
diff
changeset
|
311 " Bazel (http://bazel.io) |
10548
74effdaa369e
Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents:
10348
diff
changeset
|
312 autocmd BufRead,BufNewFile *.bzl,WORKSPACE setfiletype bzl |
74effdaa369e
Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents:
10348
diff
changeset
|
313 if has("fname_case") |
74effdaa369e
Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents:
10348
diff
changeset
|
314 autocmd BufRead,BufNewFile BUILD setfiletype bzl |
74effdaa369e
Updated runtime files.
Christian Brabandt <cb@256bit.org>
parents:
10348
diff
changeset
|
315 endif |
7176
30042ddff503
commit https://github.com/vim/vim/commit/60cce2fb736c8ff6fdb9603f502d3c15f1f7a25d
Christian Brabandt <cb@256bit.org>
parents:
7147
diff
changeset
|
316 |
7 | 317 " C or lpc |
216 | 318 au BufNewFile,BufRead *.c call s:FTlpc() |
7 | 319 |
1219 | 320 func! s:FTlpc() |
7 | 321 if exists("g:lpc_syntax_for_c") |
322 let lnum = 1 | |
323 while lnum <= 12 | |
324 if getline(lnum) =~# '^\(//\|inherit\|private\|protected\|nosave\|string\|object\|mapping\|mixed\)' | |
325 setf lpc | |
326 return | |
327 endif | |
328 let lnum = lnum + 1 | |
329 endwhile | |
330 endif | |
331 setf c | |
1219 | 332 endfunc |
7 | 333 |
334 " Calendar | |
216 | 335 au BufNewFile,BufRead calendar setf calendar |
7 | 336 |
337 " C# | |
338 au BufNewFile,BufRead *.cs setf cs | |
339 | |
4186 | 340 " CSDL |
341 au BufNewFile,BufRead *.csdl setf csdl | |
342 | |
2152 | 343 " Cabal |
2725 | 344 au BufNewFile,BufRead *.cabal setf cabal |
2152 | 345 |
1219 | 346 " Cdrdao TOC |
347 au BufNewFile,BufRead *.toc setf cdrtoc | |
348 | |
1648 | 349 " Cdrdao config |
2788 | 350 au BufNewFile,BufRead */etc/cdrdao.conf,*/etc/defaults/cdrdao,*/etc/default/cdrdao,.cdrdao setf cdrdaoconf |
1648 | 351 |
555 | 352 " Cfengine |
353 au BufNewFile,BufRead cfengine.conf setf cfengine | |
354 | |
2152 | 355 " ChaiScript |
356 au BufRead,BufNewFile *.chai setf chaiscript | |
357 | |
7 | 358 " Comshare Dimension Definition Language |
359 au BufNewFile,BufRead *.cdl setf cdl | |
360 | |
1125 | 361 " Conary Recipe |
362 au BufNewFile,BufRead *.recipe setf conaryrecipe | |
363 | |
7 | 364 " Controllable Regex Mutilator |
365 au BufNewFile,BufRead *.crm setf crm | |
366 | |
367 " Cyn++ | |
368 au BufNewFile,BufRead *.cyn setf cynpp | |
369 | |
370 " Cynlib | |
371 " .cc and .cpp files can be C++ or Cynlib. | |
372 au BufNewFile,BufRead *.cc | |
373 \ if exists("cynlib_syntax_for_cc")|setf cynlib|else|setf cpp|endif | |
374 au BufNewFile,BufRead *.cpp | |
375 \ if exists("cynlib_syntax_for_cpp")|setf cynlib|else|setf cpp|endif | |
376 | |
377 " C++ | |
2034 | 378 au BufNewFile,BufRead *.cxx,*.c++,*.hh,*.hxx,*.hpp,*.ipp,*.moc,*.tcc,*.inl setf cpp |
7 | 379 if has("fname_case") |
2034 | 380 au BufNewFile,BufRead *.C,*.H setf cpp |
7 | 381 endif |
382 | |
1648 | 383 " .h files can be C, Ch C++, ObjC or ObjC++. |
384 " Set c_syntax_for_h if you want C, ch_syntax_for_h if you want Ch. ObjC is | |
385 " detected automatically. | |
386 au BufNewFile,BufRead *.h call s:FTheader() | |
387 | |
388 func! s:FTheader() | |
389 if match(getline(1, min([line("$"), 200])), '^@\(interface\|end\|class\)') > -1 | |
3445 | 390 if exists("g:c_syntax_for_h") |
391 setf objc | |
392 else | |
393 setf objcpp | |
394 endif | |
2034 | 395 elseif exists("g:c_syntax_for_h") |
1648 | 396 setf c |
2034 | 397 elseif exists("g:ch_syntax_for_h") |
1648 | 398 setf ch |
399 else | |
400 setf cpp | |
401 endif | |
402 endfunc | |
7 | 403 |
404 " Ch (CHscript) | |
405 au BufNewFile,BufRead *.chf setf ch | |
406 | |
407 " TLH files are C++ headers generated by Visual C++'s #import from typelibs | |
408 au BufNewFile,BufRead *.tlh setf cpp | |
409 | |
410 " Cascading Style Sheets | |
411 au BufNewFile,BufRead *.css setf css | |
412 | |
413 " Century Term Command Scripts (*.cmd too) | |
414 au BufNewFile,BufRead *.con setf cterm | |
415 | |
416 " Changelog | |
809 | 417 au BufNewFile,BufRead changelog.Debian,changelog.dch,NEWS.Debian,NEWS.dch |
418 \ setf debchangelog | |
419 | |
420 au BufNewFile,BufRead [cC]hange[lL]og | |
421 \ if getline(1) =~ '; urgency=' | |
422 \| setf debchangelog | |
423 \| else | |
424 \| setf changelog | |
425 \| endif | |
426 | |
427 au BufNewFile,BufRead NEWS | |
428 \ if getline(1) =~ '; urgency=' | |
429 \| setf debchangelog | |
430 \| endif | |
7 | 431 |
432 " CHILL | |
433 au BufNewFile,BufRead *..ch setf chill | |
434 | |
435 " Changes for WEB and CWEB or CHILL | |
216 | 436 au BufNewFile,BufRead *.ch call s:FTchange() |
7 | 437 |
438 " This function checks if one of the first ten lines start with a '@'. In | |
439 " that case it is probably a change file. | |
440 " If the first line starts with # or ! it's probably a ch file. | |
441 " If a line has "main", "include", "//" ir "/*" it's probably ch. | |
442 " Otherwise CHILL is assumed. | |
1219 | 443 func! s:FTchange() |
7 | 444 let lnum = 1 |
445 while lnum <= 10 | |
446 if getline(lnum)[0] == '@' | |
447 setf change | |
448 return | |
449 endif | |
450 if lnum == 1 && (getline(1)[0] == '#' || getline(1)[0] == '!') | |
451 setf ch | |
452 return | |
453 endif | |
454 if getline(lnum) =~ "MODULE" | |
455 setf chill | |
456 return | |
457 endif | |
458 if getline(lnum) =~ 'main\s*(\|#\s*include\|//' | |
459 setf ch | |
460 return | |
461 endif | |
462 let lnum = lnum + 1 | |
463 endwhile | |
464 setf chill | |
1219 | 465 endfunc |
7 | 466 |
839 | 467 " ChordPro |
468 au BufNewFile,BufRead *.chopro,*.crd,*.cho,*.crdpro,*.chordpro setf chordpro | |
469 | |
7 | 470 " Clean |
471 au BufNewFile,BufRead *.dcl,*.icl setf clean | |
472 | |
473 " Clever | |
474 au BufNewFile,BufRead *.eni setf cl | |
475 | |
476 " Clever or dtd | |
216 | 477 au BufNewFile,BufRead *.ent call s:FTent() |
7 | 478 |
1219 | 479 func! s:FTent() |
7 | 480 " This function checks for valid cl syntax in the first five lines. |
481 " Look for either an opening comment, '#', or a block start, '{". | |
482 " If not found, assume SGML. | |
483 let lnum = 1 | |
484 while lnum < 6 | |
485 let line = getline(lnum) | |
486 if line =~ '^\s*[#{]' | |
487 setf cl | |
488 return | |
489 elseif line !~ '^\s*$' | |
490 " Not a blank line, not a comment, and not a block start, | |
491 " so doesn't look like valid cl code. | |
492 break | |
493 endif | |
494 let lnum = lnum + 1 | |
495 endw | |
496 setf dtd | |
1219 | 497 endfunc |
7 | 498 |
625 | 499 " Clipper (or FoxPro; could also be eviews) |
7 | 500 au BufNewFile,BufRead *.prg |
501 \ if exists("g:filetype_prg") | | |
502 \ exe "setf " . g:filetype_prg | | |
503 \ else | | |
504 \ setf clipper | | |
505 \ endif | |
506 | |
4098 | 507 " Clojure |
6823 | 508 au BufNewFile,BufRead *.clj,*.cljs,*.cljx,*.cljc setf clojure |
4098 | 509 |
836 | 510 " Cmake |
511 au BufNewFile,BufRead CMakeLists.txt,*.cmake,*.cmake.in setf cmake | |
512 | |
1125 | 513 " Cmusrc |
2788 | 514 au BufNewFile,BufRead */.cmus/{autosave,rc,command-history,*.theme} setf cmusrc |
1125 | 515 au BufNewFile,BufRead */cmus/{rc,*.theme} setf cmusrc |
516 | |
7 | 517 " Cobol |
809 | 518 au BufNewFile,BufRead *.cbl,*.cob,*.lib setf cobol |
519 " cobol or zope form controller python script? (heuristic) | |
520 au BufNewFile,BufRead *.cpy | |
521 \ if getline(1) =~ '^##' | | |
522 \ setf python | | |
523 \ else | | |
524 \ setf cobol | | |
525 \ endif | |
7 | 526 |
1648 | 527 " Coco/R |
528 au BufNewFile,BufRead *.atg setf coco | |
529 | |
7 | 530 " Cold Fusion |
531 au BufNewFile,BufRead *.cfm,*.cfi,*.cfc setf cf | |
532 | |
533 " Configure scripts | |
534 au BufNewFile,BufRead configure.in,configure.ac setf config | |
535 | |
1648 | 536 " CUDA Cumpute Unified Device Architecture |
537 au BufNewFile,BufRead *.cu setf cuda | |
538 | |
6180 | 539 " Dockerfile |
9644
9f7bcc2c3b97
commit https://github.com/vim/vim/commit/6f1d9a096bf22d50c727dca73abbfb8e3ff55176
Christian Brabandt <cb@256bit.org>
parents:
9555
diff
changeset
|
540 au BufNewFile,BufRead Dockerfile,*.Dockerfile setf dockerfile |
6180 | 541 |
7 | 542 " WildPackets EtherPeek Decoder |
543 au BufNewFile,BufRead *.dcd setf dcd | |
544 | |
545 " Enlightenment configuration files | |
546 au BufNewFile,BufRead *enlightenment/*.cfg setf c | |
547 | |
548 " Eterm | |
549 au BufNewFile,BufRead *Eterm/*.cfg setf eterm | |
550 | |
5692
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
5663
diff
changeset
|
551 " Euphoria 3 or 4 |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
5663
diff
changeset
|
552 au BufNewFile,BufRead *.eu,*.ew,*.ex,*.exu,*.exw call s:EuphoriaCheck() |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
5663
diff
changeset
|
553 if has("fname_case") |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
5663
diff
changeset
|
554 au BufNewFile,BufRead *.EU,*.EW,*.EX,*.EXU,*.EXW call s:EuphoriaCheck() |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
5663
diff
changeset
|
555 endif |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
5663
diff
changeset
|
556 |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
5663
diff
changeset
|
557 func! s:EuphoriaCheck() |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
5663
diff
changeset
|
558 if exists('g:filetype_euphoria') |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
5663
diff
changeset
|
559 exe 'setf ' . g:filetype_euphoria |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
5663
diff
changeset
|
560 else |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
5663
diff
changeset
|
561 setf euphoria3 |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
5663
diff
changeset
|
562 endif |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
5663
diff
changeset
|
563 endfunc |
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
5663
diff
changeset
|
564 |
7 | 565 " Lynx config files |
566 au BufNewFile,BufRead lynx.cfg setf lynx | |
567 | |
568 " Quake | |
569 au BufNewFile,BufRead *baseq[2-3]/*.cfg,*id1/*.cfg setf quake | |
570 au BufNewFile,BufRead *quake[1-3]/*.cfg setf quake | |
571 | |
572 " Quake C | |
573 au BufNewFile,BufRead *.qc setf c | |
574 | |
575 " Configure files | |
576 au BufNewFile,BufRead *.cfg setf cfg | |
577 | |
2098
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
2034
diff
changeset
|
578 " Cucumber |
2725 | 579 au BufNewFile,BufRead *.feature setf cucumber |
2098
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
2034
diff
changeset
|
580 |
7 | 581 " Communicating Sequential Processes |
582 au BufNewFile,BufRead *.csp,*.fdr setf csp | |
583 | |
584 " CUPL logic description and simulation | |
585 au BufNewFile,BufRead *.pld setf cupl | |
586 au BufNewFile,BufRead *.si setf cuplsim | |
587 | |
588 " Debian Control | |
589 au BufNewFile,BufRead */debian/control setf debcontrol | |
1648 | 590 au BufNewFile,BufRead control |
591 \ if getline(1) =~ '^Source:' | |
592 \| setf debcontrol | |
593 \| endif | |
7 | 594 |
816 | 595 " Debian Sources.list |
2751 | 596 au BufNewFile,BufRead */etc/apt/sources.list setf debsources |
597 au BufNewFile,BufRead */etc/apt/sources.list.d/*.list setf debsources | |
816 | 598 |
1648 | 599 " Deny hosts |
600 au BufNewFile,BufRead denyhosts.conf setf denyhosts | |
601 | |
2788 | 602 " dnsmasq(8) configuration files |
2833 | 603 au BufNewFile,BufRead */etc/dnsmasq.conf setf dnsmasq |
2788 | 604 |
7 | 605 " ROCKLinux package description |
606 au BufNewFile,BufRead *.desc setf desc | |
607 | |
1648 | 608 " the D language or dtrace |
609 au BufNewFile,BufRead *.d call s:DtraceCheck() | |
610 | |
611 func! s:DtraceCheck() | |
612 let lines = getline(1, min([line("$"), 100])) | |
3224 | 613 if match(lines, '^module\>\|^import\>') > -1 |
614 " D files often start with a module and/or import statement. | |
615 setf d | |
616 elseif match(lines, '^#!\S\+dtrace\|#pragma\s\+D\s\+option\|:\S\{-}:\S\{-}:') > -1 | |
1648 | 617 setf dtrace |
618 else | |
619 setf d | |
620 endif | |
621 endfunc | |
7 | 622 |
623 " Desktop files | |
624 au BufNewFile,BufRead *.desktop,.directory setf desktop | |
625 | |
389 | 626 " Dict config |
627 au BufNewFile,BufRead dict.conf,.dictrc setf dictconf | |
628 | |
629 " Dictd config | |
630 au BufNewFile,BufRead dictd.conf setf dictdconf | |
631 | |
7 | 632 " Diff files |
633 au BufNewFile,BufRead *.diff,*.rej,*.patch setf diff | |
634 | |
635 " Dircolors | |
2751 | 636 au BufNewFile,BufRead .dir_colors,.dircolors,*/etc/DIR_COLORS setf dircolors |
7 | 637 |
638 " Diva (with Skill) or InstallShield | |
639 au BufNewFile,BufRead *.rul | |
640 \ if getline(1).getline(2).getline(3).getline(4).getline(5).getline(6) =~? 'InstallShield' | | |
641 \ setf ishd | | |
642 \ else | | |
643 \ setf diva | | |
644 \ endif | |
645 | |
646 " DCL (Digital Command Language - vms) or DNS zone file | |
805 | 647 au BufNewFile,BufRead *.com call s:BindzoneCheck('dcl') |
7 | 648 |
649 " DOT | |
650 au BufNewFile,BufRead *.dot setf dot | |
651 | |
652 " Dylan - lid files | |
653 au BufNewFile,BufRead *.lid setf dylanlid | |
654 | |
655 " Dylan - intr files (melange) | |
656 au BufNewFile,BufRead *.intr setf dylanintr | |
657 | |
658 " Dylan | |
659 au BufNewFile,BufRead *.dylan setf dylan | |
660 | |
661 " Microsoft Module Definition | |
662 au BufNewFile,BufRead *.def setf def | |
663 | |
664 " Dracula | |
665 au BufNewFile,BufRead *.drac,*.drc,*lvs,*lpe setf dracula | |
666 | |
2467
9c8d603fd4d1
Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
2439
diff
changeset
|
667 " Datascript |
9c8d603fd4d1
Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
2439
diff
changeset
|
668 au BufNewFile,BufRead *.ds setf datascript |
9c8d603fd4d1
Add Datascript syntax file. (Dominique Pelle)
Bram Moolenaar <bram@vim.org>
parents:
2439
diff
changeset
|
669 |
7 | 670 " dsl |
671 au BufNewFile,BufRead *.dsl setf dsl | |
672 | |
673 " DTD (Document Type Definition for XML) | |
674 au BufNewFile,BufRead *.dtd setf dtd | |
675 | |
3847 | 676 " DTS/DSTI (device tree files) |
677 au BufNewFile,BufRead *.dts,*.dtsi setf dts | |
678 | |
10617 | 679 " EDIF (*.edf,*.edif,*.edn,*.edo) or edn |
680 au BufNewFile,BufRead *.ed\(f\|if\|o\) setf edif | |
681 au BufNewFile,BufRead *.edn | |
682 \ if getline(1) =~ '^\s*(\s*edif\>' | | |
683 \ setf edif | | |
684 \ else | | |
685 \ setf clojure | | |
686 \ endif | |
7 | 687 |
10211
b7da8d4c594c
commit https://github.com/vim/vim/commit/d07969093a9b3051511c478d71c36de6fc33c0d6
Christian Brabandt <cb@256bit.org>
parents:
9975
diff
changeset
|
688 " EditorConfig (close enough to dosini) |
b7da8d4c594c
commit https://github.com/vim/vim/commit/d07969093a9b3051511c478d71c36de6fc33c0d6
Christian Brabandt <cb@256bit.org>
parents:
9975
diff
changeset
|
689 au BufNewFile,BufRead .editorconfig setf dosini |
b7da8d4c594c
commit https://github.com/vim/vim/commit/d07969093a9b3051511c478d71c36de6fc33c0d6
Christian Brabandt <cb@256bit.org>
parents:
9975
diff
changeset
|
690 |
7 | 691 " Embedix Component Description |
692 au BufNewFile,BufRead *.ecd setf ecd | |
693 | |
5697 | 694 " Eiffel or Specman or Euphoria |
216 | 695 au BufNewFile,BufRead *.e,*.E call s:FTe() |
7 | 696 |
697 " Elinks configuration | |
698 au BufNewFile,BufRead */etc/elinks.conf,*/.elinks/elinks.conf setf elinks | |
699 | |
1219 | 700 func! s:FTe() |
5697 | 701 if exists('g:filetype_euphoria') |
702 exe 'setf ' . g:filetype_euphoria | |
703 else | |
704 let n = 1 | |
705 while n < 100 && n < line("$") | |
706 if getline(n) =~ "^\\s*\\(<'\\|'>\\)\\s*$" | |
9975
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
9908
diff
changeset
|
707 setf specman |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
9908
diff
changeset
|
708 return |
5697 | 709 endif |
710 let n = n + 1 | |
711 endwhile | |
712 setf eiffel | |
713 endif | |
1219 | 714 endfunc |
7 | 715 |
1648 | 716 " ERicsson LANGuage; Yaws is erlang too |
1668 | 717 au BufNewFile,BufRead *.erl,*.hrl,*.yaws setf erlang |
7 | 718 |
719 " Elm Filter Rules file | |
720 au BufNewFile,BufRead filter-rules setf elmfilt | |
721 | |
168 | 722 " ESMTP rc file |
723 au BufNewFile,BufRead *esmtprc setf esmtprc | |
724 | |
7 | 725 " ESQL-C |
726 au BufNewFile,BufRead *.ec,*.EC setf esqlc | |
727 | |
278 | 728 " Esterel |
729 au BufNewFile,BufRead *.strl setf esterel | |
730 | |
7 | 731 " Essbase script |
732 au BufNewFile,BufRead *.csc setf csc | |
733 | |
734 " Exim | |
735 au BufNewFile,BufRead exim.conf setf exim | |
736 | |
737 " Expect | |
738 au BufNewFile,BufRead *.exp setf expect | |
739 | |
740 " Exports | |
741 au BufNewFile,BufRead exports setf exports | |
742 | |
2596 | 743 " Falcon |
2725 | 744 au BufNewFile,BufRead *.fal setf falcon |
2596 | 745 |
2243
03a5f2897db3
Fix completion of file names with '%' and '*'.
Bram Moolenaar <bram@vim.org>
parents:
2202
diff
changeset
|
746 " Fantom |
03a5f2897db3
Fix completion of file names with '%' and '*'.
Bram Moolenaar <bram@vim.org>
parents:
2202
diff
changeset
|
747 au BufNewFile,BufRead *.fan,*.fwt setf fan |
03a5f2897db3
Fix completion of file names with '%' and '*'.
Bram Moolenaar <bram@vim.org>
parents:
2202
diff
changeset
|
748 |
333 | 749 " Factor |
750 au BufNewFile,BufRead *.factor setf factor | |
751 | |
7 | 752 " Fetchmail RC file |
753 au BufNewFile,BufRead .fetchmailrc setf fetchmail | |
754 | |
2034 | 755 " FlexWiki - disabled, because it has side effects when a .wiki file |
756 " is not actually FlexWiki | |
757 "au BufNewFile,BufRead *.wiki setf flexwiki | |
846 | 758 |
7 | 759 " Focus Executable |
760 au BufNewFile,BufRead *.fex,*.focexec setf focexec | |
761 | |
762 " Focus Master file (but not for auto.master) | |
763 au BufNewFile,BufRead auto.master setf conf | |
764 au BufNewFile,BufRead *.mas,*.master setf master | |
765 | |
766 " Forth | |
767 au BufNewFile,BufRead *.fs,*.ft setf forth | |
768 | |
1648 | 769 " Reva Forth |
770 au BufNewFile,BufRead *.frt setf reva | |
771 | |
7 | 772 " Fortran |
1125 | 773 if has("fname_case") |
2478
11def19fbb0e
Recognize .f03 and .f08 as Fortran files. (Ajit Thakkar)
Bram Moolenaar <bram@vim.org>
parents:
2467
diff
changeset
|
774 au BufNewFile,BufRead *.F,*.FOR,*.FPP,*.FTN,*.F77,*.F90,*.F95,*.F03,*.F08 setf fortran |
1125 | 775 endif |
2478
11def19fbb0e
Recognize .f03 and .f08 as Fortran files. (Ajit Thakkar)
Bram Moolenaar <bram@vim.org>
parents:
2467
diff
changeset
|
776 au BufNewFile,BufRead *.f,*.for,*.fortran,*.fpp,*.ftn,*.f77,*.f90,*.f95,*.f03,*.f08 setf fortran |
7 | 777 |
1698 | 778 " Framescript |
779 au BufNewFile,BufRead *.fsl setf framescript | |
780 | |
7 | 781 " FStab |
819 | 782 au BufNewFile,BufRead fstab,mtab setf fstab |
7 | 783 |
784 " GDB command files | |
785 au BufNewFile,BufRead .gdbinit setf gdb | |
786 | |
787 " GDMO | |
788 au BufNewFile,BufRead *.mo,*.gdmo setf gdmo | |
789 | |
790 " Gedcom | |
2034 | 791 au BufNewFile,BufRead *.ged,lltxxxxx.txt setf gedcom |
7 | 792 |
1648 | 793 " Git |
9908
2b6654519a7c
commit https://github.com/vim/vim/commit/7571d55f7dcc009a375b2124cce2c8b21f361234
Christian Brabandt <cb@256bit.org>
parents:
9644
diff
changeset
|
794 au BufNewFile,BufRead COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG setf gitcommit |
2788 | 795 au BufNewFile,BufRead *.git/config,.gitconfig,.gitmodules setf gitconfig |
5277 | 796 au BufNewFile,BufRead *.git/modules/*/config setf gitconfig |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
4437
diff
changeset
|
797 au BufNewFile,BufRead */.config/git/config setf gitconfig |
6336 | 798 if !empty($XDG_CONFIG_HOME) |
799 au BufNewFile,BufRead $XDG_CONFIG_HOME/git/config setf gitconfig | |
800 endif | |
4229 | 801 au BufNewFile,BufRead git-rebase-todo setf gitrebase |
2788 | 802 au BufNewFile,BufRead .msg.[0-9]* |
1648 | 803 \ if getline(1) =~ '^From.*# This line is ignored.$' | |
804 \ setf gitsendemail | | |
805 \ endif | |
5277 | 806 au BufNewFile,BufRead *.git/* |
1648 | 807 \ if getline(1) =~ '^\x\{40\}\>\|^ref: ' | |
808 \ setf git | | |
809 \ endif | |
810 | |
7 | 811 " Gkrellmrc |
812 au BufNewFile,BufRead gkrellmrc,gkrellmrc_? setf gkrellmrc | |
813 | |
814 " GP scripts (2.0 and onward) | |
827 | 815 au BufNewFile,BufRead *.gp,.gprc setf gp |
7 | 816 |
817 " GPG | |
818 au BufNewFile,BufRead */.gnupg/options setf gpg | |
819 au BufNewFile,BufRead */.gnupg/gpg.conf setf gpg | |
5277 | 820 au BufNewFile,BufRead */usr/*/gnupg/options.skel setf gpg |
10218
584c835a2de1
commit https://github.com/vim/vim/commit/50ba526fbf3e9e5e0e6b0b3086a4d5df581ebc7e
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
821 if !empty($GNUPGHOME) |
584c835a2de1
commit https://github.com/vim/vim/commit/50ba526fbf3e9e5e0e6b0b3086a4d5df581ebc7e
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
822 au BufNewFile,BufRead $GNUPGHOME/options setf gpg |
584c835a2de1
commit https://github.com/vim/vim/commit/50ba526fbf3e9e5e0e6b0b3086a4d5df581ebc7e
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
823 au BufNewFile,BufRead $GNUPGHOME/gpg.conf setf gpg |
584c835a2de1
commit https://github.com/vim/vim/commit/50ba526fbf3e9e5e0e6b0b3086a4d5df581ebc7e
Christian Brabandt <cb@256bit.org>
parents:
10211
diff
changeset
|
824 endif |
2788 | 825 |
826 " gnash(1) configuration files | |
827 au BufNewFile,BufRead gnashrc,.gnashrc,gnashpluginrc,.gnashpluginrc setf gnash | |
7 | 828 |
3153 | 829 " Gitolite |
830 au BufNewFile,BufRead gitolite.conf setf gitolite | |
831 au BufNewFile,BufRead */gitolite-admin/conf/* call s:StarSetf('gitolite') | |
4229 | 832 au BufNewFile,BufRead {,.}gitolite.rc,example.gitolite.rc setf perl |
3153 | 833 |
7 | 834 " Gnuplot scripts |
835 au BufNewFile,BufRead *.gpi setf gnuplot | |
836 | |
6153 | 837 " Go (Google) |
838 au BufNewFile,BufRead *.go setf go | |
839 | |
7 | 840 " GrADS scripts |
841 au BufNewFile,BufRead *.gs setf grads | |
842 | |
625 | 843 " Gretl |
844 au BufNewFile,BufRead *.gretl setf gretl | |
845 | |
7 | 846 " Groovy |
7147
c590de398af9
commit https://github.com/vim/vim/commit/ca63501fbcd1cf9c8aa9ff12c093c95b62a89ed7
Christian Brabandt <cb@256bit.org>
parents:
7094
diff
changeset
|
847 au BufNewFile,BufRead *.gradle,*.groovy setf groovy |
7 | 848 |
849 " GNU Server Pages | |
850 au BufNewFile,BufRead *.gsp setf gsp | |
851 | |
389 | 852 " Group file |
2751 | 853 au BufNewFile,BufRead */etc/group,*/etc/group-,*/etc/group.edit,*/etc/gshadow,*/etc/gshadow-,*/etc/gshadow.edit,*/var/backups/group.bak,*/var/backups/gshadow.bak setf group |
389 | 854 |
7 | 855 " GTK RC |
856 au BufNewFile,BufRead .gtkrc,gtkrc setf gtkrc | |
857 | |
1668 | 858 " Haml |
859 au BufNewFile,BufRead *.haml setf haml | |
860 | |
1125 | 861 " Hamster Classic | Playground files |
862 au BufNewFile,BufRead *.hsc,*.hsm setf hamster | |
863 | |
7 | 864 " Haskell |
2725 | 865 au BufNewFile,BufRead *.hs,*.hs-boot setf haskell |
7 | 866 au BufNewFile,BufRead *.lhs setf lhaskell |
867 au BufNewFile,BufRead *.chs setf chaskell | |
868 | |
1648 | 869 " Haste |
870 au BufNewFile,BufRead *.ht setf haste | |
1668 | 871 au BufNewFile,BufRead *.htpp setf hastepreproc |
1648 | 872 |
7 | 873 " Hercules |
10319
169a62d5bcb9
commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents:
10301
diff
changeset
|
874 au BufNewFile,BufRead *.vc,*.ev,*.sum,*.errsum setf hercules |
7 | 875 |
876 " HEX (Intel) | |
877 au BufNewFile,BufRead *.hex,*.h32 setf hex | |
878 | |
879 " Tilde (must be before HTML) | |
880 au BufNewFile,BufRead *.t.html setf tilde | |
881 | |
497 | 882 " HTML (.shtml and .stm for server side) |
883 au BufNewFile,BufRead *.html,*.htm,*.shtml,*.stm call s:FThtml() | |
7 | 884 |
798 | 885 " Distinguish between HTML, XHTML and Django |
1219 | 886 func! s:FThtml() |
7 | 887 let n = 1 |
888 while n < 10 && n < line("$") | |
889 if getline(n) =~ '\<DTD\s\+XHTML\s' | |
890 setf xhtml | |
891 return | |
892 endif | |
7094
66137191901a
commit https://github.com/vim/vim/commit/d8986fd91494642b3bab305406aa55268498f49c
Christian Brabandt <cb@256bit.org>
parents:
7013
diff
changeset
|
893 if getline(n) =~ '{%\s*\(extends\|block\|load\)\>\|{#\s\+' |
798 | 894 setf htmldjango |
895 return | |
896 endif | |
7 | 897 let n = n + 1 |
898 endwhile | |
899 setf html | |
1219 | 900 endfunc |
7 | 901 |
497 | 902 " HTML with Ruby - eRuby |
1219 | 903 au BufNewFile,BufRead *.erb,*.rhtml setf eruby |
7 | 904 |
905 " HTML with M4 | |
906 au BufNewFile,BufRead *.html.m4 setf htmlm4 | |
907 | |
908 " HTML Cheetah template | |
909 au BufNewFile,BufRead *.tmpl setf htmlcheetah | |
910 | |
1648 | 911 " Host config |
2751 | 912 au BufNewFile,BufRead */etc/host.conf setf hostconf |
1648 | 913 |
1676 | 914 " Hosts access |
2751 | 915 au BufNewFile,BufRead */etc/hosts.allow,*/etc/hosts.deny setf hostsaccess |
1676 | 916 |
7 | 917 " Hyper Builder |
918 au BufNewFile,BufRead *.hb setf hb | |
919 | |
4869 | 920 " Httest |
921 au BufNewFile,BufRead *.htt,*.htb setf httest | |
922 | |
7 | 923 " Icon |
924 au BufNewFile,BufRead *.icn setf icon | |
925 | |
926 " IDL (Interface Description Language) | |
216 | 927 au BufNewFile,BufRead *.idl call s:FTidl() |
7 | 928 |
929 " Distinguish between standard IDL and MS-IDL | |
1219 | 930 func! s:FTidl() |
7 | 931 let n = 1 |
932 while n < 50 && n < line("$") | |
933 if getline(n) =~ '^\s*import\s\+"\(unknwn\|objidl\)\.idl"' | |
934 setf msidl | |
935 return | |
936 endif | |
937 let n = n + 1 | |
938 endwhile | |
939 setf idl | |
1219 | 940 endfunc |
7 | 941 |
942 " Microsoft IDL (Interface Description Language) Also *.idl | |
943 " MOF = WMI (Windows Management Instrumentation) Managed Object Format | |
944 au BufNewFile,BufRead *.odl,*.mof setf msidl | |
945 | |
946 " Icewm menu | |
947 au BufNewFile,BufRead */.icewm/menu setf icemenu | |
948 | |
1219 | 949 " Indent profile (must come before IDL *.pro!) |
950 au BufNewFile,BufRead .indent.pro setf indent | |
951 au BufNewFile,BufRead indent.pro call s:ProtoCheck('indent') | |
952 | |
7 | 953 " IDL (Interactive Data Language) |
1219 | 954 au BufNewFile,BufRead *.pro call s:ProtoCheck('idlang') |
955 | |
956 " Distinguish between "default" and Cproto prototype file. */ | |
957 func! s:ProtoCheck(default) | |
958 " Cproto files have a comment in the first line and a function prototype in | |
959 " the second line, it always ends in ";". Indent files may also have | |
960 " comments, thus we can't match comments to see the difference. | |
2725 | 961 " IDL files can have a single ';' in the second line, require at least one |
962 " chacter before the ';'. | |
963 if getline(2) =~ '.;$' | |
1219 | 964 setf cpp |
965 else | |
966 exe 'setf ' . a:default | |
967 endif | |
968 endfunc | |
969 | |
7 | 970 |
389 | 971 " Indent RC |
1676 | 972 au BufNewFile,BufRead indentrc setf indent |
389 | 973 |
7 | 974 " Inform |
975 au BufNewFile,BufRead *.inf,*.INF setf inform | |
976 | |
1125 | 977 " Initng |
5277 | 978 au BufNewFile,BufRead */etc/initng/*/*.i,*.ii setf initng |
1125 | 979 |
4992 | 980 " Innovation Data Processing |
5277 | 981 au BufRead,BufNewFile upstream.dat\c,upstream.*.dat\c,*.upstream.dat\c setf upstreamdat |
982 au BufRead,BufNewFile upstream.log\c,upstream.*.log\c,*.upstream.log\c setf upstreamlog | |
983 au BufRead,BufNewFile upstreaminstall.log\c,upstreaminstall.*.log\c,*.upstreaminstall.log\c setf upstreaminstalllog | |
984 au BufRead,BufNewFile usserver.log\c,usserver.*.log\c,*.usserver.log\c setf usserverlog | |
985 au BufRead,BufNewFile usw2kagt.log\c,usw2kagt.*.log\c,*.usw2kagt.log\c setf usw2kagtlog | |
4992 | 986 |
148 | 987 " Ipfilter |
1125 | 988 au BufNewFile,BufRead ipf.conf,ipf6.conf,ipf.rules setf ipfilter |
148 | 989 |
7 | 990 " Informix 4GL (source - canonical, include file, I4GL+M4 preproc.) |
991 au BufNewFile,BufRead *.4gl,*.4gh,*.m4gl setf fgl | |
992 | |
993 " .INI file for MSDOS | |
994 au BufNewFile,BufRead *.ini setf dosini | |
995 | |
996 " SysV Inittab | |
997 au BufNewFile,BufRead inittab setf inittab | |
998 | |
999 " Inno Setup | |
1000 au BufNewFile,BufRead *.iss setf iss | |
1001 | |
5362
ab1508486b12
Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents:
5277
diff
changeset
|
1002 " J |
ab1508486b12
Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents:
5277
diff
changeset
|
1003 au BufNewFile,BufRead *.ijs setf j |
ab1508486b12
Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents:
5277
diff
changeset
|
1004 |
7 | 1005 " JAL |
1006 au BufNewFile,BufRead *.jal,*.JAL setf jal | |
1007 | |
1008 " Jam | |
1009 au BufNewFile,BufRead *.jpl,*.jpr setf jam | |
1010 | |
1011 " Java | |
1012 au BufNewFile,BufRead *.java,*.jav setf java | |
1013 | |
1014 " JavaCC | |
1015 au BufNewFile,BufRead *.jj,*.jjt setf javacc | |
1016 | |
1125 | 1017 " JavaScript, ECMAScript |
6070
32a77cc160d9
Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents:
6051
diff
changeset
|
1018 au BufNewFile,BufRead *.js,*.javascript,*.es,*.jsx setf javascript |
7 | 1019 |
1020 " Java Server Pages | |
1021 au BufNewFile,BufRead *.jsp setf jsp | |
1022 | |
1023 " Java Properties resource file (note: doesn't catch font.properties.pl) | |
216 | 1024 au BufNewFile,BufRead *.properties,*.properties_??,*.properties_??_?? setf jproperties |
1025 au BufNewFile,BufRead *.properties_??_??_* call s:StarSetf('jproperties') | |
7 | 1026 |
1027 " Jess | |
1028 au BufNewFile,BufRead *.clp setf jess | |
1029 | |
1030 " Jgraph | |
1031 au BufNewFile,BufRead *.jgr setf jgraph | |
1032 | |
2908 | 1033 " Jovial |
1034 au BufNewFile,BufRead *.jov,*.j73,*.jovial setf jovial | |
1035 | |
6070
32a77cc160d9
Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents:
6051
diff
changeset
|
1036 " JSON |
9407
619a98a67f67
commit https://github.com/vim/vim/commit/e18dbe865d190e74fb5d43ac8bc6ac22507d0223
Christian Brabandt <cb@256bit.org>
parents:
9041
diff
changeset
|
1037 au BufNewFile,BufRead *.json,*.jsonp,*.webmanifest setf json |
6070
32a77cc160d9
Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents:
6051
diff
changeset
|
1038 |
7 | 1039 " Kixtart |
1040 au BufNewFile,BufRead *.kix setf kix | |
1041 | |
1042 " Kimwitu[++] | |
1043 au BufNewFile,BufRead *.k setf kwt | |
1044 | |
5968 | 1045 " Kivy |
1046 au BufNewFile,BufRead *.kv setf kivy | |
1047 | |
7 | 1048 " KDE script |
1049 au BufNewFile,BufRead *.ks setf kscript | |
1050 | |
826 | 1051 " Kconfig |
1052 au BufNewFile,BufRead Kconfig,Kconfig.debug setf kconfig | |
1053 | |
7 | 1054 " Lace (ISE) |
1055 au BufNewFile,BufRead *.ace,*.ACE setf lace | |
1056 | |
1057 " Latte | |
1058 au BufNewFile,BufRead *.latte,*.lte setf latte | |
1059 | |
375 | 1060 " Limits |
2751 | 1061 au BufNewFile,BufRead */etc/limits,*/etc/*limits.conf,*/etc/*limits.d/*.conf setf limits |
375 | 1062 |
7 | 1063 " LambdaProlog (*.mod too, see Modsim) |
1064 au BufNewFile,BufRead *.sig setf lprolog | |
1065 | |
1066 " LDAP LDIF | |
1067 au BufNewFile,BufRead *.ldif setf ldif | |
1068 | |
375 | 1069 " Ld loader |
1070 au BufNewFile,BufRead *.ld setf ld | |
1071 | |
6476 | 1072 " Less |
1073 au BufNewFile,BufRead *.less setf less | |
1074 | |
7 | 1075 " Lex |
5697 | 1076 au BufNewFile,BufRead *.lex,*.l,*.lxx,*.l++ setf lex |
7 | 1077 |
1078 " Libao | |
2751 | 1079 au BufNewFile,BufRead */etc/libao.conf,*/.libao setf libao |
7 | 1080 |
389 | 1081 " Libsensors |
2751 | 1082 au BufNewFile,BufRead */etc/sensors.conf,*/etc/sensors3.conf setf sensors |
389 | 1083 |
7 | 1084 " LFTP |
1085 au BufNewFile,BufRead lftp.conf,.lftprc,*lftp/rc setf lftp | |
1086 | |
1087 " Lifelines (or Lex for C++!) | |
1088 au BufNewFile,BufRead *.ll setf lifelines | |
1089 | |
1090 " Lilo: Linux loader | |
2788 | 1091 au BufNewFile,BufRead lilo.conf setf lilo |
7 | 1092 |
1093 " Lisp (*.el = ELisp, *.cl = Common Lisp, *.jl = librep Lisp) | |
1094 if has("fname_case") | |
1095 au BufNewFile,BufRead *.lsp,*.lisp,*.el,*.cl,*.jl,*.L,.emacs,.sawfishrc setf lisp | |
1096 else | |
1097 au BufNewFile,BufRead *.lsp,*.lisp,*.el,*.cl,*.jl,.emacs,.sawfishrc setf lisp | |
1098 endif | |
1099 | |
375 | 1100 " SBCL implementation of Common Lisp |
1101 au BufNewFile,BufRead sbclrc,.sbclrc setf lisp | |
1102 | |
2202 | 1103 " Liquid |
1104 au BufNewFile,BufRead *.liquid setf liquid | |
1105 | |
7 | 1106 " Lite |
1107 au BufNewFile,BufRead *.lite,*.lt setf lite | |
1108 | |
1219 | 1109 " LiteStep RC files |
1110 au BufNewFile,BufRead */LiteStep/*/*.rc setf litestep | |
1111 | |
375 | 1112 " Login access |
2751 | 1113 au BufNewFile,BufRead */etc/login.access setf loginaccess |
375 | 1114 |
1115 " Login defs | |
2751 | 1116 au BufNewFile,BufRead */etc/login.defs setf logindefs |
375 | 1117 |
7 | 1118 " Logtalk |
1119 au BufNewFile,BufRead *.lgt setf logtalk | |
1120 | |
1121 " LOTOS | |
1122 au BufNewFile,BufRead *.lot,*.lotos setf lotos | |
1123 | |
1124 " Lout (also: *.lt) | |
1125 au BufNewFile,BufRead *.lou,*.lout setf lout | |
1126 | |
1127 " Lua | |
1128 au BufNewFile,BufRead *.lua setf lua | |
1129 | |
6213 | 1130 " Luarocks |
1131 au BufNewFile,BufRead *.rockspec setf lua | |
1132 | |
1648 | 1133 " Linden Scripting Language (Second Life) |
1134 au BufNewFile,BufRead *.lsl setf lsl | |
1135 | |
7 | 1136 " Lynx style file (or LotusScript!) |
1137 au BufNewFile,BufRead *.lss setf lss | |
1138 | |
1139 " M4 | |
1140 au BufNewFile,BufRead *.m4 | |
1141 \ if expand("<afile>") !~? 'html.m4$\|fvwm2rc' | setf m4 | endif | |
1142 | |
1143 " MaGic Point | |
1144 au BufNewFile,BufRead *.mgp setf mgp | |
1145 | |
1125 | 1146 " Mail (for Elm, trn, mutt, muttng, rn, slrn) |
5277 | 1147 au BufNewFile,BufRead snd.\d\+,.letter,.letter.\d\+,.followup,.article,.article.\d\+,pico.\d\+,mutt{ng,}-*-\w\+,mutt[[:alnum:]_-]\\\{6\},ae\d\+.txt,/tmp/SLRN[0-9A-Z.]\+,*.eml setf mail |
7 | 1148 |
809 | 1149 " Mail aliases |
2751 | 1150 au BufNewFile,BufRead */etc/mail/aliases,*/etc/aliases setf mailaliases |
809 | 1151 |
7 | 1152 " Mailcap configuration file |
1153 au BufNewFile,BufRead .mailcap,mailcap setf mailcap | |
1154 | |
1155 " Makefile | |
1156 au BufNewFile,BufRead *[mM]akefile,*.mk,*.mak,*.dsp setf make | |
1157 | |
1158 " MakeIndex | |
1159 au BufNewFile,BufRead *.ist,*.mst setf ist | |
1160 | |
4119 | 1161 " Mallard |
1162 au BufNewFile,BufRead *.page setf mallard | |
1163 | |
7 | 1164 " Manpage |
1165 au BufNewFile,BufRead *.man setf man | |
1166 | |
389 | 1167 " Man config |
2751 | 1168 au BufNewFile,BufRead */etc/man.conf,man.config setf manconf |
389 | 1169 |
7 | 1170 " Maple V |
1171 au BufNewFile,BufRead *.mv,*.mpl,*.mws setf maple | |
1172 | |
1668 | 1173 " Map (UMN mapserver config file) |
1174 au BufNewFile,BufRead *.map setf map | |
1175 | |
2202 | 1176 " Markdown |
6292
31f7581068a9
Update runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
6213
diff
changeset
|
1177 au BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,*.md setf markdown |
2202 | 1178 |
7 | 1179 " Mason |
6153 | 1180 au BufNewFile,BufRead *.mason,*.mhtml,*.comp setf mason |
7 | 1181 |
1182 " Matlab or Objective C | |
216 | 1183 au BufNewFile,BufRead *.m call s:FTm() |
7 | 1184 |
1219 | 1185 func! s:FTm() |
7 | 1186 let n = 1 |
1187 while n < 10 | |
1188 let line = getline(n) | |
7013 | 1189 if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\|//\)' |
7 | 1190 setf objc |
1191 return | |
1192 endif | |
1193 if line =~ '^\s*%' | |
1194 setf matlab | |
1195 return | |
1196 endif | |
1197 if line =~ '^\s*(\*' | |
1198 setf mma | |
1199 return | |
1200 endif | |
1201 let n = n + 1 | |
1202 endwhile | |
271 | 1203 if exists("g:filetype_m") |
1204 exe "setf " . g:filetype_m | |
1205 else | |
1206 setf matlab | |
1207 endif | |
1219 | 1208 endfunc |
7 | 1209 |
1648 | 1210 " Mathematica notebook |
1211 au BufNewFile,BufRead *.nb setf mma | |
1212 | |
7 | 1213 " Maya Extension Language |
1214 au BufNewFile,BufRead *.mel setf mel | |
1215 | |
3750 | 1216 " Mercurial (hg) commit file |
1217 au BufNewFile,BufRead hg-editor-*.txt setf hgcommit | |
1218 | |
2034 | 1219 " Mercurial config (looks like generic config file) |
1220 au BufNewFile,BufRead *.hgrc,*hgrc setf cfg | |
1221 | |
2709 | 1222 " Messages (logs mostly) |
2788 | 1223 au BufNewFile,BufRead */log/{auth,cron,daemon,debug,kern,lpr,mail,messages,news/news,syslog,user}{,.log,.err,.info,.warn,.crit,.notice}{,.[0-9]*,-[0-9]*} setf messages |
1125 | 1224 |
7 | 1225 " Metafont |
1226 au BufNewFile,BufRead *.mf setf mf | |
1227 | |
1228 " MetaPost | |
1229 au BufNewFile,BufRead *.mp setf mp | |
1230 | |
683 | 1231 " MGL |
1232 au BufNewFile,BufRead *.mgl setf mgl | |
1233 | |
5487 | 1234 " MIX - Knuth assembly |
1235 au BufNewFile,BufRead *.mix,*.mixal setf mix | |
1236 | |
7 | 1237 " MMIX or VMS makefile |
216 | 1238 au BufNewFile,BufRead *.mms call s:FTmms() |
7 | 1239 |
1648 | 1240 " Symbian meta-makefile definition (MMP) |
1241 au BufNewFile,BufRead *.mmp setf mmp | |
1242 | |
1219 | 1243 func! s:FTmms() |
7 | 1244 let n = 1 |
1245 while n < 10 | |
1246 let line = getline(n) | |
1247 if line =~ '^\s*\(%\|//\)' || line =~ '^\*' | |
1248 setf mmix | |
1249 return | |
1250 endif | |
1251 if line =~ '^\s*#' | |
1252 setf make | |
1253 return | |
1254 endif | |
1255 let n = n + 1 | |
1256 endwhile | |
1257 setf mmix | |
1219 | 1258 endfunc |
7 | 1259 |
1260 | |
1261 " Modsim III (or LambdaProlog) | |
1262 au BufNewFile,BufRead *.mod | |
1263 \ if getline(1) =~ '\<module\>' | | |
1264 \ setf lprolog | | |
1265 \ else | | |
1266 \ setf modsim3 | | |
1267 \ endif | |
1268 | |
6292
31f7581068a9
Update runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
6213
diff
changeset
|
1269 " Modula 2 (.md removed in favor of Markdown) |
31f7581068a9
Update runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
6213
diff
changeset
|
1270 au BufNewFile,BufRead *.m2,*.DEF,*.MOD,*.mi setf modula2 |
7 | 1271 |
1272 " Modula 3 (.m3, .i3, .mg, .ig) | |
1273 au BufNewFile,BufRead *.[mi][3g] setf modula3 | |
1274 | |
1275 " Monk | |
1276 au BufNewFile,BufRead *.isc,*.monk,*.ssc,*.tsc setf monk | |
1277 | |
1278 " MOO | |
1279 au BufNewFile,BufRead *.moo setf moo | |
1280 | |
1281 " Modconf | |
2788 | 1282 au BufNewFile,BufRead */etc/modules.conf,*/etc/modules,*/etc/conf.modules setf modconf |
7 | 1283 |
1284 " Mplayer config | |
1285 au BufNewFile,BufRead mplayer.conf,*/.mplayer/config setf mplayerconf | |
1286 | |
6697 | 1287 " Motorola S record |
1288 au BufNewFile,BufRead *.s19,*.s28,*.s37,*.mot,*.srec setf srec | |
7 | 1289 |
846 | 1290 " Mrxvtrc |
1291 au BufNewFile,BufRead mrxvtrc,.mrxvtrc setf mrxvtrc | |
1292 | |
7 | 1293 " Msql |
1294 au BufNewFile,BufRead *.msql setf msql | |
1295 | |
1296 " Mysql | |
1297 au BufNewFile,BufRead *.mysql setf mysql | |
1298 | |
2788 | 1299 " Mutt setup files (must be before catch *.rc) |
1300 au BufNewFile,BufRead */etc/Muttrc.d/* call s:StarSetf('muttrc') | |
1301 | |
7 | 1302 " M$ Resource files |
3682 | 1303 au BufNewFile,BufRead *.rc,*.rch setf rc |
7 | 1304 |
12 | 1305 " MuPAD source |
1306 au BufRead,BufNewFile *.mu setf mupad | |
1307 | |
7 | 1308 " Mush |
1309 au BufNewFile,BufRead *.mush setf mush | |
1310 | |
1125 | 1311 " Mutt setup file (also for Muttng) |
1648 | 1312 au BufNewFile,BufRead Mutt{ng,}rc setf muttrc |
7 | 1313 |
389 | 1314 " Nano |
6741 | 1315 au BufNewFile,BufRead */etc/nanorc,*.nanorc setf nanorc |
389 | 1316 |
7 | 1317 " Nastran input/DMAP |
1318 "au BufNewFile,BufRead *.dat setf nastran | |
1319 | |
1320 " Natural | |
1321 au BufNewFile,BufRead *.NS[ACGLMNPS] setf natural | |
1322 | |
39 | 1323 " Netrc |
1324 au BufNewFile,BufRead .netrc setf netrc | |
1325 | |
3256 | 1326 " Ninja file |
1327 au BufNewFile,BufRead *.ninja setf ninja | |
1328 | |
7 | 1329 " Novell netware batch files |
1330 au BufNewFile,BufRead *.ncf setf ncf | |
1331 | |
1332 " Nroff/Troff (*.ms and *.t are checked below) | |
1333 au BufNewFile,BufRead *.me | |
1334 \ if expand("<afile>") != "read.me" && expand("<afile>") != "click.me" | | |
1335 \ setf nroff | | |
1336 \ endif | |
1337 au BufNewFile,BufRead *.tr,*.nr,*.roff,*.tmac,*.mom setf nroff | |
216 | 1338 au BufNewFile,BufRead *.[1-9] call s:FTnroff() |
7 | 1339 |
1340 " This function checks if one of the first five lines start with a dot. In | |
1341 " that case it is probably an nroff file: 'filetype' is set and 1 is returned. | |
1219 | 1342 func! s:FTnroff() |
7 | 1343 if getline(1)[0] . getline(2)[0] . getline(3)[0] . getline(4)[0] . getline(5)[0] =~ '\.' |
1344 setf nroff | |
1345 return 1 | |
1346 endif | |
1347 return 0 | |
1219 | 1348 endfunc |
7 | 1349 |
1350 " Nroff or Objective C++ | |
216 | 1351 au BufNewFile,BufRead *.mm call s:FTmm() |
7 | 1352 |
1219 | 1353 func! s:FTmm() |
7 | 1354 let n = 1 |
1355 while n < 10 | |
1356 let line = getline(n) | |
7013 | 1357 if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\)' |
7 | 1358 setf objcpp |
1359 return | |
1360 endif | |
1361 let n = n + 1 | |
1362 endwhile | |
1363 setf nroff | |
1219 | 1364 endfunc |
7 | 1365 |
1366 " Not Quite C | |
1367 au BufNewFile,BufRead *.nqc setf nqc | |
1368 | |
1369 " NSIS | |
3492 | 1370 au BufNewFile,BufRead *.nsi,*.nsh setf nsis |
7 | 1371 |
1372 " OCAML | |
3312 | 1373 au BufNewFile,BufRead *.ml,*.mli,*.mll,*.mly,.ocamlinit setf ocaml |
7 | 1374 |
1375 " Occam | |
1376 au BufNewFile,BufRead *.occ setf occam | |
1377 | |
1378 " Omnimark | |
1379 au BufNewFile,BufRead *.xom,*.xin setf omnimark | |
1380 | |
1381 " OpenROAD | |
1382 au BufNewFile,BufRead *.or setf openroad | |
1383 | |
1384 " OPL | |
1385 au BufNewFile,BufRead *.[Oo][Pp][Ll] setf opl | |
1386 | |
1387 " Oracle config file | |
1388 au BufNewFile,BufRead *.ora setf ora | |
1389 | |
1390 " Packet filter conf | |
1391 au BufNewFile,BufRead pf.conf setf pf | |
1392 | |
375 | 1393 " Pam conf |
2751 | 1394 au BufNewFile,BufRead */etc/pam.conf setf pamconf |
375 | 1395 |
7 | 1396 " PApp |
1397 au BufNewFile,BufRead *.papp,*.pxml,*.pxsl setf papp | |
1398 | |
389 | 1399 " Password file |
2751 | 1400 au BufNewFile,BufRead */etc/passwd,*/etc/passwd-,*/etc/passwd.edit,*/etc/shadow,*/etc/shadow-,*/etc/shadow.edit,*/var/backups/passwd.bak,*/var/backups/shadow.bak setf passwd |
389 | 1401 |
7 | 1402 " Pascal (also *.p) |
1403 au BufNewFile,BufRead *.pas setf pascal | |
1404 | |
1405 " Delphi project file | |
1406 au BufNewFile,BufRead *.dpr setf pascal | |
1407 | |
1648 | 1408 " PDF |
1409 au BufNewFile,BufRead *.pdf setf pdf | |
1410 | |
7 | 1411 " Perl |
1412 if has("fname_case") | |
216 | 1413 au BufNewFile,BufRead *.pl,*.PL call s:FTpl() |
7 | 1414 else |
216 | 1415 au BufNewFile,BufRead *.pl call s:FTpl() |
7 | 1416 endif |
2034 | 1417 au BufNewFile,BufRead *.plx,*.al setf perl |
7299
e31e803a2910
commit https://github.com/vim/vim/commit/3b8fcd945c5f0ee104eaabcf969fb6f973e79c77
Christian Brabandt <cb@256bit.org>
parents:
7176
diff
changeset
|
1418 au BufNewFile,BufRead *.p6,*.pm6,*.pl6 setf perl6 |
7 | 1419 |
1219 | 1420 func! s:FTpl() |
7 | 1421 if exists("g:filetype_pl") |
1422 exe "setf " . g:filetype_pl | |
1423 else | |
1424 " recognize Prolog by specific text in the first non-empty line | |
1425 " require a blank after the '%' because Perl uses "%list" and "%translate" | |
1426 let l = getline(nextnonblank(1)) | |
1427 if l =~ '\<prolog\>' || l =~ '^\s*\(%\+\(\s\|$\)\|/\*\)' || l =~ ':-' | |
1428 setf prolog | |
1429 else | |
1430 setf perl | |
1431 endif | |
1432 endif | |
1219 | 1433 endfunc |
7 | 1434 |
1435 " Perl, XPM or XPM2 | |
1436 au BufNewFile,BufRead *.pm | |
1437 \ if getline(1) =~ "XPM2" | | |
1438 \ setf xpm2 | | |
1439 \ elseif getline(1) =~ "XPM" | | |
1440 \ setf xpm | | |
1441 \ else | | |
1442 \ setf perl | | |
1443 \ endif | |
1444 | |
1445 " Perl POD | |
1446 au BufNewFile,BufRead *.pod setf pod | |
7299
e31e803a2910
commit https://github.com/vim/vim/commit/3b8fcd945c5f0ee104eaabcf969fb6f973e79c77
Christian Brabandt <cb@256bit.org>
parents:
7176
diff
changeset
|
1447 au BufNewFile,BufRead *.pod6 setf pod6 |
7 | 1448 |
850 | 1449 " Php, php3, php4, etc. |
1648 | 1450 " Also Phtml (was used for PHP 2 in the past) |
1451 " Also .ctp for Cake template file | |
1452 au BufNewFile,BufRead *.php,*.php\d,*.phtml,*.ctp setf php | |
7 | 1453 |
1454 " Pike | |
1455 au BufNewFile,BufRead *.pike,*.lpc,*.ulpc,*.pmod setf pike | |
1456 | |
1457 " Pinfo config | |
1458 au BufNewFile,BufRead */etc/pinforc,*/.pinforc setf pinfo | |
1459 | |
1460 " Palm Resource compiler | |
1461 au BufNewFile,BufRead *.rcp setf pilrc | |
1462 | |
1463 " Pine config | |
1464 au BufNewFile,BufRead .pinerc,pinerc,.pinercex,pinercex setf pine | |
1465 | |
5239 | 1466 " PL/1, PL/I |
1467 au BufNewFile,BufRead *.pli,*.pl1 setf pli | |
1468 | |
7 | 1469 " PL/M (also: *.inp) |
1470 au BufNewFile,BufRead *.plm,*.p36,*.pac setf plm | |
1471 | |
1472 " PL/SQL | |
1473 au BufNewFile,BufRead *.pls,*.plsql setf plsql | |
1474 | |
1475 " PLP | |
1476 au BufNewFile,BufRead *.plp setf plp | |
1477 | |
1478 " PO and PO template (GNU gettext) | |
1479 au BufNewFile,BufRead *.po,*.pot setf po | |
1480 | |
1481 " Postfix main config | |
1482 au BufNewFile,BufRead main.cf setf pfmain | |
1483 | |
1484 " PostScript (+ font files, encapsulated PostScript, Adobe Illustrator) | |
1485 au BufNewFile,BufRead *.ps,*.pfa,*.afm,*.eps,*.epsf,*.epsi,*.ai setf postscr | |
1486 | |
1487 " PostScript Printer Description | |
1488 au BufNewFile,BufRead *.ppd setf ppd | |
1489 | |
1490 " Povray | |
1491 au BufNewFile,BufRead *.pov setf pov | |
1492 | |
1493 " Povray configuration | |
1494 au BufNewFile,BufRead .povrayrc setf povini | |
1495 | |
1496 " Povray, PHP or assembly | |
216 | 1497 au BufNewFile,BufRead *.inc call s:FTinc() |
7 | 1498 |
1219 | 1499 func! s:FTinc() |
7 | 1500 if exists("g:filetype_inc") |
1501 exe "setf " . g:filetype_inc | |
1502 else | |
1503 let lines = getline(1).getline(2).getline(3) | |
1504 if lines =~? "perlscript" | |
1505 setf aspperl | |
1506 elseif lines =~ "<%" | |
1507 setf aspvbs | |
1508 elseif lines =~ "<?" | |
1509 setf php | |
1510 else | |
216 | 1511 call s:FTasmsyntax() |
7 | 1512 if exists("b:asmsyntax") |
1698 | 1513 exe "setf " . fnameescape(b:asmsyntax) |
7 | 1514 else |
1515 setf pov | |
1516 endif | |
1517 endif | |
1518 endif | |
1219 | 1519 endfunc |
7 | 1520 |
1521 " Printcap and Termcap | |
1522 au BufNewFile,BufRead *printcap | |
1523 \ let b:ptcap_type = "print" | setf ptcap | |
1524 au BufNewFile,BufRead *termcap | |
1525 \ let b:ptcap_type = "term" | setf ptcap | |
1526 | |
1527 " PCCTS / ANTRL | |
1528 "au BufNewFile,BufRead *.g setf antrl | |
1529 au BufNewFile,BufRead *.g setf pccts | |
1530 | |
1531 " PPWizard | |
1532 au BufNewFile,BufRead *.it,*.ih setf ppwiz | |
1533 | |
2152 | 1534 " Obj 3D file format |
1535 " TODO: is there a way to avoid MS-Windows Object files? | |
2725 | 1536 au BufNewFile,BufRead *.obj setf obj |
2152 | 1537 |
7 | 1538 " Oracle Pro*C/C++ |
1287 | 1539 au BufNewFile,BufRead *.pc setf proc |
7 | 1540 |
1125 | 1541 " Privoxy actions file |
1542 au BufNewFile,BufRead *.action setf privoxy | |
1543 | |
7 | 1544 " Procmail |
1545 au BufNewFile,BufRead .procmail,.procmailrc setf procmail | |
1546 | |
1547 " Progress or CWEB | |
216 | 1548 au BufNewFile,BufRead *.w call s:FTprogress_cweb() |
7 | 1549 |
1219 | 1550 func! s:FTprogress_cweb() |
7 | 1551 if exists("g:filetype_w") |
1552 exe "setf " . g:filetype_w | |
1553 return | |
1554 endif | |
1555 if getline(1) =~ '&ANALYZE' || getline(3) =~ '&GLOBAL-DEFINE' | |
1556 setf progress | |
1557 else | |
1558 setf cweb | |
1559 endif | |
1219 | 1560 endfunc |
7 | 1561 |
1562 " Progress or assembly | |
216 | 1563 au BufNewFile,BufRead *.i call s:FTprogress_asm() |
7 | 1564 |
1219 | 1565 func! s:FTprogress_asm() |
7 | 1566 if exists("g:filetype_i") |
1567 exe "setf " . g:filetype_i | |
1568 return | |
1569 endif | |
1570 " This function checks for an assembly comment the first ten lines. | |
1571 " If not found, assume Progress. | |
1572 let lnum = 1 | |
500 | 1573 while lnum <= 10 && lnum < line('$') |
7 | 1574 let line = getline(lnum) |
1575 if line =~ '^\s*;' || line =~ '^\*' | |
216 | 1576 call s:FTasm() |
7 | 1577 return |
1578 elseif line !~ '^\s*$' || line =~ '^/\*' | |
1579 " Not an empty line: Doesn't look like valid assembly code. | |
1580 " Or it looks like a Progress /* comment | |
1581 break | |
1582 endif | |
1583 let lnum = lnum + 1 | |
1584 endw | |
1585 setf progress | |
1219 | 1586 endfunc |
7 | 1587 |
1588 " Progress or Pascal | |
216 | 1589 au BufNewFile,BufRead *.p call s:FTprogress_pascal() |
7 | 1590 |
1219 | 1591 func! s:FTprogress_pascal() |
7 | 1592 if exists("g:filetype_p") |
1593 exe "setf " . g:filetype_p | |
1594 return | |
1595 endif | |
1596 " This function checks for valid Pascal syntax in the first ten lines. | |
1597 " Look for either an opening comment or a program start. | |
1598 " If not found, assume Progress. | |
1599 let lnum = 1 | |
500 | 1600 while lnum <= 10 && lnum < line('$') |
7 | 1601 let line = getline(lnum) |
500 | 1602 if line =~ '^\s*\(program\|unit\|procedure\|function\|const\|type\|var\)\>' |
7 | 1603 \ || line =~ '^\s*{' || line =~ '^\s*(\*' |
1604 setf pascal | |
1605 return | |
1606 elseif line !~ '^\s*$' || line =~ '^/\*' | |
1607 " Not an empty line: Doesn't look like valid Pascal code. | |
1608 " Or it looks like a Progress /* comment | |
1609 break | |
1610 endif | |
1611 let lnum = lnum + 1 | |
1612 endw | |
1613 setf progress | |
1219 | 1614 endfunc |
7 | 1615 |
1616 | |
1617 " Software Distributor Product Specification File (POSIX 1387.2-1995) | |
1618 au BufNewFile,BufRead *.psf setf psf | |
1619 au BufNewFile,BufRead INDEX,INFO | |
1620 \ if getline(1) =~ '^\s*\(distribution\|installed_software\|root\|bundle\|product\)\s*$' | | |
1621 \ setf psf | | |
1622 \ endif | |
1623 | |
1624 " Prolog | |
1625 au BufNewFile,BufRead *.pdb setf prolog | |
1626 | |
1648 | 1627 " Promela |
1628 au BufNewFile,BufRead *.pml setf promela | |
1629 | |
4869 | 1630 " Google protocol buffers |
1631 au BufNewFile,BufRead *.proto setf proto | |
1632 | |
389 | 1633 " Protocols |
2751 | 1634 au BufNewFile,BufRead */etc/protocols setf protocols |
389 | 1635 |
7 | 1636 " Pyrex |
1637 au BufNewFile,BufRead *.pyx,*.pxd setf pyrex | |
1638 | |
9533
9f921133ee90
commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents:
9407
diff
changeset
|
1639 " Python, Python Shell Startup Files |
1676 | 1640 " Quixote (Python-based web framework) |
9533
9f921133ee90
commit https://github.com/vim/vim/commit/269f595f9eef584937e7eae70fde68cdd7da5bcf
Christian Brabandt <cb@256bit.org>
parents:
9407
diff
changeset
|
1641 au BufNewFile,BufRead *.py,*.pyw,.pythonstartup,.pythonrc,*.ptl setf python |
1676 | 1642 |
7 | 1643 " Radiance |
1644 au BufNewFile,BufRead *.rad,*.mat setf radiance | |
1645 | |
1646 " Ratpoison config/command files | |
1647 au BufNewFile,BufRead .ratpoisonrc,ratpoisonrc setf ratpoison | |
1648 | |
1649 " RCS file | |
1650 au BufNewFile,BufRead *\,v setf rcs | |
1651 | |
1652 " Readline | |
237 | 1653 au BufNewFile,BufRead .inputrc,inputrc setf readline |
7 | 1654 |
1655 " Registry for MS-Windows | |
1656 au BufNewFile,BufRead *.reg | |
1657 \ if getline(1) =~? '^REGEDIT[0-9]*\s*$\|^Windows Registry Editor Version \d*\.\d*\s*$' | setf registry | endif | |
1658 | |
1659 " Renderman Interface Bytestream | |
1660 au BufNewFile,BufRead *.rib setf rib | |
1661 | |
1662 " Rexx | |
3893 | 1663 au BufNewFile,BufRead *.rex,*.orx,*.rxo,*.rxj,*.jrexx,*.rexxj,*.rexx,*.testGroup,*.testUnit setf rexx |
7 | 1664 |
1665 " R (Splus) | |
836 | 1666 if has("fname_case") |
1667 au BufNewFile,BufRead *.s,*.S setf r | |
1668 else | |
1669 au BufNewFile,BufRead *.s setf r | |
1670 endif | |
7 | 1671 |
699 | 1672 " R Help file |
836 | 1673 if has("fname_case") |
1674 au BufNewFile,BufRead *.rd,*.Rd setf rhelp | |
1675 else | |
1676 au BufNewFile,BufRead *.rd setf rhelp | |
1677 endif | |
1678 | |
1679 " R noweb file | |
1680 if has("fname_case") | |
1681 au BufNewFile,BufRead *.Rnw,*.rnw,*.Snw,*.snw setf rnoweb | |
1682 else | |
1683 au BufNewFile,BufRead *.rnw,*.snw setf rnoweb | |
1684 endif | |
699 | 1685 |
6051 | 1686 " R Markdown file |
1687 if has("fname_case") | |
1688 au BufNewFile,BufRead *.Rmd,*.rmd,*.Smd,*.smd setf rmd | |
1689 else | |
1690 au BufNewFile,BufRead *.rmd,*.smd setf rmd | |
1691 endif | |
1692 | |
1693 " R reStructuredText file | |
1694 if has("fname_case") | |
1695 au BufNewFile,BufRead *.Rrst,*.rrst,*.Srst,*.srst setf rrst | |
1696 else | |
1697 au BufNewFile,BufRead *.rrst,*.srst setf rrst | |
1698 endif | |
1699 | |
7 | 1700 " Rexx, Rebol or R |
216 | 1701 au BufNewFile,BufRead *.r,*.R call s:FTr() |
7 | 1702 |
1219 | 1703 func! s:FTr() |
1125 | 1704 let max = line("$") > 50 ? 50 : line("$") |
1705 | |
1706 for n in range(1, max) | |
1707 " Rebol is easy to recognize, check for that first | |
1648 | 1708 if getline(n) =~? '\<REBOL\>' |
1125 | 1709 setf rebol |
1710 return | |
7 | 1711 endif |
1125 | 1712 endfor |
1713 | |
1714 for n in range(1, max) | |
1715 " R has # comments | |
1716 if getline(n) =~ '^\s*#' | |
1717 setf r | |
1718 return | |
1719 endif | |
1720 " Rexx has /* comments */ | |
1721 if getline(n) =~ '^\s*/\*' | |
7 | 1722 setf rexx |
1125 | 1723 return |
7 | 1724 endif |
1125 | 1725 endfor |
1726 | |
2965 | 1727 " Nothing recognized, use user default or assume Rexx |
1728 if exists("g:filetype_r") | |
1729 exe "setf " . g:filetype_r | |
1730 else | |
1731 " Rexx used to be the default, but R appears to be much more popular. | |
1732 setf r | |
1733 endif | |
1219 | 1734 endfunc |
7 | 1735 |
1736 " Remind | |
2788 | 1737 au BufNewFile,BufRead .reminders,*.remind,*.rem setf remind |
7 | 1738 |
1739 " Resolv.conf | |
1740 au BufNewFile,BufRead resolv.conf setf resolv | |
1741 | |
1742 " Relax NG Compact | |
1743 au BufNewFile,BufRead *.rnc setf rnc | |
1744 | |
4264 | 1745 " Relax NG XML |
1746 au BufNewFile,BufRead *.rng setf rng | |
1747 | |
7 | 1748 " RPL/2 |
1749 au BufNewFile,BufRead *.rpl setf rpl | |
1750 | |
1751 " Robots.txt | |
1752 au BufNewFile,BufRead robots.txt setf robots | |
1753 | |
1754 " Rpcgen | |
1755 au BufNewFile,BufRead *.x setf rpcgen | |
1756 | |
1757 " reStructuredText Documentation Format | |
1758 au BufNewFile,BufRead *.rst setf rst | |
1759 | |
1760 " RTF | |
1761 au BufNewFile,BufRead *.rtf setf rtf | |
1762 | |
1676 | 1763 " Interactive Ruby shell |
1764 au BufNewFile,BufRead .irbrc,irbrc setf ruby | |
1765 | |
7 | 1766 " Ruby |
2681 | 1767 au BufNewFile,BufRead *.rb,*.rbw setf ruby |
1768 | |
1769 " RubyGems | |
1770 au BufNewFile,BufRead *.gemspec setf ruby | |
1771 | |
10319
169a62d5bcb9
commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents:
10301
diff
changeset
|
1772 " Rust |
169a62d5bcb9
commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents:
10301
diff
changeset
|
1773 au BufNewFile,BufRead *.rs setf rust |
169a62d5bcb9
commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents:
10301
diff
changeset
|
1774 |
2681 | 1775 " Rackup |
1776 au BufNewFile,BufRead *.ru setf ruby | |
1777 | |
1778 " Bundler | |
1779 au BufNewFile,BufRead Gemfile setf ruby | |
7 | 1780 |
1219 | 1781 " Ruby on Rails |
1782 au BufNewFile,BufRead *.builder,*.rxml,*.rjs setf ruby | |
1783 | |
1784 " Rantfile and Rakefile is like Ruby | |
1785 au BufNewFile,BufRead [rR]antfile,*.rant,[rR]akefile,*.rake setf ruby | |
557 | 1786 |
2034 | 1787 " S-lang (or shader language, or SmallLisp) |
7 | 1788 au BufNewFile,BufRead *.sl setf slang |
1789 | |
1790 " Samba config | |
1791 au BufNewFile,BufRead smb.conf setf samba | |
1792 | |
1793 " SAS script | |
1794 au BufNewFile,BufRead *.sas setf sas | |
1795 | |
1668 | 1796 " Sass |
1797 au BufNewFile,BufRead *.sass setf sass | |
1798 | |
7 | 1799 " Sather |
1800 au BufNewFile,BufRead *.sa setf sather | |
1801 | |
9975
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
9908
diff
changeset
|
1802 " Scala |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
9908
diff
changeset
|
1803 au BufNewFile,BufRead *.scala setf scala |
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
9908
diff
changeset
|
1804 |
7 | 1805 " Scilab |
809 | 1806 au BufNewFile,BufRead *.sci,*.sce setf scilab |
7 | 1807 |
2415 | 1808 " SCSS |
2725 | 1809 au BufNewFile,BufRead *.scss setf scss |
2415 | 1810 |
1125 | 1811 " SD: Streaming Descriptors |
1812 au BufNewFile,BufRead *.sd setf sd | |
1813 | |
7 | 1814 " SDL |
1815 au BufNewFile,BufRead *.sdl,*.pr setf sdl | |
1816 | |
1817 " sed | |
1818 au BufNewFile,BufRead *.sed setf sed | |
1819 | |
36 | 1820 " Sieve (RFC 3028) |
1821 au BufNewFile,BufRead *.siv setf sieve | |
1822 | |
7 | 1823 " Sendmail |
1824 au BufNewFile,BufRead sendmail.cf setf sm | |
1825 | |
1648 | 1826 " Sendmail .mc files are actually m4. Could also be MS Message text file. |
1827 au BufNewFile,BufRead *.mc call s:McSetf() | |
1828 | |
1829 func! s:McSetf() | |
1830 " Rely on the file to start with a comment. | |
1831 " MS message text files use ';', Sendmail files use '#' or 'dnl' | |
1832 for lnum in range(1, min([line("$"), 20])) | |
1833 let line = getline(lnum) | |
1834 if line =~ '^\s*\(#\|dnl\)' | |
1835 setf m4 " Sendmail .mc file | |
1836 return | |
1837 elseif line =~ '^\s*;' | |
1838 setf msmessages " MS Message text file | |
1839 return | |
1840 endif | |
1841 endfor | |
1842 setf m4 " Default: Sendmail .mc file | |
1843 endfunc | |
7 | 1844 |
389 | 1845 " Services |
2751 | 1846 au BufNewFile,BufRead */etc/services setf services |
389 | 1847 |
1848 " Service Location config | |
2751 | 1849 au BufNewFile,BufRead */etc/slp.conf setf slpconf |
389 | 1850 |
1851 " Service Location registration | |
2751 | 1852 au BufNewFile,BufRead */etc/slp.reg setf slpreg |
389 | 1853 |
1854 " Service Location SPI | |
2751 | 1855 au BufNewFile,BufRead */etc/slp.spi setf slpspi |
389 | 1856 |
1857 " Setserial config | |
2751 | 1858 au BufNewFile,BufRead */etc/serial.conf setf setserial |
389 | 1859 |
7 | 1860 " SGML |
1861 au BufNewFile,BufRead *.sgm,*.sgml | |
1862 \ if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'linuxdoc' | | |
1863 \ setf sgmllnx | | |
1864 \ elseif getline(1) =~ '<!DOCTYPE.*DocBook' || getline(2) =~ '<!DOCTYPE.*DocBook' | | |
3967 | 1865 \ let b:docbk_type = "sgml" | |
1866 \ let b:docbk_ver = 4 | | |
7 | 1867 \ setf docbk | |
1868 \ else | | |
1869 \ setf sgml | | |
1870 \ endif | |
1871 | |
1872 " SGMLDECL | |
1873 au BufNewFile,BufRead *.decl,*.dcl,*.dec | |
1874 \ if getline(1).getline(2).getline(3) =~? '^<!SGML' | | |
1875 \ setf sgmldecl | | |
1876 \ endif | |
1877 | |
1878 " SGML catalog file | |
216 | 1879 au BufNewFile,BufRead catalog setf catalog |
1880 au BufNewFile,BufRead sgml.catalog* call s:StarSetf('catalog') | |
7 | 1881 |
1882 " Shell scripts (sh, ksh, bash, bash2, csh); Allow .profile_foo etc. | |
9041
34c45ee4210d
commit https://github.com/vim/vim/commit/06481427005a9dae39721087df94855f7d4d1feb
Christian Brabandt <cb@256bit.org>
parents:
7301
diff
changeset
|
1883 " Gentoo ebuilds and Arch Linux PKGBUILDs are actually bash scripts |
34c45ee4210d
commit https://github.com/vim/vim/commit/06481427005a9dae39721087df94855f7d4d1feb
Christian Brabandt <cb@256bit.org>
parents:
7301
diff
changeset
|
1884 au BufNewFile,BufRead .bashrc*,bashrc,bash.bashrc,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,*.bash,*/{,.}bash[_-]completion{,.d,.sh}{,/*},*.ebuild,*.eclass,PKGBUILD* call SetFileTypeSH("bash") |
7 | 1885 au BufNewFile,BufRead .kshrc*,*.ksh call SetFileTypeSH("ksh") |
2751 | 1886 au BufNewFile,BufRead */etc/profile,.profile*,*.sh,*.env call SetFileTypeSH(getline(1)) |
7 | 1887 |
9041
34c45ee4210d
commit https://github.com/vim/vim/commit/06481427005a9dae39721087df94855f7d4d1feb
Christian Brabandt <cb@256bit.org>
parents:
7301
diff
changeset
|
1888 " Shell script (Arch Linux) or PHP file (Drupal) |
34c45ee4210d
commit https://github.com/vim/vim/commit/06481427005a9dae39721087df94855f7d4d1feb
Christian Brabandt <cb@256bit.org>
parents:
7301
diff
changeset
|
1889 au BufNewFile,BufRead *.install |
34c45ee4210d
commit https://github.com/vim/vim/commit/06481427005a9dae39721087df94855f7d4d1feb
Christian Brabandt <cb@256bit.org>
parents:
7301
diff
changeset
|
1890 \ if getline(1) =~ '<?php' | |
34c45ee4210d
commit https://github.com/vim/vim/commit/06481427005a9dae39721087df94855f7d4d1feb
Christian Brabandt <cb@256bit.org>
parents:
7301
diff
changeset
|
1891 \ setf php | |
34c45ee4210d
commit https://github.com/vim/vim/commit/06481427005a9dae39721087df94855f7d4d1feb
Christian Brabandt <cb@256bit.org>
parents:
7301
diff
changeset
|
1892 \ else | |
34c45ee4210d
commit https://github.com/vim/vim/commit/06481427005a9dae39721087df94855f7d4d1feb
Christian Brabandt <cb@256bit.org>
parents:
7301
diff
changeset
|
1893 \ call SetFileTypeSH("bash") | |
34c45ee4210d
commit https://github.com/vim/vim/commit/06481427005a9dae39721087df94855f7d4d1feb
Christian Brabandt <cb@256bit.org>
parents:
7301
diff
changeset
|
1894 \ endif |
34c45ee4210d
commit https://github.com/vim/vim/commit/06481427005a9dae39721087df94855f7d4d1feb
Christian Brabandt <cb@256bit.org>
parents:
7301
diff
changeset
|
1895 |
216 | 1896 " Also called from scripts.vim. |
1219 | 1897 func! SetFileTypeSH(name) |
216 | 1898 if expand("<amatch>") =~ g:ft_ignore_pat |
1899 return | |
1900 endif | |
2034 | 1901 if a:name =~ '\<csh\>' |
1902 " Some .sh scripts contain #!/bin/csh. | |
1903 call SetFileTypeShell("csh") | |
1904 return | |
1905 elseif a:name =~ '\<tcsh\>' | |
1906 " Some .sh scripts contain #!/bin/tcsh. | |
1907 call SetFileTypeShell("tcsh") | |
1908 return | |
3830 | 1909 elseif a:name =~ '\<zsh\>' |
1910 " Some .sh scripts contain #!/bin/zsh. | |
1911 call SetFileTypeShell("zsh") | |
1912 return | |
2034 | 1913 elseif a:name =~ '\<ksh\>' |
7 | 1914 let b:is_kornshell = 1 |
1915 if exists("b:is_bash") | |
1916 unlet b:is_bash | |
1917 endif | |
1918 if exists("b:is_sh") | |
1919 unlet b:is_sh | |
1920 endif | |
1921 elseif exists("g:bash_is_sh") || a:name =~ '\<bash\>' || a:name =~ '\<bash2\>' | |
1922 let b:is_bash = 1 | |
1923 if exists("b:is_kornshell") | |
1924 unlet b:is_kornshell | |
1925 endif | |
1926 if exists("b:is_sh") | |
1927 unlet b:is_sh | |
1928 endif | |
1929 elseif a:name =~ '\<sh\>' | |
1930 let b:is_sh = 1 | |
1931 if exists("b:is_kornshell") | |
1932 unlet b:is_kornshell | |
1933 endif | |
1934 if exists("b:is_bash") | |
1935 unlet b:is_bash | |
1936 endif | |
1937 endif | |
26 | 1938 call SetFileTypeShell("sh") |
1219 | 1939 endfunc |
26 | 1940 |
1941 " For shell-like file types, check for an "exec" command hidden in a comment, | |
1942 " as used for Tcl. | |
216 | 1943 " Also called from scripts.vim, thus can't be local to this script. |
1219 | 1944 func! SetFileTypeShell(name) |
216 | 1945 if expand("<amatch>") =~ g:ft_ignore_pat |
1946 return | |
1947 endif | |
26 | 1948 let l = 2 |
1949 while l < 20 && l < line("$") && getline(l) =~ '^\s*\(#\|$\)' | |
1950 " Skip empty and comment lines. | |
1951 let l = l + 1 | |
1952 endwhile | |
1953 if l < line("$") && getline(l) =~ '\s*exec\s' && getline(l - 1) =~ '^\s*#.*\\$' | |
1954 " Found an "exec" line after a comment with continuation | |
1955 let n = substitute(getline(l),'\s*exec\s\+\([^ ]*/\)\=', '', '') | |
1956 if n =~ '\<tclsh\|\<wish' | |
1957 setf tcl | |
1958 return | |
1959 endif | |
1960 endif | |
1961 exe "setf " . a:name | |
1219 | 1962 endfunc |
7 | 1963 |
1964 " tcsh scripts | |
26 | 1965 au BufNewFile,BufRead .tcshrc*,*.tcsh,tcsh.tcshrc,tcsh.login call SetFileTypeShell("tcsh") |
7 | 1966 |
1967 " csh scripts, but might also be tcsh scripts (on some systems csh is tcsh) | |
216 | 1968 au BufNewFile,BufRead .login*,.cshrc*,csh.cshrc,csh.login,csh.logout,*.csh,.alias call s:CSH() |
7 | 1969 |
1219 | 1970 func! s:CSH() |
7 | 1971 if exists("g:filetype_csh") |
26 | 1972 call SetFileTypeShell(g:filetype_csh) |
7 | 1973 elseif &shell =~ "tcsh" |
26 | 1974 call SetFileTypeShell("tcsh") |
7 | 1975 else |
26 | 1976 call SetFileTypeShell("csh") |
7 | 1977 endif |
1219 | 1978 endfunc |
7 | 1979 |
1980 " Z-Shell script | |
2751 | 1981 au BufNewFile,BufRead .zprofile,*/etc/zprofile,.zfbfmarks setf zsh |
216 | 1982 au BufNewFile,BufRead .zsh*,.zlog*,.zcompdump* call s:StarSetf('zsh') |
2725 | 1983 au BufNewFile,BufRead *.zsh setf zsh |
7 | 1984 |
1985 " Scheme | |
3513 | 1986 au BufNewFile,BufRead *.scm,*.ss,*.rkt setf scheme |
7 | 1987 |
1988 " Screen RC | |
1989 au BufNewFile,BufRead .screenrc,screenrc setf screen | |
1990 | |
1991 " Simula | |
1992 au BufNewFile,BufRead *.sim setf simula | |
1993 | |
1994 " SINDA | |
1995 au BufNewFile,BufRead *.sin,*.s85 setf sinda | |
1996 | |
819 | 1997 " SiSU |
857 | 1998 au BufNewFile,BufRead *.sst,*.ssm,*.ssi,*.-sst,*._sst setf sisu |
819 | 1999 au BufNewFile,BufRead *.sst.meta,*.-sst.meta,*._sst.meta setf sisu |
2000 | |
7 | 2001 " SKILL |
336 | 2002 au BufNewFile,BufRead *.il,*.ils,*.cdf setf skill |
7 | 2003 |
2004 " SLRN | |
2005 au BufNewFile,BufRead .slrnrc setf slrnrc | |
2006 au BufNewFile,BufRead *.score setf slrnsc | |
2007 | |
271 | 2008 " Smalltalk (and TeX) |
2009 au BufNewFile,BufRead *.st setf st | |
2010 au BufNewFile,BufRead *.cls | |
2011 \ if getline(1) =~ '^%' | | |
2012 \ setf tex | | |
3893 | 2013 \ elseif getline(1)[0] == '#' && getline(1) =~ 'rexx' | |
2014 \ setf rexx | | |
271 | 2015 \ else | |
2016 \ setf st | | |
2017 \ endif | |
7 | 2018 |
2019 " Smarty templates | |
2020 au BufNewFile,BufRead *.tpl setf smarty | |
2021 | |
2022 " SMIL or XML | |
2023 au BufNewFile,BufRead *.smil | |
2024 \ if getline(1) =~ '<?\s*xml.*?>' | | |
2025 \ setf xml | | |
2026 \ else | | |
2027 \ setf smil | | |
2028 \ endif | |
2029 | |
2030 " SMIL or SNMP MIB file | |
2031 au BufNewFile,BufRead *.smi | |
2032 \ if getline(1) =~ '\<smil\>' | | |
2033 \ setf smil | | |
2034 \ else | | |
2035 \ setf mib | | |
2036 \ endif | |
2037 | |
2038 " SMITH | |
2039 au BufNewFile,BufRead *.smt,*.smith setf smith | |
2040 | |
857 | 2041 " Snobol4 and spitbol |
2042 au BufNewFile,BufRead *.sno,*.spt setf snobol4 | |
7 | 2043 |
2044 " SNMP MIB files | |
2045 au BufNewFile,BufRead *.mib,*.my setf mib | |
2046 | |
2047 " Snort Configuration | |
1219 | 2048 au BufNewFile,BufRead *.hog,snort.conf,vision.conf setf hog |
2049 au BufNewFile,BufRead *.rules call s:FTRules() | |
2050 | |
2051 let s:ft_rules_udev_rules_pattern = '^\s*\cudev_rules\s*=\s*"\([^"]\{-1,}\)/*".*' | |
2052 func! s:FTRules() | |
2034 | 2053 let path = expand('<amatch>:p') |
2751 | 2054 if path =~ '^/\(etc/udev/\%(rules\.d/\)\=.*\.rules\|lib/udev/\%(rules\.d/\)\=.*\.rules\)$' |
1648 | 2055 setf udevrules |
2056 return | |
2057 endif | |
2034 | 2058 if path =~ '^/etc/ufw/' |
2059 setf conf " Better than hog | |
2060 return | |
2061 endif | |
6505 | 2062 if path =~ '^/\(etc\|usr/share\)/polkit-1/rules\.d' |
2063 setf javascript | |
2064 return | |
2065 endif | |
1219 | 2066 try |
2067 let config_lines = readfile('/etc/udev/udev.conf') | |
2068 catch /^Vim\%((\a\+)\)\=:E484/ | |
2069 setf hog | |
2070 return | |
2071 endtry | |
1648 | 2072 let dir = expand('<amatch>:p:h') |
1219 | 2073 for line in config_lines |
2074 if line =~ s:ft_rules_udev_rules_pattern | |
2075 let udev_rules = substitute(line, s:ft_rules_udev_rules_pattern, '\1', "") | |
1648 | 2076 if dir == udev_rules |
9975
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
9908
diff
changeset
|
2077 setf udevrules |
1219 | 2078 endif |
2079 break | |
2080 endif | |
2081 endfor | |
2082 setf hog | |
2083 endfunc | |
2084 | |
7 | 2085 |
2086 " Spec (Linux RPM) | |
2087 au BufNewFile,BufRead *.spec setf spec | |
2088 | |
2089 " Speedup (AspenTech plant simulator) | |
2090 au BufNewFile,BufRead *.speedup,*.spdata,*.spd setf spup | |
2091 | |
2092 " Slice | |
2093 au BufNewFile,BufRead *.ice setf slice | |
2094 | |
2095 " Spice | |
2096 au BufNewFile,BufRead *.sp,*.spice setf spice | |
2097 | |
2098 " Spyce | |
2099 au BufNewFile,BufRead *.spy,*.spi setf spyce | |
2100 | |
2101 " Squid | |
2102 au BufNewFile,BufRead squid.conf setf squid | |
2103 | |
22 | 2104 " SQL for Oracle Designer |
2105 au BufNewFile,BufRead *.tyb,*.typ,*.tyc,*.pkb,*.pks setf sql | |
2106 | |
2107 " SQL | |
216 | 2108 au BufNewFile,BufRead *.sql call s:SQL() |
22 | 2109 |
1219 | 2110 func! s:SQL() |
22 | 2111 if exists("g:filetype_sql") |
2112 exe "setf " . g:filetype_sql | |
2113 else | |
2114 setf sql | |
2115 endif | |
1219 | 2116 endfunc |
7 | 2117 |
2118 " SQLJ | |
2119 au BufNewFile,BufRead *.sqlj setf sqlj | |
2120 | |
2121 " SQR | |
2122 au BufNewFile,BufRead *.sqr,*.sqi setf sqr | |
2123 | |
2124 " OpenSSH configuration | |
2125 au BufNewFile,BufRead ssh_config,*/.ssh/config setf sshconfig | |
2126 | |
2127 " OpenSSH server configuration | |
2128 au BufNewFile,BufRead sshd_config setf sshdconfig | |
2129 | |
831 | 2130 " Stata |
2131 au BufNewFile,BufRead *.ado,*.class,*.do,*.imata,*.mata setf stata | |
2132 | |
2133 " SMCL | |
2134 au BufNewFile,BufRead *.hlp,*.ihlp,*.smcl setf smcl | |
2135 | |
7 | 2136 " Stored Procedures |
2137 au BufNewFile,BufRead *.stp setf stp | |
2138 | |
2139 " Standard ML | |
2140 au BufNewFile,BufRead *.sml setf sml | |
2141 | |
1648 | 2142 " Sratus VOS command macro |
2143 au BufNewFile,BufRead *.cm setf voscm | |
2144 | |
375 | 2145 " Sysctl |
2751 | 2146 au BufNewFile,BufRead */etc/sysctl.conf,*/etc/sysctl.d/*.conf setf sysctl |
375 | 2147 |
7176
30042ddff503
commit https://github.com/vim/vim/commit/60cce2fb736c8ff6fdb9603f502d3c15f1f7a25d
Christian Brabandt <cb@256bit.org>
parents:
7147
diff
changeset
|
2148 " Systemd unit files |
30042ddff503
commit https://github.com/vim/vim/commit/60cce2fb736c8ff6fdb9603f502d3c15f1f7a25d
Christian Brabandt <cb@256bit.org>
parents:
7147
diff
changeset
|
2149 au BufNewFile,BufRead */systemd/*.{automount,mount,path,service,socket,swap,target,timer} setf systemd |
30042ddff503
commit https://github.com/vim/vim/commit/60cce2fb736c8ff6fdb9603f502d3c15f1f7a25d
Christian Brabandt <cb@256bit.org>
parents:
7147
diff
changeset
|
2150 |
2034 | 2151 " Synopsys Design Constraints |
2152 au BufNewFile,BufRead *.sdc setf sdc | |
2153 | |
39 | 2154 " Sudoers |
2751 | 2155 au BufNewFile,BufRead */etc/sudoers,sudoers.tmp setf sudoers |
39 | 2156 |
2152 | 2157 " SVG (Scalable Vector Graphics) |
2158 au BufNewFile,BufRead *.svg setf svg | |
2159 | |
5425 | 2160 " If the file has an extension of 't' and is in a directory 't' or 'xt' then |
2161 " it is almost certainly a Perl test file. | |
557 | 2162 " If the first line starts with '#' and contains 'perl' it's probably a Perl |
2163 " file. | |
826 | 2164 " (Slow test) If a file contains a 'use' statement then it is almost certainly |
2165 " a Perl file. | |
1219 | 2166 func! s:FTperl() |
5425 | 2167 let dirname = expand("%:p:h:t") |
2168 if expand("%:e") == 't' && (dirname == 't' || dirname == 'xt') | |
826 | 2169 setf perl |
2170 return 1 | |
2171 endif | |
557 | 2172 if getline(1)[0] == '#' && getline(1) =~ 'perl' |
2173 setf perl | |
2174 return 1 | |
2175 endif | |
826 | 2176 if search('^use\s\s*\k', 'nc', 30) |
2177 setf perl | |
2178 return 1 | |
2179 endif | |
557 | 2180 return 0 |
1219 | 2181 endfunc |
557 | 2182 |
2183 " Tads (or Nroff or Perl test file) | |
7 | 2184 au BufNewFile,BufRead *.t |
557 | 2185 \ if !s:FTnroff() && !s:FTperl() | setf tads | endif |
7 | 2186 |
2187 " Tags | |
2188 au BufNewFile,BufRead tags setf tags | |
2189 | |
2190 " TAK | |
2191 au BufNewFile,BufRead *.tak setf tak | |
2192 | |
2034 | 2193 " Task |
2194 au BufRead,BufNewFile {pending,completed,undo}.data setf taskdata | |
5362
ab1508486b12
Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents:
5277
diff
changeset
|
2195 au BufRead,BufNewFile *.task setf taskedit |
2034 | 2196 |
557 | 2197 " Tcl (JACL too) |
2198 au BufNewFile,BufRead *.tcl,*.tk,*.itcl,*.itk,*.jacl setf tcl | |
7 | 2199 |
2200 " TealInfo | |
2201 au BufNewFile,BufRead *.tli setf tli | |
2202 | |
2203 " Telix Salt | |
2204 au BufNewFile,BufRead *.slt setf tsalt | |
2205 | |
6951
b2673982c625
Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents:
6823
diff
changeset
|
2206 " Tera Term Language |
b2673982c625
Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents:
6823
diff
changeset
|
2207 au BufRead,BufNewFile *.ttl setf teraterm |
b2673982c625
Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents:
6823
diff
changeset
|
2208 |
7 | 2209 " Terminfo |
2210 au BufNewFile,BufRead *.ti setf terminfo | |
2211 | |
2212 " TeX | |
378 | 2213 au BufNewFile,BufRead *.latex,*.sty,*.dtx,*.ltx,*.bbl setf tex |
2214 au BufNewFile,BufRead *.tex call s:FTtex() | |
2215 | |
800 | 2216 " Choose context, plaintex, or tex (LaTeX) based on these rules: |
2217 " 1. Check the first line of the file for "%&<format>". | |
2218 " 2. Check the first 1000 non-comment lines for LaTeX or ConTeXt keywords. | |
2219 " 3. Default to "latex" or to g:tex_flavor, can be set in user's vimrc. | |
1219 | 2220 func! s:FTtex() |
800 | 2221 let firstline = getline(1) |
2222 if firstline =~ '^%&\s*\a\+' | |
2223 let format = tolower(matchstr(firstline, '\a\+')) | |
2224 let format = substitute(format, 'pdf', '', '') | |
2225 if format == 'tex' | |
2226 let format = 'plain' | |
378 | 2227 endif |
800 | 2228 else |
2229 " Default value, may be changed later: | |
2230 let format = exists("g:tex_flavor") ? g:tex_flavor : 'plain' | |
2231 " Save position, go to the top of the file, find first non-comment line. | |
2232 let save_cursor = getpos('.') | |
2233 call cursor(1,1) | |
2234 let firstNC = search('^\s*[^[:space:]%]', 'c', 1000) | |
2235 if firstNC " Check the next thousand lines for a LaTeX or ConTeXt keyword. | |
2236 let lpat = 'documentclass\>\|usepackage\>\|begin{\|newcommand\>\|renewcommand\>' | |
2237 let cpat = 'start\a\+\|setup\a\+\|usemodule\|enablemode\|enableregime\|setvariables\|useencoding\|usesymbols\|stelle\a\+\|verwende\a\+\|stel\a\+\|gebruik\a\+\|usa\a\+\|imposta\a\+\|regle\a\+\|utilisemodule\>' | |
2238 let kwline = search('^\s*\\\%(' . lpat . '\)\|^\s*\\\(' . cpat . '\)', | |
2239 \ 'cnp', firstNC + 1000) | |
2240 if kwline == 1 " lpat matched | |
2241 let format = 'latex' | |
2242 elseif kwline == 2 " cpat matched | |
2243 let format = 'context' | |
2244 endif " If neither matched, keep default set above. | |
2245 " let lline = search('^\s*\\\%(' . lpat . '\)', 'cn', firstNC + 1000) | |
2246 " let cline = search('^\s*\\\%(' . cpat . '\)', 'cn', firstNC + 1000) | |
2247 " if cline > 0 | |
2248 " let format = 'context' | |
2249 " endif | |
2250 " if lline > 0 && (cline == 0 || cline > lline) | |
2251 " let format = 'tex' | |
2252 " endif | |
2253 endif " firstNC | |
2254 call setpos('.', save_cursor) | |
2255 endif " firstline =~ '^%&\s*\a\+' | |
694 | 2256 |
800 | 2257 " Translation from formats to file types. TODO: add AMSTeX, RevTex, others? |
2258 if format == 'plain' | |
2259 setf plaintex | |
2260 elseif format == 'context' | |
694 | 2261 setf context |
800 | 2262 else " probably LaTeX |
694 | 2263 setf tex |
2264 endif | |
800 | 2265 return |
1219 | 2266 endfunc |
378 | 2267 |
1648 | 2268 " ConTeXt |
10301
07d2b5a3b7cc
commit https://github.com/vim/vim/commit/46fceaaa8d1447a9588736d86eb4908214187b08
Christian Brabandt <cb@256bit.org>
parents:
10218
diff
changeset
|
2269 au BufNewFile,BufRead tex/context/*/*.tex,*.mkii,*.mkiv,*.mkvi setf context |
7 | 2270 |
2271 " Texinfo | |
2272 au BufNewFile,BufRead *.texinfo,*.texi,*.txi setf texinfo | |
2273 | |
2274 " TeX configuration | |
2275 au BufNewFile,BufRead texmf.cnf setf texmf | |
2276 | |
2277 " Tidy config | |
2278 au BufNewFile,BufRead .tidyrc,tidyrc setf tidy | |
2279 | |
2280 " TF mud client | |
2281 au BufNewFile,BufRead *.tf,.tfrc,tfrc setf tf | |
2282 | |
33 | 2283 " TPP - Text Presentation Program |
2284 au BufNewFile,BufReadPost *.tpp setf tpp | |
2285 | |
2725 | 2286 " Treetop |
2287 au BufRead,BufNewFile *.treetop setf treetop | |
2288 | |
555 | 2289 " Trustees |
2290 au BufNewFile,BufRead trustees.conf setf trustees | |
2291 | |
7 | 2292 " TSS - Geometry |
2293 au BufNewFile,BufReadPost *.tssgm setf tssgm | |
2294 | |
2295 " TSS - Optics | |
2296 au BufNewFile,BufReadPost *.tssop setf tssop | |
2297 | |
2298 " TSS - Command Line (temporary) | |
2299 au BufNewFile,BufReadPost *.tsscl setf tsscl | |
2300 | |
3456 | 2301 " TWIG files |
2302 au BufNewFile,BufReadPost *.twig setf twig | |
2303 | |
7 | 2304 " Motif UIT/UIL files |
2305 au BufNewFile,BufRead *.uit,*.uil setf uil | |
2306 | |
389 | 2307 " Udev conf |
2751 | 2308 au BufNewFile,BufRead */etc/udev/udev.conf setf udevconf |
389 | 2309 |
2310 " Udev permissions | |
2751 | 2311 au BufNewFile,BufRead */etc/udev/permissions.d/*.permissions setf udevperm |
389 | 2312 " |
2313 " Udev symlinks config | |
2751 | 2314 au BufNewFile,BufRead */etc/udev/cdsymlinks.conf setf sh |
389 | 2315 |
7 | 2316 " UnrealScript |
2317 au BufNewFile,BufRead *.uc setf uc | |
2318 | |
375 | 2319 " Updatedb |
2751 | 2320 au BufNewFile,BufRead */etc/updatedb.conf setf updatedb |
375 | 2321 |
2725 | 2322 " Upstart (init(8)) config files |
5362
ab1508486b12
Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents:
5277
diff
changeset
|
2323 au BufNewFile,BufRead */usr/share/upstart/*.conf setf upstart |
ab1508486b12
Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents:
5277
diff
changeset
|
2324 au BufNewFile,BufRead */usr/share/upstart/*.override setf upstart |
4186 | 2325 au BufNewFile,BufRead */etc/init/*.conf,*/etc/init/*.override setf upstart |
9975
03fa8a51e9dc
commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents:
9908
diff
changeset
|
2326 au BufNewFile,BufRead */.init/*.conf,*/.init/*.override setf upstart |
5362
ab1508486b12
Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents:
5277
diff
changeset
|
2327 au BufNewFile,BufRead */.config/upstart/*.conf setf upstart |
ab1508486b12
Update runtime files. Add support for J.
Bram Moolenaar <bram@vim.org>
parents:
5277
diff
changeset
|
2328 au BufNewFile,BufRead */.config/upstart/*.override setf upstart |
2725 | 2329 |
836 | 2330 " Vera |
2331 au BufNewFile,BufRead *.vr,*.vri,*.vrh setf vera | |
2332 | |
7 | 2333 " Verilog HDL |
2334 au BufNewFile,BufRead *.v setf verilog | |
2335 | |
481 | 2336 " Verilog-AMS HDL |
2337 au BufNewFile,BufRead *.va,*.vams setf verilogams | |
2338 | |
5663
1dea14d4c738
Update runtime files. Add support for systemverilog.
Bram Moolenaar <bram@vim.org>
parents:
5577
diff
changeset
|
2339 " SystemVerilog |
5692
80e5f9584b02
Update runtime files. Add Euphoria syntax files.
Bram Moolenaar <bram@vim.org>
parents:
5663
diff
changeset
|
2340 au BufNewFile,BufRead *.sv,*.svh setf systemverilog |
5663
1dea14d4c738
Update runtime files. Add support for systemverilog.
Bram Moolenaar <bram@vim.org>
parents:
5577
diff
changeset
|
2341 |
7 | 2342 " VHDL |
216 | 2343 au BufNewFile,BufRead *.hdl,*.vhd,*.vhdl,*.vbe,*.vst setf vhdl |
375 | 2344 au BufNewFile,BufRead *.vhdl_[0-9]* call s:StarSetf('vhdl') |
7 | 2345 |
2346 " Vim script | |
794 | 2347 au BufNewFile,BufRead *.vim,*.vba,.exrc,_exrc setf vim |
7 | 2348 |
2349 " Viminfo file | |
2350 au BufNewFile,BufRead .viminfo,_viminfo setf viminfo | |
2351 | |
2034 | 2352 " Virata Config Script File or Drupal module |
2353 au BufRead,BufNewFile *.hw,*.module,*.pkg | |
2354 \ if getline(1) =~ '<?php' | | |
2355 \ setf php | | |
2356 \ else | | |
2357 \ setf virata | | |
2358 \ endif | |
7 | 2359 |
2360 " Visual Basic (also uses *.bas) or FORM | |
216 | 2361 au BufNewFile,BufRead *.frm call s:FTVB("form") |
7 | 2362 |
2363 " SaxBasic is close to Visual Basic | |
2364 au BufNewFile,BufRead *.sba setf vb | |
2365 | |
2366 " Vgrindefs file | |
2367 au BufNewFile,BufRead vgrindefs setf vgrindefs | |
2368 | |
2369 " VRML V1.0c | |
2370 au BufNewFile,BufRead *.wrl setf vrml | |
2371 | |
6091
7090d7f160f7
Update runtime files. Add vroom file support.
Bram Moolenaar <bram@vim.org>
parents:
6070
diff
changeset
|
2372 " Vroom (vim testing and executable documentation) |
7090d7f160f7
Update runtime files. Add vroom file support.
Bram Moolenaar <bram@vim.org>
parents:
6070
diff
changeset
|
2373 au BufNewFile,BufRead *.vroom setf vroom |
7090d7f160f7
Update runtime files. Add vroom file support.
Bram Moolenaar <bram@vim.org>
parents:
6070
diff
changeset
|
2374 |
7 | 2375 " Webmacro |
2376 au BufNewFile,BufRead *.wm setf webmacro | |
2377 | |
2378 " Wget config | |
2379 au BufNewFile,BufRead .wgetrc,wgetrc setf wget | |
2380 | |
2381 " Website MetaLanguage | |
2382 au BufNewFile,BufRead *.wml setf wml | |
2383 | |
2384 " Winbatch | |
2385 au BufNewFile,BufRead *.wbt setf winbatch | |
2386 | |
753 | 2387 " WSML |
2388 au BufNewFile,BufRead *.wsml setf wsml | |
2389 | |
7 | 2390 " WvDial |
2391 au BufNewFile,BufRead wvdial.conf,.wvdialrc setf wvdial | |
2392 | |
2393 " CVS RC file | |
2394 au BufNewFile,BufRead .cvsrc setf cvsrc | |
2395 | |
2396 " CVS commit file | |
2397 au BufNewFile,BufRead cvs\d\+ setf cvs | |
2398 | |
2399 " WEB (*.web is also used for Winbatch: Guess, based on expecting "%" comment | |
2400 " lines in a WEB file). | |
2401 au BufNewFile,BufRead *.web | |
2402 \ if getline(1)[0].getline(2)[0].getline(3)[0].getline(4)[0].getline(5)[0] =~ "%" | | |
2403 \ setf web | | |
2404 \ else | | |
2405 \ setf winbatch | | |
2406 \ endif | |
2407 | |
2408 " Windows Scripting Host and Windows Script Component | |
2409 au BufNewFile,BufRead *.ws[fc] setf wsh | |
2410 | |
1125 | 2411 " XHTML |
2412 au BufNewFile,BufRead *.xhtml,*.xht setf xhtml | |
2413 | |
7 | 2414 " X Pixmap (dynamically sets colors, use BufEnter to make it work better) |
2415 au BufEnter *.xpm | |
2416 \ if getline(1) =~ "XPM2" | | |
2417 \ setf xpm2 | | |
2418 \ else | | |
2419 \ setf xpm | | |
2420 \ endif | |
2421 au BufEnter *.xpm2 setf xpm2 | |
2422 | |
2423 " XFree86 config | |
2424 au BufNewFile,BufRead XF86Config | |
2425 \ if getline(1) =~ '\<XConfigurator\>' | | |
2788 | 2426 \ let b:xf86conf_xfree86_version = 3 | |
7 | 2427 \ endif | |
2428 \ setf xf86conf | |
2751 | 2429 au BufNewFile,BufRead */xorg.conf.d/*.conf |
2430 \ let b:xf86conf_xfree86_version = 4 | | |
2431 \ setf xf86conf | |
7 | 2432 |
2433 " Xorg config | |
2751 | 2434 au BufNewFile,BufRead xorg.conf,xorg.conf-4 let b:xf86conf_xfree86_version = 4 | setf xf86conf |
7 | 2435 |
375 | 2436 " Xinetd conf |
2751 | 2437 au BufNewFile,BufRead */etc/xinetd.conf setf xinetd |
375 | 2438 |
7 | 2439 " XS Perl extension interface language |
2440 au BufNewFile,BufRead *.xs setf xs | |
2441 | |
2442 " X resources file | |
2443 au BufNewFile,BufRead .Xdefaults,.Xpdefaults,.Xresources,xdm-config,*.ad setf xdefaults | |
2444 | |
2445 " Xmath | |
2446 au BufNewFile,BufRead *.msc,*.msf setf xmath | |
2447 au BufNewFile,BufRead *.ms | |
216 | 2448 \ if !s:FTnroff() | setf xmath | endif |
7 | 2449 |
1648 | 2450 " XML specific variants: docbk and xbl |
2451 au BufNewFile,BufRead *.xml call s:FTxml() | |
2452 | |
2453 func! s:FTxml() | |
2454 let n = 1 | |
2455 while n < 100 && n < line("$") | |
2456 let line = getline(n) | |
3967 | 2457 " DocBook 4 or DocBook 5. |
2458 let is_docbook4 = line =~ '<!DOCTYPE.*DocBook' | |
2459 let is_docbook5 = line =~ ' xmlns="http://docbook.org/ns/docbook"' | |
2460 if is_docbook4 || is_docbook5 | |
1648 | 2461 let b:docbk_type = "xml" |
3967 | 2462 if is_docbook5 |
2463 let b:docbk_ver = 5 | |
2464 else | |
2465 let b:docbk_ver = 4 | |
2466 endif | |
1648 | 2467 setf docbk |
2468 return | |
2469 endif | |
2470 if line =~ 'xmlns:xbl="http://www.mozilla.org/xbl"' | |
2471 setf xbl | |
2472 return | |
2473 endif | |
2474 let n += 1 | |
2475 endwhile | |
2476 setf xml | |
2477 endfunc | |
7 | 2478 |
2479 " XMI (holding UML models) is also XML | |
2480 au BufNewFile,BufRead *.xmi setf xml | |
2481 | |
2482 " CSPROJ files are Visual Studio.NET's XML-based project config files | |
2483 au BufNewFile,BufRead *.csproj,*.csproj.user setf xml | |
2484 | |
2485 " Qt Linguist translation source and Qt User Interface Files are XML | |
2486 au BufNewFile,BufRead *.ts,*.ui setf xml | |
2487 | |
1125 | 2488 " TPM's are RDF-based descriptions of TeX packages (Nikolai Weibull) |
2489 au BufNewFile,BufRead *.tpm setf xml | |
2490 | |
389 | 2491 " Xdg menus |
2751 | 2492 au BufNewFile,BufRead */etc/xdg/menus/*.menu setf xml |
389 | 2493 |
1648 | 2494 " ATI graphics driver configuration |
2495 au BufNewFile,BufRead fglrxrc setf xml | |
2496 | |
2497 " XLIFF (XML Localisation Interchange File Format) is also XML | |
2498 au BufNewFile,BufRead *.xlf setf xml | |
2499 au BufNewFile,BufRead *.xliff setf xml | |
2500 | |
3410
94601b379f38
Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents:
3356
diff
changeset
|
2501 " XML User Interface Language |
94601b379f38
Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents:
3356
diff
changeset
|
2502 au BufNewFile,BufRead *.xul setf xml |
94601b379f38
Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents:
3356
diff
changeset
|
2503 |
1648 | 2504 " X11 xmodmap (also see below) |
2505 au BufNewFile,BufRead *Xmodmap setf xmodmap | |
2506 | |
419 | 2507 " Xquery |
2508 au BufNewFile,BufRead *.xq,*.xql,*.xqm,*.xquery,*.xqy setf xquery | |
2509 | |
7 | 2510 " XSD |
2511 au BufNewFile,BufRead *.xsd setf xsd | |
2512 | |
2513 " Xslt | |
2514 au BufNewFile,BufRead *.xsl,*.xslt setf xslt | |
2515 | |
2516 " Yacc | |
5697 | 2517 au BufNewFile,BufRead *.yy,*.yxx,*.y++ setf yacc |
375 | 2518 |
2519 " Yacc or racc | |
2520 au BufNewFile,BufRead *.y call s:FTy() | |
2521 | |
1219 | 2522 func! s:FTy() |
375 | 2523 let n = 1 |
484 | 2524 while n < 100 && n < line("$") |
2525 let line = getline(n) | |
2526 if line =~ '^\s*%' | |
2527 setf yacc | |
2528 return | |
2529 endif | |
482 | 2530 if getline(n) =~ '^\s*\(#\|class\>\)' && getline(n) !~ '^\s*#\s*include' |
375 | 2531 setf racc |
2532 return | |
2533 endif | |
2534 let n = n + 1 | |
2535 endwhile | |
2536 setf yacc | |
1219 | 2537 endfunc |
375 | 2538 |
7 | 2539 |
2540 " Yaml | |
2541 au BufNewFile,BufRead *.yaml,*.yml setf yaml | |
2542 | |
3082 | 2543 " yum conf (close enough to dosini) |
4229 | 2544 au BufNewFile,BufRead */etc/yum.conf setf dosini |
3082 | 2545 |
3513 | 2546 " Zimbu |
4229 | 2547 au BufNewFile,BufRead *.zu setf zimbu |
6421 | 2548 " Zimbu Templates |
2549 au BufNewFile,BufRead *.zut setf zimbutempl | |
3513 | 2550 |
809 | 2551 " Zope |
2552 " dtml (zope dynamic template markup language), pt (zope page template), | |
2553 " cpt (zope form controller page template) | |
826 | 2554 au BufNewFile,BufRead *.dtml,*.pt,*.cpt call s:FThtml() |
809 | 2555 " zsql (zope sql method) |
2556 au BufNewFile,BufRead *.zsql call s:SQL() | |
2557 | |
7 | 2558 " Z80 assembler asz80 |
2559 au BufNewFile,BufRead *.z8a setf z8a | |
2560 | |
2561 augroup END | |
2562 | |
2563 | |
2564 " Source the user-specified filetype file, for backwards compatibility with | |
2565 " Vim 5.x. | |
216 | 2566 if exists("myfiletypefile") && filereadable(expand(myfiletypefile)) |
7 | 2567 execute "source " . myfiletypefile |
2568 endif | |
2569 | |
2570 | |
2571 " Check for "*" after loading myfiletypefile, so that scripts.vim is only used | |
2572 " when there are no matching file name extensions. | |
2573 " Don't do this for compressed files. | |
2574 augroup filetypedetect | |
2575 au BufNewFile,BufRead * | |
2576 \ if !did_filetype() && expand("<amatch>") !~ g:ft_ignore_pat | |
2577 \ | runtime! scripts.vim | endif | |
2578 au StdinReadPost * if !did_filetype() | runtime! scripts.vim | endif | |
2579 | |
2580 | |
2581 " Extra checks for when no filetype has been detected now. Mostly used for | |
2582 " patterns that end in "*". E.g., "zsh*" matches "zsh.vim", but that's a Vim | |
2583 " script file. | |
216 | 2584 " Most of these should call s:StarSetf() to avoid names ending in .gz and the |
2585 " like are used. | |
7 | 2586 |
2751 | 2587 " More Apache config files |
2588 au BufNewFile,BufRead access.conf*,apache.conf*,apache2.conf*,httpd.conf*,srm.conf* call s:StarSetf('apache') | |
2589 au BufNewFile,BufRead */etc/apache2/*.conf*,*/etc/apache2/conf.*/*,*/etc/apache2/mods-*/*,*/etc/apache2/sites-*/*,*/etc/httpd/conf.d/*.conf* call s:StarSetf('apache') | |
1668 | 2590 |
531 | 2591 " Asterisk config file |
856 | 2592 au BufNewFile,BufRead *asterisk/*.conf* call s:StarSetf('asterisk') |
794 | 2593 au BufNewFile,BufRead *asterisk*/*voicemail.conf* call s:StarSetf('asteriskvm') |
531 | 2594 |
1125 | 2595 " Bazaar version control |
2596 au BufNewFile,BufRead bzr_log.* setf bzr | |
2597 | |
7 | 2598 " BIND zone |
805 | 2599 au BufNewFile,BufRead */named/db.*,*/bind/db.* call s:StarSetf('bindzone') |
7 | 2600 |
2788 | 2601 " Calendar |
2602 au BufNewFile,BufRead */.calendar/*, | |
2603 \*/share/calendar/*/calendar.*,*/share/calendar/calendar.* | |
2604 \ call s:StarSetf('calendar') | |
2605 | |
7 | 2606 " Changelog |
216 | 2607 au BufNewFile,BufRead [cC]hange[lL]og* |
2608 \ if getline(1) =~ '; urgency=' | |
2609 \| call s:StarSetf('debchangelog') | |
2610 \|else | |
2611 \| call s:StarSetf('changelog') | |
2612 \|endif | |
7 | 2613 |
2614 " Crontab | |
2751 | 2615 au BufNewFile,BufRead crontab,crontab.*,*/etc/cron.d/* call s:StarSetf('crontab') |
816 | 2616 |
2788 | 2617 " dnsmasq(8) configuration |
2618 au BufNewFile,BufRead */etc/dnsmasq.d/* call s:StarSetf('dnsmasq') | |
2619 | |
7 | 2620 " Dracula |
216 | 2621 au BufNewFile,BufRead drac.* call s:StarSetf('dracula') |
7 | 2622 |
2623 " Fvwm | |
1125 | 2624 au BufNewFile,BufRead */.fvwm/* call s:StarSetf('fvwm') |
7 | 2625 au BufNewFile,BufRead *fvwmrc*,*fvwm95*.hook |
216 | 2626 \ let b:fvwm_version = 1 | call s:StarSetf('fvwm') |
7 | 2627 au BufNewFile,BufRead *fvwm2rc* |
216 | 2628 \ if expand("<afile>:e") == "m4" |
2629 \| call s:StarSetf('fvwm2m4') | |
2630 \|else | |
2631 \| let b:fvwm_version = 2 | call s:StarSetf('fvwm') | |
2632 \|endif | |
7 | 2633 |
2034 | 2634 " Gedcom |
2788 | 2635 au BufNewFile,BufRead */tmp/lltmp* call s:StarSetf('gedcom') |
2034 | 2636 |
7 | 2637 " GTK RC |
216 | 2638 au BufNewFile,BufRead .gtkrc*,gtkrc* call s:StarSetf('gtkrc') |
7 | 2639 |
2640 " Jam | |
216 | 2641 au BufNewFile,BufRead Prl*.*,JAM*.* call s:StarSetf('jam') |
7 | 2642 |
2643 " Jargon | |
2644 au! BufNewFile,BufRead *jarg* | |
216 | 2645 \ if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'THIS IS THE JARGON FILE' |
2646 \| call s:StarSetf('jargon') | |
2647 \|endif | |
7 | 2648 |
837 | 2649 " Kconfig |
2650 au BufNewFile,BufRead Kconfig.* call s:StarSetf('kconfig') | |
2651 | |
2788 | 2652 " Lilo: Linux loader |
2653 au BufNewFile,BufRead lilo.conf* call s:StarSetf('lilo') | |
2654 | |
2434
86532ee3ea41
Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2415
diff
changeset
|
2655 " Logcheck |
2751 | 2656 au BufNewFile,BufRead */etc/logcheck/*.d*/* call s:StarSetf('logcheck') |
2434
86532ee3ea41
Updated runtime files. Add logcheck filetype plugin. (James Vega)
Bram Moolenaar <bram@vim.org>
parents:
2415
diff
changeset
|
2657 |
7 | 2658 " Makefile |
216 | 2659 au BufNewFile,BufRead [mM]akefile* call s:StarSetf('make') |
7 | 2660 |
1648 | 2661 " Ruby Makefile |
2662 au BufNewFile,BufRead [rR]akefile* call s:StarSetf('ruby') | |
2663 | |
2664 " Mail (also matches muttrc.vim, so this is below the other checks) | |
5277 | 2665 au BufNewFile,BufRead mutt[[:alnum:]._-]\\\{6\} setf mail |
1648 | 2666 |
9555
9560a5b782ee
commit https://github.com/vim/vim/commit/42ebd066422d73cdb7bda6a1dc828a3dd022dec8
Christian Brabandt <cb@256bit.org>
parents:
9533
diff
changeset
|
2667 au BufNewFile,BufRead reportbug-* call s:StarSetf('mail') |
9560a5b782ee
commit https://github.com/vim/vim/commit/42ebd066422d73cdb7bda6a1dc828a3dd022dec8
Christian Brabandt <cb@256bit.org>
parents:
9533
diff
changeset
|
2668 |
389 | 2669 " Modconf |
2788 | 2670 au BufNewFile,BufRead */etc/modutils/* |
2671 \ if executable(expand("<afile>")) != 1 | |
2672 \| call s:StarSetf('modconf') | |
2673 \|endif | |
2751 | 2674 au BufNewFile,BufRead */etc/modprobe.* call s:StarSetf('modconf') |
389 | 2675 |
7 | 2676 " Mutt setup file |
1648 | 2677 au BufNewFile,BufRead .mutt{ng,}rc*,*/.mutt{ng,}/mutt{ng,}rc* call s:StarSetf('muttrc') |
484 | 2678 au BufNewFile,BufRead mutt{ng,}rc*,Mutt{ng,}rc* call s:StarSetf('muttrc') |
7 | 2679 |
2680 " Nroff macros | |
216 | 2681 au BufNewFile,BufRead tmac.* call s:StarSetf('nroff') |
7 | 2682 |
10348
c78513465e6e
commit https://github.com/vim/vim/commit/25de4c232d580583feadae11ab34e3cc6333c350
Christian Brabandt <cb@256bit.org>
parents:
10319
diff
changeset
|
2683 " OpenBSD hostname.if |
c78513465e6e
commit https://github.com/vim/vim/commit/25de4c232d580583feadae11ab34e3cc6333c350
Christian Brabandt <cb@256bit.org>
parents:
10319
diff
changeset
|
2684 au BufNewFile,BufRead /etc/hostname.* call s:StarSetf('config') |
c78513465e6e
commit https://github.com/vim/vim/commit/25de4c232d580583feadae11ab34e3cc6333c350
Christian Brabandt <cb@256bit.org>
parents:
10319
diff
changeset
|
2685 |
375 | 2686 " Pam conf |
2751 | 2687 au BufNewFile,BufRead */etc/pam.d/* call s:StarSetf('pamconf') |
375 | 2688 |
7 | 2689 " Printcap and Termcap |
2690 au BufNewFile,BufRead *printcap* | |
216 | 2691 \ if !did_filetype() |
2692 \| let b:ptcap_type = "print" | call s:StarSetf('ptcap') | |
2693 \|endif | |
7 | 2694 au BufNewFile,BufRead *termcap* |
216 | 2695 \ if !did_filetype() |
2696 \| let b:ptcap_type = "term" | call s:StarSetf('ptcap') | |
2697 \|endif | |
7 | 2698 |
4278 | 2699 " ReDIF |
2700 " Only used when the .rdf file was not detected to be XML. | |
2701 au BufRead,BufNewFile *.rdf call s:Redif() | |
2702 func! s:Redif() | |
2703 let lnum = 1 | |
2704 while lnum <= 5 && lnum < line('$') | |
2705 if getline(lnum) =~ "^\ctemplate-type:" | |
2706 setf redif | |
2707 return | |
2708 endif | |
2709 let lnum = lnum + 1 | |
2710 endwhile | |
2711 endfunc | |
2712 | |
2788 | 2713 " Remind |
2714 au BufNewFile,BufRead .reminders* call s:StarSetf('remind') | |
2715 | |
7 | 2716 " Vim script |
216 | 2717 au BufNewFile,BufRead *vimrc* call s:StarSetf('vim') |
7 | 2718 |
2719 " Subversion commit file | |
45 | 2720 au BufNewFile,BufRead svn-commit*.tmp setf svn |
7 | 2721 |
2722 " X resources file | |
216 | 2723 au BufNewFile,BufRead Xresources*,*/app-defaults/*,*/Xresources/* call s:StarSetf('xdefaults') |
7 | 2724 |
2725 " XFree86 config | |
2726 au BufNewFile,BufRead XF86Config-4* | |
2751 | 2727 \ let b:xf86conf_xfree86_version = 4 | call s:StarSetf('xf86conf') |
7 | 2728 au BufNewFile,BufRead XF86Config* |
216 | 2729 \ if getline(1) =~ '\<XConfigurator\>' |
2751 | 2730 \| let b:xf86conf_xfree86_version = 3 |
216 | 2731 \|endif |
2732 \|call s:StarSetf('xf86conf') | |
7 | 2733 |
2734 " X11 xmodmap | |
216 | 2735 au BufNewFile,BufRead *xmodmap* call s:StarSetf('xmodmap') |
7 | 2736 |
375 | 2737 " Xinetd conf |
2751 | 2738 au BufNewFile,BufRead */etc/xinetd.d/* call s:StarSetf('xinetd') |
375 | 2739 |
3082 | 2740 " yum conf (close enough to dosini) |
4229 | 2741 au BufNewFile,BufRead */etc/yum.repos.d/* call s:StarSetf('dosini') |
3082 | 2742 |
7 | 2743 " Z-Shell script |
216 | 2744 au BufNewFile,BufRead zsh*,zlog* call s:StarSetf('zsh') |
7 | 2745 |
2746 | |
3237 | 2747 " Plain text files, needs to be far down to not override others. This avoids |
2748 " the "conf" type being used if there is a line starting with '#'. | |
6051 | 2749 au BufNewFile,BufRead *.txt,*.text,README setf text |
3237 | 2750 |
2013 | 2751 |
2752 " Use the filetype detect plugins. They may overrule any of the previously | |
2753 " detected filetypes. | |
2754 runtime! ftdetect/*.vim | |
2755 | |
3326 | 2756 " NOTE: The above command could have ended the filetypedetect autocmd group |
3356 | 2757 " and started another one. Let's make sure it has ended to get to a consistent |
3326 | 2758 " state. |
2759 augroup END | |
2013 | 2760 |
7 | 2761 " Generic configuration file (check this last, it's just guessing!) |
3326 | 2762 au filetypedetect BufNewFile,BufRead,StdinReadPost * |
7 | 2763 \ if !did_filetype() && expand("<amatch>") !~ g:ft_ignore_pat |
2764 \ && (getline(1) =~ '^#' || getline(2) =~ '^#' || getline(3) =~ '^#' | |
2765 \ || getline(4) =~ '^#' || getline(5) =~ '^#') | | |
2766 \ setf conf | | |
2767 \ endif | |
2768 | |
2769 | |
2770 " If the GUI is already running, may still need to install the Syntax menu. | |
2771 " Don't do it when the 'M' flag is included in 'guioptions'. | |
2772 if has("menu") && has("gui_running") | |
2773 \ && !exists("did_install_syntax_menu") && &guioptions !~# "M" | |
2774 source <sfile>:p:h/menu.vim | |
2775 endif | |
2776 | |
1219 | 2777 " Function called for testing all functions defined here. These are |
2778 " script-local, thus need to be executed here. | |
2779 " Returns a string with error messages (hopefully empty). | |
2780 func! TestFiletypeFuncs(testlist) | |
2781 let output = '' | |
2782 for f in a:testlist | |
2783 try | |
2784 exe f | |
2785 catch | |
2786 let output = output . "\n" . f . ": " . v:exception | |
2787 endtry | |
2788 endfor | |
2789 return output | |
2790 endfunc | |
2791 | |
7 | 2792 " Restore 'cpoptions' |
2793 let &cpo = s:cpo_save | |
2794 unlet s:cpo_save |