7
|
1 " Vim support file to detect file types
|
|
2 "
|
|
3 " Maintainer: Bram Moolenaar <Bram@vim.org>
|
837
|
4 " Last Change: 2006 Apr 19
|
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
|
532
|
19 au BufNewFile,BufRead ?\+.orig,?\+.bak,?\+.old,?\+.new,?\+.rpmsave,?\+.rpmnew
|
7
|
20 \ exe "doau filetypedetect BufRead " . expand("<afile>:r")
|
|
21 au BufNewFile,BufRead *~
|
|
22 \ let s:name = expand("<afile>") |
|
|
23 \ let s:short = substitute(s:name, '\~$', '', '') |
|
|
24 \ if s:name != s:short && s:short != "" |
|
|
25 \ exe "doau filetypedetect BufRead " . s:short |
|
|
26 \ endif |
|
|
27 \ unlet s:name |
|
|
28 \ unlet s:short
|
532
|
29 au BufNewFile,BufRead ?\+.in
|
7
|
30 \ if expand("<afile>:t") != "configure.in" |
|
|
31 \ exe "doau filetypedetect BufRead " . expand("<afile>:r") |
|
|
32 \ endif
|
|
33
|
|
34 " Pattern used to match file names which should not be inspected.
|
|
35 " Currently finds compressed files.
|
|
36 if !exists("g:ft_ignore_pat")
|
|
37 let g:ft_ignore_pat = '\.\(Z\|gz\|bz2\|zip\|tgz\)$'
|
|
38 endif
|
|
39
|
216
|
40 " Function used for patterns that end in a star: don't set the filetype if the
|
|
41 " file name matches ft_ignore_pat.
|
|
42 fun! s:StarSetf(ft)
|
|
43 if expand("<amatch>") !~ g:ft_ignore_pat
|
|
44 exe 'setf ' . a:ft
|
|
45 endif
|
|
46 endfun
|
|
47
|
7
|
48 " Abaqus or Trasys
|
216
|
49 au BufNewFile,BufRead *.inp call s:Check_inp()
|
7
|
50
|
216
|
51 fun! s:Check_inp()
|
7
|
52 if getline(1) =~ '^\*'
|
|
53 setf abaqus
|
|
54 else
|
|
55 let n = 1
|
|
56 if line("$") > 500
|
|
57 let nmax = 500
|
|
58 else
|
|
59 let nmax = line("$")
|
|
60 endif
|
|
61 while n <= nmax
|
|
62 if getline(n) =~? "^header surface data"
|
|
63 setf trasys
|
|
64 break
|
|
65 endif
|
|
66 let n = n + 1
|
|
67 endwhile
|
|
68 endif
|
|
69 endfun
|
|
70
|
|
71 " A-A-P recipe
|
|
72 au BufNewFile,BufRead *.aap setf aap
|
|
73
|
389
|
74 " A2ps printing utility
|
|
75 au BufNewFile,BufRead etc/a2ps.cfg,etc/a2ps/*.cfg,a2psrc,.a2psrc setf a2ps
|
|
76
|
22
|
77 " ABAB/4
|
|
78 au BufNewFile,BufRead *.abap setf abap
|
|
79
|
7
|
80 " ABC music notation
|
|
81 au BufNewFile,BufRead *.abc setf abc
|
|
82
|
|
83 " ABEL
|
|
84 au BufNewFile,BufRead *.abl setf abel
|
|
85
|
|
86 " AceDB
|
|
87 au BufNewFile,BufRead *.wrm setf acedb
|
|
88
|
|
89 " Ada (83, 9X, 95)
|
|
90 au BufNewFile,BufRead *.adb,*.ads,*.ada setf ada
|
|
91
|
|
92 " AHDL
|
|
93 au BufNewFile,BufRead *.tdf setf ahdl
|
|
94
|
|
95 " AMPL
|
|
96 au BufNewFile,BufRead *.run setf ampl
|
|
97
|
|
98 " Ant
|
|
99 au BufNewFile,BufRead build.xml setf ant
|
|
100
|
|
101 " Apache style config file
|
216
|
102 au BufNewFile,BufRead proftpd.conf* call s:StarSetf('apachestyle')
|
7
|
103
|
|
104 " Apache config file
|
216
|
105 au BufNewFile,BufRead .htaccess setf apache
|
|
106 au BufNewFile,BufRead httpd.conf*,srm.conf*,access.conf*,apache.conf*,apache2.conf*,/etc/apache2/*.conf* call s:StarSetf('apache')
|
7
|
107
|
|
108 " XA65 MOS6510 cross assembler
|
|
109 au BufNewFile,BufRead *.a65 setf a65
|
|
110
|
|
111 " Applix ELF
|
|
112 au BufNewFile,BufRead *.am
|
|
113 \ if expand("<afile>") !~? 'Makefile.am\>' | setf elf | endif
|
|
114
|
24
|
115 " ALSA configuration
|
|
116 au BufNewFile,BufRead ~/.asoundrc,/usr/share/alsa/alsa.conf,/etc/asound.conf setf alsaconf
|
|
117
|
7
|
118 " Arc Macro Language
|
|
119 au BufNewFile,BufRead *.aml setf aml
|
|
120
|
|
121 " Arch Inventory file
|
|
122 au BufNewFile,BufRead .arch-inventory,=tagging-method setf arch
|
|
123
|
|
124 " ART*Enterprise (formerly ART-IM)
|
|
125 au BufNewFile,BufRead *.art setf art
|
|
126
|
|
127 " ASN.1
|
|
128 au BufNewFile,BufRead *.asn,*.asn1 setf asn
|
|
129
|
|
130 " Active Server Pages (with Visual Basic Script)
|
|
131 au BufNewFile,BufRead *.asa
|
|
132 \ if exists("g:filetype_asa") |
|
|
133 \ exe "setf " . g:filetype_asa |
|
|
134 \ else |
|
|
135 \ setf aspvbs |
|
|
136 \ endif
|
|
137
|
|
138 " Active Server Pages (with Perl or Visual Basic Script)
|
|
139 au BufNewFile,BufRead *.asp
|
|
140 \ if exists("g:filetype_asp") |
|
|
141 \ exe "setf " . g:filetype_asp |
|
|
142 \ elseif getline(1) . getline(2) . getline(3) =~? "perlscript" |
|
|
143 \ setf aspperl |
|
|
144 \ else |
|
|
145 \ setf aspvbs |
|
|
146 \ endif
|
|
147
|
|
148 " Grub (must be before catch *.lst)
|
819
|
149 au BufNewFile,BufRead /boot/grub/menu.lst,/boot/grub/grub.conf,/etc/grub.conf setf grub
|
7
|
150
|
|
151 " Assembly (all kinds)
|
|
152 " *.lst is not pure assembly, it has two extra columns (address, byte codes)
|
216
|
153 au BufNewFile,BufRead *.asm,*.[sS],*.[aA],*.mac,*.lst call s:FTasm()
|
7
|
154
|
|
155 " This function checks for the kind of assembly that is wanted by the user, or
|
|
156 " can be detected from the first five lines of the file.
|
216
|
157 fun! s:FTasm()
|
7
|
158 " make sure b:asmsyntax exists
|
|
159 if !exists("b:asmsyntax")
|
|
160 let b:asmsyntax = ""
|
|
161 endif
|
|
162
|
|
163 if b:asmsyntax == ""
|
216
|
164 call s:FTasmsyntax()
|
7
|
165 endif
|
|
166
|
|
167 " if b:asmsyntax still isn't set, default to asmsyntax or GNU
|
|
168 if b:asmsyntax == ""
|
|
169 if exists("g:asmsyntax")
|
|
170 let b:asmsyntax = g:asmsyntax
|
|
171 else
|
|
172 let b:asmsyntax = "asm"
|
|
173 endif
|
|
174 endif
|
|
175
|
|
176 exe "setf " . b:asmsyntax
|
|
177 endfun
|
|
178
|
216
|
179 fun! s:FTasmsyntax()
|
7
|
180 " see if file contains any asmsyntax=foo overrides. If so, change
|
|
181 " b:asmsyntax appropriately
|
|
182 let head = " ".getline(1)." ".getline(2)." ".getline(3)." ".getline(4).
|
|
183 \" ".getline(5)." "
|
|
184 if head =~ '\sasmsyntax=\S\+\s'
|
|
185 let b:asmsyntax = substitute(head, '.*\sasmsyntax=\(\S\+\)\s.*','\1', "")
|
|
186 elseif ((head =~? '\.title') || (head =~? '\.ident') || (head =~? '\.macro') || (head =~? '\.subtitle') || (head =~? '\.library'))
|
|
187 let b:asmsyntax = "vmasm"
|
|
188 endif
|
|
189 endfun
|
|
190
|
|
191 " Macro (VAX)
|
|
192 au BufNewFile,BufRead *.mar setf vmasm
|
|
193
|
|
194 " Atlas
|
|
195 au BufNewFile,BufRead *.atl,*.as setf atlas
|
|
196
|
|
197 " Automake
|
809
|
198 au BufNewFile,BufRead [mM]akefile.am,GNUmakefile.am setf automake
|
7
|
199
|
375
|
200 " Autotest .at files are actually m4
|
|
201 au BufNewFile,BufRead *.at setf m4
|
|
202
|
7
|
203 " Avenue
|
|
204 au BufNewFile,BufRead *.ave setf ave
|
|
205
|
|
206 " Awk
|
|
207 au BufNewFile,BufRead *.awk setf awk
|
|
208
|
|
209 " B
|
|
210 au BufNewFile,BufRead *.mch,*.ref,*.imp setf b
|
|
211
|
|
212 " BASIC or Visual Basic
|
216
|
213 au BufNewFile,BufRead *.bas call s:FTVB("basic")
|
7
|
214
|
|
215 " Check if one of the first five lines contains "VB_Name". In that case it is
|
|
216 " probably a Visual Basic file. Otherwise it's assumed to be "alt" filetype.
|
216
|
217 fun! s:FTVB(alt)
|
7
|
218 if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'VB_Name\|Begin VB\.\(Form\|MDIForm\|UserControl\)'
|
|
219 setf vb
|
|
220 else
|
|
221 exe "setf " . a:alt
|
|
222 endif
|
|
223 endfun
|
|
224
|
|
225 " Visual Basic Script (close to Visual Basic)
|
|
226 au BufNewFile,BufRead *.vbs,*.dsm,*.ctl setf vb
|
|
227
|
|
228 " Batch file for MSDOS.
|
15
|
229 au BufNewFile,BufRead *.bat,*.sys setf dosbatch
|
7
|
230 " *.cmd is close to a Batch file, but on OS/2 Rexx files also use *.cmd.
|
|
231 au BufNewFile,BufRead *.cmd
|
|
232 \ if getline(1) =~ '^/\*' | setf rexx | else | setf dosbatch | endif
|
|
233
|
|
234 " Batch file for 4DOS
|
216
|
235 au BufNewFile,BufRead *.btm call s:FTbtm()
|
|
236 fun! s:FTbtm()
|
15
|
237 if exists("g:dosbatch_syntax_for_btm") && g:dosbatch_syntax_for_btm
|
|
238 setf dosbatch
|
|
239 else
|
|
240 setf btm
|
|
241 endif
|
|
242 endfun
|
7
|
243
|
|
244 " BC calculator
|
|
245 au BufNewFile,BufRead *.bc setf bc
|
|
246
|
|
247 " BDF font
|
|
248 au BufNewFile,BufRead *.bdf setf bdf
|
|
249
|
|
250 " BibTeX bibliography database file
|
|
251 au BufNewFile,BufRead *.bib setf bib
|
|
252
|
|
253 " BIND configuration
|
45
|
254 au BufNewFile,BufRead named.conf,rndc.conf setf named
|
7
|
255
|
|
256 " BIND zone
|
|
257 au BufNewFile,BufRead named.root setf bindzone
|
805
|
258 au BufNewFile,BufRead *.db call s:BindzoneCheck('')
|
|
259
|
|
260 func! s:BindzoneCheck(default)
|
|
261 if getline(1).getline(2).getline(3).getline(4) =~ '^; <<>> DiG [0-9.]\+ <<>>\|BIND.*named\|$ORIGIN\|$TTL\|IN\s\+SOA'
|
|
262 setf bindzone
|
|
263 elseif a:default != ''
|
|
264 exe 'setf ' . a:default
|
|
265 endif
|
|
266 endfunc
|
7
|
267
|
|
268 " Blank
|
|
269 au BufNewFile,BufRead *.bl setf blank
|
|
270
|
|
271 " C or lpc
|
216
|
272 au BufNewFile,BufRead *.c call s:FTlpc()
|
7
|
273
|
216
|
274 fun! s:FTlpc()
|
7
|
275 if exists("g:lpc_syntax_for_c")
|
|
276 let lnum = 1
|
|
277 while lnum <= 12
|
|
278 if getline(lnum) =~# '^\(//\|inherit\|private\|protected\|nosave\|string\|object\|mapping\|mixed\)'
|
|
279 setf lpc
|
|
280 return
|
|
281 endif
|
|
282 let lnum = lnum + 1
|
|
283 endwhile
|
|
284 endif
|
|
285 setf c
|
|
286 endfun
|
|
287
|
|
288 " Calendar
|
216
|
289 au BufNewFile,BufRead calendar setf calendar
|
|
290 au BufNewFile,BufRead */.calendar/*,
|
7
|
291 \*/share/calendar/*/calendar.*,*/share/calendar/calendar.*
|
216
|
292 \ call s:StarSetf('calendar')
|
7
|
293
|
|
294 " C#
|
|
295 au BufNewFile,BufRead *.cs setf cs
|
|
296
|
555
|
297 " Cfengine
|
|
298 au BufNewFile,BufRead cfengine.conf setf cfengine
|
|
299
|
7
|
300 " Comshare Dimension Definition Language
|
|
301 au BufNewFile,BufRead *.cdl setf cdl
|
|
302
|
|
303 " Controllable Regex Mutilator
|
|
304 au BufNewFile,BufRead *.crm setf crm
|
|
305
|
|
306 " Cyn++
|
|
307 au BufNewFile,BufRead *.cyn setf cynpp
|
|
308
|
|
309 " Cynlib
|
|
310 " .cc and .cpp files can be C++ or Cynlib.
|
|
311 au BufNewFile,BufRead *.cc
|
|
312 \ if exists("cynlib_syntax_for_cc")|setf cynlib|else|setf cpp|endif
|
|
313 au BufNewFile,BufRead *.cpp
|
|
314 \ if exists("cynlib_syntax_for_cpp")|setf cynlib|else|setf cpp|endif
|
|
315
|
|
316 " C++
|
|
317 if has("fname_case")
|
|
318 au BufNewFile,BufRead *.cxx,*.c++,*.C,*.H,*.hh,*.hxx,*.hpp,*.moc,*.tcc,*.inl setf cpp
|
|
319 else
|
|
320 au BufNewFile,BufRead *.cxx,*.c++,*.hh,*.hxx,*.hpp,*.moc,*.tcc,*.inl setf cpp
|
|
321 endif
|
|
322
|
|
323 " .h files can be C, Ch or C++, set c_syntax_for_h if you want C,
|
|
324 " ch_syntax_for_h if you want Ch.
|
|
325 au BufNewFile,BufRead *.h
|
|
326 \ if exists("c_syntax_for_h") | setf c |
|
|
327 \ elseif exists("ch_syntax_for_h") | setf ch |
|
|
328 \ else | setf cpp | endif
|
|
329
|
|
330 " Ch (CHscript)
|
|
331 au BufNewFile,BufRead *.chf setf ch
|
|
332
|
|
333 " TLH files are C++ headers generated by Visual C++'s #import from typelibs
|
|
334 au BufNewFile,BufRead *.tlh setf cpp
|
|
335
|
|
336 " Cascading Style Sheets
|
|
337 au BufNewFile,BufRead *.css setf css
|
|
338
|
|
339 " Century Term Command Scripts (*.cmd too)
|
|
340 au BufNewFile,BufRead *.con setf cterm
|
|
341
|
|
342 " Changelog
|
809
|
343 au BufNewFile,BufRead changelog.Debian,changelog.dch,NEWS.Debian,NEWS.dch
|
|
344 \ setf debchangelog
|
|
345
|
|
346 au BufNewFile,BufRead [cC]hange[lL]og
|
|
347 \ if getline(1) =~ '; urgency='
|
|
348 \| setf debchangelog
|
|
349 \| else
|
|
350 \| setf changelog
|
|
351 \| endif
|
|
352
|
|
353 au BufNewFile,BufRead NEWS
|
|
354 \ if getline(1) =~ '; urgency='
|
|
355 \| setf debchangelog
|
|
356 \| endif
|
7
|
357
|
|
358 " CHILL
|
|
359 au BufNewFile,BufRead *..ch setf chill
|
|
360
|
|
361 " Changes for WEB and CWEB or CHILL
|
216
|
362 au BufNewFile,BufRead *.ch call s:FTchange()
|
7
|
363
|
|
364 " This function checks if one of the first ten lines start with a '@'. In
|
|
365 " that case it is probably a change file.
|
|
366 " If the first line starts with # or ! it's probably a ch file.
|
|
367 " If a line has "main", "include", "//" ir "/*" it's probably ch.
|
|
368 " Otherwise CHILL is assumed.
|
216
|
369 fun! s:FTchange()
|
7
|
370 let lnum = 1
|
|
371 while lnum <= 10
|
|
372 if getline(lnum)[0] == '@'
|
|
373 setf change
|
|
374 return
|
|
375 endif
|
|
376 if lnum == 1 && (getline(1)[0] == '#' || getline(1)[0] == '!')
|
|
377 setf ch
|
|
378 return
|
|
379 endif
|
|
380 if getline(lnum) =~ "MODULE"
|
|
381 setf chill
|
|
382 return
|
|
383 endif
|
|
384 if getline(lnum) =~ 'main\s*(\|#\s*include\|//'
|
|
385 setf ch
|
|
386 return
|
|
387 endif
|
|
388 let lnum = lnum + 1
|
|
389 endwhile
|
|
390 setf chill
|
|
391 endfun
|
|
392
|
|
393 " Clean
|
|
394 au BufNewFile,BufRead *.dcl,*.icl setf clean
|
|
395
|
|
396 " Clever
|
|
397 au BufNewFile,BufRead *.eni setf cl
|
|
398
|
|
399 " Clever or dtd
|
216
|
400 au BufNewFile,BufRead *.ent call s:FTent()
|
7
|
401
|
216
|
402 fun! s:FTent()
|
7
|
403 " This function checks for valid cl syntax in the first five lines.
|
|
404 " Look for either an opening comment, '#', or a block start, '{".
|
|
405 " If not found, assume SGML.
|
|
406 let lnum = 1
|
|
407 while lnum < 6
|
|
408 let line = getline(lnum)
|
|
409 if line =~ '^\s*[#{]'
|
|
410 setf cl
|
|
411 return
|
|
412 elseif line !~ '^\s*$'
|
|
413 " Not a blank line, not a comment, and not a block start,
|
|
414 " so doesn't look like valid cl code.
|
|
415 break
|
|
416 endif
|
|
417 let lnum = lnum + 1
|
|
418 endw
|
|
419 setf dtd
|
|
420 endfun
|
|
421
|
625
|
422 " Clipper (or FoxPro; could also be eviews)
|
7
|
423 au BufNewFile,BufRead *.prg
|
|
424 \ if exists("g:filetype_prg") |
|
|
425 \ exe "setf " . g:filetype_prg |
|
|
426 \ else |
|
|
427 \ setf clipper |
|
|
428 \ endif
|
|
429
|
836
|
430 " Cmake
|
|
431 au BufNewFile,BufRead CMakeLists.txt,*.cmake,*.cmake.in setf cmake
|
|
432
|
7
|
433 " Cobol
|
809
|
434 au BufNewFile,BufRead *.cbl,*.cob,*.lib setf cobol
|
|
435 " cobol or zope form controller python script? (heuristic)
|
|
436 au BufNewFile,BufRead *.cpy
|
|
437 \ if getline(1) =~ '^##' |
|
|
438 \ setf python |
|
|
439 \ else |
|
|
440 \ setf cobol |
|
|
441 \ endif
|
7
|
442
|
|
443 " Cold Fusion
|
|
444 au BufNewFile,BufRead *.cfm,*.cfi,*.cfc setf cf
|
|
445
|
|
446 " Configure scripts
|
|
447 au BufNewFile,BufRead configure.in,configure.ac setf config
|
|
448
|
|
449 " WildPackets EtherPeek Decoder
|
|
450 au BufNewFile,BufRead *.dcd setf dcd
|
|
451
|
|
452 " Enlightenment configuration files
|
|
453 au BufNewFile,BufRead *enlightenment/*.cfg setf c
|
|
454
|
|
455 " Eterm
|
|
456 au BufNewFile,BufRead *Eterm/*.cfg setf eterm
|
|
457
|
|
458 " Lynx config files
|
|
459 au BufNewFile,BufRead lynx.cfg setf lynx
|
|
460
|
|
461 " Quake
|
|
462 au BufNewFile,BufRead *baseq[2-3]/*.cfg,*id1/*.cfg setf quake
|
|
463 au BufNewFile,BufRead *quake[1-3]/*.cfg setf quake
|
|
464
|
|
465 " Quake C
|
|
466 au BufNewFile,BufRead *.qc setf c
|
|
467
|
|
468 " Configure files
|
|
469 au BufNewFile,BufRead *.cfg setf cfg
|
|
470
|
|
471 " Communicating Sequential Processes
|
|
472 au BufNewFile,BufRead *.csp,*.fdr setf csp
|
|
473
|
|
474 " CUPL logic description and simulation
|
|
475 au BufNewFile,BufRead *.pld setf cupl
|
|
476 au BufNewFile,BufRead *.si setf cuplsim
|
|
477
|
|
478 " Debian Control
|
|
479 au BufNewFile,BufRead */debian/control setf debcontrol
|
|
480
|
816
|
481 " Debian Sources.list
|
|
482 au BufNewFile,BufRead /etc/apt/sources.list setf debsources
|
|
483
|
7
|
484 " ROCKLinux package description
|
|
485 au BufNewFile,BufRead *.desc setf desc
|
|
486
|
|
487 " the D language
|
|
488 au BufNewFile,BufRead *.d setf d
|
|
489
|
|
490 " Desktop files
|
|
491 au BufNewFile,BufRead *.desktop,.directory setf desktop
|
|
492
|
389
|
493 " Dict config
|
|
494 au BufNewFile,BufRead dict.conf,.dictrc setf dictconf
|
|
495
|
|
496 " Dictd config
|
|
497 au BufNewFile,BufRead dictd.conf setf dictdconf
|
|
498
|
7
|
499 " Diff files
|
|
500 au BufNewFile,BufRead *.diff,*.rej,*.patch setf diff
|
|
501
|
|
502 " Dircolors
|
|
503 au BufNewFile,BufRead .dir_colors,/etc/DIR_COLORS setf dircolors
|
|
504
|
|
505 " Diva (with Skill) or InstallShield
|
|
506 au BufNewFile,BufRead *.rul
|
|
507 \ if getline(1).getline(2).getline(3).getline(4).getline(5).getline(6) =~? 'InstallShield' |
|
|
508 \ setf ishd |
|
|
509 \ else |
|
|
510 \ setf diva |
|
|
511 \ endif
|
|
512
|
|
513 " DCL (Digital Command Language - vms) or DNS zone file
|
805
|
514 au BufNewFile,BufRead *.com call s:BindzoneCheck('dcl')
|
7
|
515
|
|
516 " DOT
|
|
517 au BufNewFile,BufRead *.dot setf dot
|
|
518
|
|
519 " Dylan - lid files
|
|
520 au BufNewFile,BufRead *.lid setf dylanlid
|
|
521
|
|
522 " Dylan - intr files (melange)
|
|
523 au BufNewFile,BufRead *.intr setf dylanintr
|
|
524
|
|
525 " Dylan
|
|
526 au BufNewFile,BufRead *.dylan setf dylan
|
|
527
|
|
528 " Microsoft Module Definition
|
|
529 au BufNewFile,BufRead *.def setf def
|
|
530
|
|
531 " Dracula
|
|
532 au BufNewFile,BufRead *.drac,*.drc,*lvs,*lpe setf dracula
|
|
533
|
|
534 " dsl
|
|
535 au BufNewFile,BufRead *.dsl setf dsl
|
|
536
|
|
537 " DTD (Document Type Definition for XML)
|
|
538 au BufNewFile,BufRead *.dtd setf dtd
|
|
539
|
|
540 " EDIF (*.edf,*.edif,*.edn,*.edo)
|
|
541 au BufNewFile,BufRead *.ed\(f\|if\|n\|o\) setf edif
|
|
542
|
|
543 " Embedix Component Description
|
|
544 au BufNewFile,BufRead *.ecd setf ecd
|
|
545
|
|
546 " Eiffel or Specman
|
216
|
547 au BufNewFile,BufRead *.e,*.E call s:FTe()
|
7
|
548
|
|
549 " Elinks configuration
|
|
550 au BufNewFile,BufRead */etc/elinks.conf,*/.elinks/elinks.conf setf elinks
|
|
551
|
216
|
552 fun! s:FTe()
|
7
|
553 let n = 1
|
|
554 while n < 100 && n < line("$")
|
|
555 if getline(n) =~ "^\\s*\\(<'\\|'>\\)\\s*$"
|
|
556 setf specman
|
|
557 return
|
|
558 endif
|
|
559 let n = n + 1
|
|
560 endwhile
|
|
561 setf eiffel
|
|
562 endfun
|
|
563
|
|
564 " ERicsson LANGuage
|
|
565 au BufNewFile,BufRead *.erl setf erlang
|
|
566
|
|
567 " Elm Filter Rules file
|
|
568 au BufNewFile,BufRead filter-rules setf elmfilt
|
|
569
|
168
|
570 " ESMTP rc file
|
|
571 au BufNewFile,BufRead *esmtprc setf esmtprc
|
|
572
|
7
|
573 " ESQL-C
|
|
574 au BufNewFile,BufRead *.ec,*.EC setf esqlc
|
|
575
|
278
|
576 " Esterel
|
|
577 au BufNewFile,BufRead *.strl setf esterel
|
|
578
|
7
|
579 " Essbase script
|
|
580 au BufNewFile,BufRead *.csc setf csc
|
|
581
|
|
582 " Exim
|
|
583 au BufNewFile,BufRead exim.conf setf exim
|
|
584
|
|
585 " Expect
|
|
586 au BufNewFile,BufRead *.exp setf expect
|
|
587
|
|
588 " Exports
|
|
589 au BufNewFile,BufRead exports setf exports
|
|
590
|
333
|
591 " Factor
|
|
592 au BufNewFile,BufRead *.factor setf factor
|
|
593
|
7
|
594 " Fetchmail RC file
|
|
595 au BufNewFile,BufRead .fetchmailrc setf fetchmail
|
|
596
|
|
597 " Focus Executable
|
|
598 au BufNewFile,BufRead *.fex,*.focexec setf focexec
|
|
599
|
|
600 " Focus Master file (but not for auto.master)
|
|
601 au BufNewFile,BufRead auto.master setf conf
|
|
602 au BufNewFile,BufRead *.mas,*.master setf master
|
|
603
|
|
604 " Forth
|
|
605 au BufNewFile,BufRead *.fs,*.ft setf forth
|
|
606
|
|
607 " Fortran
|
819
|
608 au BufNewFile,BufRead *.f,*.F,*.for,*.fpp,*.FPP,*.ftn,*.f77,*.F77,*.f90,*.F90,*.f95,*.F95 setf fortran
|
7
|
609
|
|
610 " FStab
|
819
|
611 au BufNewFile,BufRead fstab,mtab setf fstab
|
7
|
612
|
|
613 " GDB command files
|
|
614 au BufNewFile,BufRead .gdbinit setf gdb
|
|
615
|
|
616 " GDMO
|
|
617 au BufNewFile,BufRead *.mo,*.gdmo setf gdmo
|
|
618
|
|
619 " Gedcom
|
|
620 au BufNewFile,BufRead *.ged setf gedcom
|
|
621
|
|
622 " Gkrellmrc
|
|
623 au BufNewFile,BufRead gkrellmrc,gkrellmrc_? setf gkrellmrc
|
|
624
|
|
625 " GP scripts (2.0 and onward)
|
827
|
626 au BufNewFile,BufRead *.gp,.gprc setf gp
|
7
|
627
|
|
628 " GPG
|
|
629 au BufNewFile,BufRead */.gnupg/options setf gpg
|
|
630 au BufNewFile,BufRead */.gnupg/gpg.conf setf gpg
|
|
631 au BufNewFile,BufRead /usr/**/gnupg/options.skel setf gpg
|
|
632
|
|
633 " Gnuplot scripts
|
|
634 au BufNewFile,BufRead *.gpi setf gnuplot
|
|
635
|
|
636 " GrADS scripts
|
|
637 au BufNewFile,BufRead *.gs setf grads
|
|
638
|
625
|
639 " Gretl
|
|
640 au BufNewFile,BufRead *.gretl setf gretl
|
|
641
|
7
|
642 " Groovy
|
|
643 au BufNewFile,BufRead *.groovy setf groovy
|
|
644
|
|
645 " GNU Server Pages
|
|
646 au BufNewFile,BufRead *.gsp setf gsp
|
|
647
|
389
|
648 " Group file
|
|
649 au BufNewFile,BufRead /etc/group setf group
|
|
650
|
7
|
651 " GTK RC
|
|
652 au BufNewFile,BufRead .gtkrc,gtkrc setf gtkrc
|
|
653
|
|
654 " Haskell
|
|
655 au BufNewFile,BufRead *.hs setf haskell
|
|
656 au BufNewFile,BufRead *.lhs setf lhaskell
|
|
657 au BufNewFile,BufRead *.chs setf chaskell
|
|
658
|
|
659 " Hercules
|
|
660 au BufNewFile,BufRead *.vc,*.ev,*.rs,*.sum,*.errsum setf hercules
|
|
661
|
|
662 " HEX (Intel)
|
|
663 au BufNewFile,BufRead *.hex,*.h32 setf hex
|
|
664
|
|
665 " Tilde (must be before HTML)
|
|
666 au BufNewFile,BufRead *.t.html setf tilde
|
|
667
|
497
|
668 " HTML (.shtml and .stm for server side)
|
|
669 au BufNewFile,BufRead *.html,*.htm,*.shtml,*.stm call s:FThtml()
|
7
|
670
|
798
|
671 " Distinguish between HTML, XHTML and Django
|
216
|
672 fun! s:FThtml()
|
7
|
673 let n = 1
|
|
674 while n < 10 && n < line("$")
|
|
675 if getline(n) =~ '\<DTD\s\+XHTML\s'
|
|
676 setf xhtml
|
|
677 return
|
|
678 endif
|
798
|
679 if getline(n) =~ '{%\s*\(extends\|block\)\>'
|
|
680 setf htmldjango
|
|
681 return
|
|
682 endif
|
7
|
683 let n = n + 1
|
|
684 endwhile
|
|
685 setf html
|
|
686 endfun
|
|
687
|
497
|
688 " HTML with Ruby - eRuby
|
|
689 au BufNewFile,BufRead *.rhtml setf eruby
|
7
|
690
|
|
691 " HTML with M4
|
|
692 au BufNewFile,BufRead *.html.m4 setf htmlm4
|
|
693
|
|
694 " HTML Cheetah template
|
|
695 au BufNewFile,BufRead *.tmpl setf htmlcheetah
|
|
696
|
|
697 " Hyper Builder
|
|
698 au BufNewFile,BufRead *.hb setf hb
|
|
699
|
|
700 " Icon
|
|
701 au BufNewFile,BufRead *.icn setf icon
|
|
702
|
|
703 " IDL (Interface Description Language)
|
216
|
704 au BufNewFile,BufRead *.idl call s:FTidl()
|
7
|
705
|
|
706 " Distinguish between standard IDL and MS-IDL
|
216
|
707 fun! s:FTidl()
|
7
|
708 let n = 1
|
|
709 while n < 50 && n < line("$")
|
|
710 if getline(n) =~ '^\s*import\s\+"\(unknwn\|objidl\)\.idl"'
|
|
711 setf msidl
|
|
712 return
|
|
713 endif
|
|
714 let n = n + 1
|
|
715 endwhile
|
|
716 setf idl
|
|
717 endfun
|
|
718
|
|
719 " Microsoft IDL (Interface Description Language) Also *.idl
|
|
720 " MOF = WMI (Windows Management Instrumentation) Managed Object Format
|
|
721 au BufNewFile,BufRead *.odl,*.mof setf msidl
|
|
722
|
|
723 " Icewm menu
|
|
724 au BufNewFile,BufRead */.icewm/menu setf icemenu
|
|
725
|
|
726 " IDL (Interactive Data Language)
|
|
727 au BufNewFile,BufRead *.pro setf idlang
|
|
728
|
389
|
729 " Indent RC
|
|
730 au BufNewFile,BufRead indentrc setf indentrc
|
|
731
|
7
|
732 " Inform
|
148
|
733 au BufNewFile,BufRead .indent.pro setf indent
|
|
734
|
|
735 " Inform
|
7
|
736 au BufNewFile,BufRead *.inf,*.INF setf inform
|
|
737
|
148
|
738 " Ipfilter
|
|
739 au BufNewFile,BufRead ipf.conf,ipf.rules setf ipfilter
|
|
740
|
7
|
741 " Informix 4GL (source - canonical, include file, I4GL+M4 preproc.)
|
|
742 au BufNewFile,BufRead *.4gl,*.4gh,*.m4gl setf fgl
|
|
743
|
|
744 " .INI file for MSDOS
|
|
745 au BufNewFile,BufRead *.ini setf dosini
|
|
746
|
|
747 " SysV Inittab
|
|
748 au BufNewFile,BufRead inittab setf inittab
|
|
749
|
|
750 " Inno Setup
|
|
751 au BufNewFile,BufRead *.iss setf iss
|
|
752
|
|
753 " JAL
|
|
754 au BufNewFile,BufRead *.jal,*.JAL setf jal
|
|
755
|
|
756 " Jam
|
|
757 au BufNewFile,BufRead *.jpl,*.jpr setf jam
|
|
758
|
|
759 " Java
|
|
760 au BufNewFile,BufRead *.java,*.jav setf java
|
|
761
|
|
762 " JavaCC
|
|
763 au BufNewFile,BufRead *.jj,*.jjt setf javacc
|
|
764
|
|
765 " JavaScript
|
|
766 au BufNewFile,BufRead *.js,*.javascript setf javascript
|
|
767
|
|
768 " Java Server Pages
|
|
769 au BufNewFile,BufRead *.jsp setf jsp
|
|
770
|
|
771 " Java Properties resource file (note: doesn't catch font.properties.pl)
|
216
|
772 au BufNewFile,BufRead *.properties,*.properties_??,*.properties_??_?? setf jproperties
|
|
773 au BufNewFile,BufRead *.properties_??_??_* call s:StarSetf('jproperties')
|
7
|
774
|
|
775 " Jess
|
|
776 au BufNewFile,BufRead *.clp setf jess
|
|
777
|
|
778 " Jgraph
|
|
779 au BufNewFile,BufRead *.jgr setf jgraph
|
|
780
|
|
781 " Kixtart
|
|
782 au BufNewFile,BufRead *.kix setf kix
|
|
783
|
|
784 " Kimwitu[++]
|
|
785 au BufNewFile,BufRead *.k setf kwt
|
|
786
|
|
787 " KDE script
|
|
788 au BufNewFile,BufRead *.ks setf kscript
|
|
789
|
826
|
790 " Kconfig
|
|
791 au BufNewFile,BufRead Kconfig,Kconfig.debug setf kconfig
|
|
792
|
7
|
793 " Lace (ISE)
|
|
794 au BufNewFile,BufRead *.ace,*.ACE setf lace
|
|
795
|
|
796 " Latte
|
|
797 au BufNewFile,BufRead *.latte,*.lte setf latte
|
|
798
|
375
|
799 " Limits
|
|
800 au BufNewFile,BufRead /etc/limits setf limits
|
|
801
|
7
|
802 " LambdaProlog (*.mod too, see Modsim)
|
|
803 au BufNewFile,BufRead *.sig setf lprolog
|
|
804
|
|
805 " LDAP LDIF
|
|
806 au BufNewFile,BufRead *.ldif setf ldif
|
|
807
|
375
|
808 " Ld loader
|
|
809 au BufNewFile,BufRead *.ld setf ld
|
|
810
|
7
|
811 " Lex
|
|
812 au BufNewFile,BufRead *.lex,*.l setf lex
|
|
813
|
|
814 " Libao
|
|
815 au BufNewFile,BufRead /etc/libao.conf,*/.libao setf libao
|
|
816
|
389
|
817 " Libsensors
|
|
818 au BufNewFile,BufRead /etc/sensors.conf setf sensors
|
|
819
|
7
|
820 " LFTP
|
|
821 au BufNewFile,BufRead lftp.conf,.lftprc,*lftp/rc setf lftp
|
|
822
|
|
823 " Lifelines (or Lex for C++!)
|
|
824 au BufNewFile,BufRead *.ll setf lifelines
|
|
825
|
|
826 " Lilo: Linux loader
|
216
|
827 au BufNewFile,BufRead lilo.conf* call s:StarSetf('lilo')
|
7
|
828
|
|
829 " Lisp (*.el = ELisp, *.cl = Common Lisp, *.jl = librep Lisp)
|
|
830 if has("fname_case")
|
|
831 au BufNewFile,BufRead *.lsp,*.lisp,*.el,*.cl,*.jl,*.L,.emacs,.sawfishrc setf lisp
|
|
832 else
|
|
833 au BufNewFile,BufRead *.lsp,*.lisp,*.el,*.cl,*.jl,.emacs,.sawfishrc setf lisp
|
|
834 endif
|
|
835
|
375
|
836 " SBCL implementation of Common Lisp
|
|
837 au BufNewFile,BufRead sbclrc,.sbclrc setf lisp
|
|
838
|
7
|
839 " Lite
|
|
840 au BufNewFile,BufRead *.lite,*.lt setf lite
|
|
841
|
375
|
842 " Login access
|
|
843 au BufNewFile,BufRead /etc/login.access setf loginaccess
|
|
844
|
|
845 " Login defs
|
|
846 au BufNewFile,BufRead /etc/login.defs setf logindefs
|
|
847
|
7
|
848 " Logtalk
|
|
849 au BufNewFile,BufRead *.lgt setf logtalk
|
|
850
|
|
851 " LOTOS
|
|
852 au BufNewFile,BufRead *.lot,*.lotos setf lotos
|
|
853
|
|
854 " Lout (also: *.lt)
|
|
855 au BufNewFile,BufRead *.lou,*.lout setf lout
|
|
856
|
|
857 " Lua
|
|
858 au BufNewFile,BufRead *.lua setf lua
|
|
859
|
|
860 " Lynx style file (or LotusScript!)
|
|
861 au BufNewFile,BufRead *.lss setf lss
|
|
862
|
|
863 " M4
|
|
864 au BufNewFile,BufRead *.m4
|
|
865 \ if expand("<afile>") !~? 'html.m4$\|fvwm2rc' | setf m4 | endif
|
|
866
|
|
867 " MaGic Point
|
|
868 au BufNewFile,BufRead *.mgp setf mgp
|
|
869
|
|
870 " Mail (for Elm, trn, mutt, rn, slrn)
|
484
|
871 au BufNewFile,BufRead snd.\d\+,.letter,.letter.\d\+,.followup,.article,.article.\d\+,pico.\d\+,mutt{ng,}-*-\w\+,mutt\w\{6\},ae\d\+.txt,/tmp/SLRN[0-9A-Z.]\+,*.eml setf mail
|
7
|
872
|
809
|
873 " Mail aliases
|
|
874 au BufNewFile,BufRead /etc/mail/aliases,/etc/aliases setf mailaliases
|
|
875
|
7
|
876 " Mailcap configuration file
|
|
877 au BufNewFile,BufRead .mailcap,mailcap setf mailcap
|
|
878
|
|
879 " Makefile
|
|
880 au BufNewFile,BufRead *[mM]akefile,*.mk,*.mak,*.dsp setf make
|
|
881
|
|
882 " MakeIndex
|
|
883 au BufNewFile,BufRead *.ist,*.mst setf ist
|
|
884
|
|
885 " Manpage
|
|
886 au BufNewFile,BufRead *.man setf man
|
|
887
|
389
|
888 " Man config
|
819
|
889 au BufNewFile,BufRead /etc/man.conf,man.config setf manconf
|
389
|
890
|
7
|
891 " Maple V
|
|
892 au BufNewFile,BufRead *.mv,*.mpl,*.mws setf maple
|
|
893
|
|
894 " Mason
|
|
895 au BufNewFile,BufRead *.mason,*.mhtml setf mason
|
|
896
|
|
897 " Matlab or Objective C
|
216
|
898 au BufNewFile,BufRead *.m call s:FTm()
|
7
|
899
|
216
|
900 fun! s:FTm()
|
7
|
901 let n = 1
|
|
902 while n < 10
|
|
903 let line = getline(n)
|
|
904 if line =~ '^\s*\(#\s*\(include\|import\)\>\|/\*\)'
|
|
905 setf objc
|
|
906 return
|
|
907 endif
|
|
908 if line =~ '^\s*%'
|
|
909 setf matlab
|
|
910 return
|
|
911 endif
|
|
912 if line =~ '^\s*(\*'
|
|
913 setf mma
|
|
914 return
|
|
915 endif
|
|
916 let n = n + 1
|
|
917 endwhile
|
271
|
918 if exists("g:filetype_m")
|
|
919 exe "setf " . g:filetype_m
|
|
920 else
|
|
921 setf matlab
|
|
922 endif
|
7
|
923 endfun
|
|
924
|
|
925 " Maya Extension Language
|
|
926 au BufNewFile,BufRead *.mel setf mel
|
|
927
|
|
928 " Metafont
|
|
929 au BufNewFile,BufRead *.mf setf mf
|
|
930
|
|
931 " MetaPost
|
|
932 au BufNewFile,BufRead *.mp setf mp
|
|
933
|
683
|
934 " MGL
|
|
935 au BufNewFile,BufRead *.mgl setf mgl
|
|
936
|
7
|
937 " MMIX or VMS makefile
|
216
|
938 au BufNewFile,BufRead *.mms call s:FTmms()
|
7
|
939
|
216
|
940 fun! s:FTmms()
|
7
|
941 let n = 1
|
|
942 while n < 10
|
|
943 let line = getline(n)
|
|
944 if line =~ '^\s*\(%\|//\)' || line =~ '^\*'
|
|
945 setf mmix
|
|
946 return
|
|
947 endif
|
|
948 if line =~ '^\s*#'
|
|
949 setf make
|
|
950 return
|
|
951 endif
|
|
952 let n = n + 1
|
|
953 endwhile
|
|
954 setf mmix
|
|
955 endfun
|
|
956
|
|
957
|
|
958 " Modsim III (or LambdaProlog)
|
|
959 au BufNewFile,BufRead *.mod
|
|
960 \ if getline(1) =~ '\<module\>' |
|
|
961 \ setf lprolog |
|
|
962 \ else |
|
|
963 \ setf modsim3 |
|
|
964 \ endif
|
|
965
|
|
966 " Modula 2
|
|
967 au BufNewFile,BufRead *.m2,*.DEF,*.MOD,*.md,*.mi setf modula2
|
|
968
|
|
969 " Modula 3 (.m3, .i3, .mg, .ig)
|
|
970 au BufNewFile,BufRead *.[mi][3g] setf modula3
|
|
971
|
|
972 " Monk
|
|
973 au BufNewFile,BufRead *.isc,*.monk,*.ssc,*.tsc setf monk
|
|
974
|
|
975 " MOO
|
|
976 au BufNewFile,BufRead *.moo setf moo
|
|
977
|
|
978 " Modconf
|
|
979 au BufNewFile,BufRead /etc/modules.conf,/etc/conf.modules setf modconf
|
|
980 au BufNewFile,BufRead /etc/modutils/*
|
216
|
981 \ if executable(expand("<afile>")) != 1
|
|
982 \| call s:StarSetf('modconf')
|
|
983 \|endif
|
7
|
984
|
|
985 " Mplayer config
|
|
986 au BufNewFile,BufRead mplayer.conf,*/.mplayer/config setf mplayerconf
|
|
987
|
|
988 " Moterola S record
|
|
989 au BufNewFile,BufRead *.s19,*.s28,*.s37 setf srec
|
|
990
|
|
991 " Msql
|
|
992 au BufNewFile,BufRead *.msql setf msql
|
|
993
|
|
994 " Mysql
|
|
995 au BufNewFile,BufRead *.mysql setf mysql
|
|
996
|
|
997 " M$ Resource files
|
|
998 au BufNewFile,BufRead *.rc setf rc
|
|
999
|
12
|
1000 " MuPAD source
|
|
1001 au BufRead,BufNewFile *.mu setf mupad
|
|
1002
|
7
|
1003 " Mush
|
|
1004 au BufNewFile,BufRead *.mush setf mush
|
|
1005
|
|
1006 " Mutt setup file
|
484
|
1007 au BufNewFile,BufRead Mutt{ng,}rc setf muttrc
|
|
1008 au BufNewFile,BufRead .mutt{ng,}rc*,*/.mutt{ng,}/mutt{ng,}rc* call s:StarSetf('muttrc')
|
7
|
1009
|
389
|
1010 " Nano
|
|
1011 au BufNewFile,BufRead /etc/nanorc,.nanorc setf nanorc
|
|
1012
|
7
|
1013 " Nastran input/DMAP
|
|
1014 "au BufNewFile,BufRead *.dat setf nastran
|
|
1015
|
|
1016 " Natural
|
|
1017 au BufNewFile,BufRead *.NS[ACGLMNPS] setf natural
|
|
1018
|
39
|
1019 " Netrc
|
|
1020 au BufNewFile,BufRead .netrc setf netrc
|
|
1021
|
7
|
1022 " Novell netware batch files
|
|
1023 au BufNewFile,BufRead *.ncf setf ncf
|
|
1024
|
|
1025 " Nroff/Troff (*.ms and *.t are checked below)
|
|
1026 au BufNewFile,BufRead *.me
|
|
1027 \ if expand("<afile>") != "read.me" && expand("<afile>") != "click.me" |
|
|
1028 \ setf nroff |
|
|
1029 \ endif
|
|
1030 au BufNewFile,BufRead *.tr,*.nr,*.roff,*.tmac,*.mom setf nroff
|
216
|
1031 au BufNewFile,BufRead *.[1-9] call s:FTnroff()
|
7
|
1032
|
|
1033 " This function checks if one of the first five lines start with a dot. In
|
|
1034 " that case it is probably an nroff file: 'filetype' is set and 1 is returned.
|
216
|
1035 fun! s:FTnroff()
|
7
|
1036 if getline(1)[0] . getline(2)[0] . getline(3)[0] . getline(4)[0] . getline(5)[0] =~ '\.'
|
|
1037 setf nroff
|
|
1038 return 1
|
|
1039 endif
|
|
1040 return 0
|
|
1041 endfun
|
|
1042
|
|
1043 " Nroff or Objective C++
|
216
|
1044 au BufNewFile,BufRead *.mm call s:FTmm()
|
7
|
1045
|
216
|
1046 fun! s:FTmm()
|
7
|
1047 let n = 1
|
|
1048 while n < 10
|
|
1049 let line = getline(n)
|
|
1050 if line =~ '^\s*\(#\s*\(include\|import\)\>\|/\*\)'
|
|
1051 setf objcpp
|
|
1052 return
|
|
1053 endif
|
|
1054 let n = n + 1
|
|
1055 endwhile
|
|
1056 setf nroff
|
|
1057 endfun
|
|
1058
|
|
1059 " Not Quite C
|
|
1060 au BufNewFile,BufRead *.nqc setf nqc
|
|
1061
|
|
1062 " NSIS
|
|
1063 au BufNewFile,BufRead *.nsi setf nsis
|
|
1064
|
|
1065 " OCAML
|
|
1066 au BufNewFile,BufRead *.ml,*.mli,*.mll,*.mly setf ocaml
|
|
1067
|
|
1068 " Occam
|
|
1069 au BufNewFile,BufRead *.occ setf occam
|
|
1070
|
|
1071 " Omnimark
|
|
1072 au BufNewFile,BufRead *.xom,*.xin setf omnimark
|
|
1073
|
|
1074 " OpenROAD
|
|
1075 au BufNewFile,BufRead *.or setf openroad
|
|
1076
|
|
1077 " OPL
|
|
1078 au BufNewFile,BufRead *.[Oo][Pp][Ll] setf opl
|
|
1079
|
|
1080 " Oracle config file
|
|
1081 au BufNewFile,BufRead *.ora setf ora
|
|
1082
|
|
1083 " Packet filter conf
|
|
1084 au BufNewFile,BufRead pf.conf setf pf
|
|
1085
|
375
|
1086 " Pam conf
|
|
1087 au BufNewFile,BufRead /etc/pam.conf setf pamconf
|
|
1088
|
7
|
1089 " PApp
|
|
1090 au BufNewFile,BufRead *.papp,*.pxml,*.pxsl setf papp
|
|
1091
|
389
|
1092 " Password file
|
|
1093 au BufNewFile,BufRead /etc/passwd,/etc/shadow,/etc/shadow- setf passwd
|
|
1094
|
7
|
1095 " Pascal (also *.p)
|
|
1096 au BufNewFile,BufRead *.pas setf pascal
|
|
1097
|
|
1098 " Delphi project file
|
|
1099 au BufNewFile,BufRead *.dpr setf pascal
|
|
1100
|
|
1101 " Perl
|
|
1102 if has("fname_case")
|
216
|
1103 au BufNewFile,BufRead *.pl,*.PL call s:FTpl()
|
7
|
1104 else
|
216
|
1105 au BufNewFile,BufRead *.pl call s:FTpl()
|
7
|
1106 endif
|
11
|
1107 au BufNewFile,BufRead *.plx setf perl
|
7
|
1108
|
216
|
1109 fun! s:FTpl()
|
7
|
1110 if exists("g:filetype_pl")
|
|
1111 exe "setf " . g:filetype_pl
|
|
1112 else
|
|
1113 " recognize Prolog by specific text in the first non-empty line
|
|
1114 " require a blank after the '%' because Perl uses "%list" and "%translate"
|
|
1115 let l = getline(nextnonblank(1))
|
|
1116 if l =~ '\<prolog\>' || l =~ '^\s*\(%\+\(\s\|$\)\|/\*\)' || l =~ ':-'
|
|
1117 setf prolog
|
|
1118 else
|
|
1119 setf perl
|
|
1120 endif
|
|
1121 endif
|
|
1122 endfun
|
|
1123
|
|
1124 " Perl, XPM or XPM2
|
|
1125 au BufNewFile,BufRead *.pm
|
|
1126 \ if getline(1) =~ "XPM2" |
|
|
1127 \ setf xpm2 |
|
|
1128 \ elseif getline(1) =~ "XPM" |
|
|
1129 \ setf xpm |
|
|
1130 \ else |
|
|
1131 \ setf perl |
|
|
1132 \ endif
|
|
1133
|
|
1134 " Perl POD
|
|
1135 au BufNewFile,BufRead *.pod setf pod
|
|
1136
|
|
1137 " Php3
|
|
1138 au BufNewFile,BufRead *.php,*.php3 setf php
|
|
1139
|
|
1140 " Phtml
|
|
1141 au BufNewFile,BufRead *.phtml setf phtml
|
|
1142
|
|
1143 " Pike
|
|
1144 au BufNewFile,BufRead *.pike,*.lpc,*.ulpc,*.pmod setf pike
|
|
1145
|
|
1146 " Pinfo config
|
|
1147 au BufNewFile,BufRead */etc/pinforc,*/.pinforc setf pinfo
|
|
1148
|
|
1149 " Palm Resource compiler
|
|
1150 au BufNewFile,BufRead *.rcp setf pilrc
|
|
1151
|
|
1152 " Pine config
|
|
1153 au BufNewFile,BufRead .pinerc,pinerc,.pinercex,pinercex setf pine
|
|
1154
|
|
1155 " PL/M (also: *.inp)
|
|
1156 au BufNewFile,BufRead *.plm,*.p36,*.pac setf plm
|
|
1157
|
|
1158 " PL/SQL
|
|
1159 au BufNewFile,BufRead *.pls,*.plsql setf plsql
|
|
1160
|
|
1161 " PLP
|
|
1162 au BufNewFile,BufRead *.plp setf plp
|
|
1163
|
|
1164 " PO and PO template (GNU gettext)
|
|
1165 au BufNewFile,BufRead *.po,*.pot setf po
|
|
1166
|
|
1167 " Postfix main config
|
|
1168 au BufNewFile,BufRead main.cf setf pfmain
|
|
1169
|
|
1170 " PostScript (+ font files, encapsulated PostScript, Adobe Illustrator)
|
|
1171 au BufNewFile,BufRead *.ps,*.pfa,*.afm,*.eps,*.epsf,*.epsi,*.ai setf postscr
|
|
1172
|
|
1173 " PostScript Printer Description
|
|
1174 au BufNewFile,BufRead *.ppd setf ppd
|
|
1175
|
|
1176 " Povray
|
|
1177 au BufNewFile,BufRead *.pov setf pov
|
|
1178
|
|
1179 " Povray configuration
|
|
1180 au BufNewFile,BufRead .povrayrc setf povini
|
|
1181
|
|
1182 " Povray, PHP or assembly
|
216
|
1183 au BufNewFile,BufRead *.inc call s:FTinc()
|
7
|
1184
|
216
|
1185 fun! s:FTinc()
|
7
|
1186 if exists("g:filetype_inc")
|
|
1187 exe "setf " . g:filetype_inc
|
|
1188 else
|
|
1189 let lines = getline(1).getline(2).getline(3)
|
|
1190 if lines =~? "perlscript"
|
|
1191 setf aspperl
|
|
1192 elseif lines =~ "<%"
|
|
1193 setf aspvbs
|
|
1194 elseif lines =~ "<?"
|
|
1195 setf php
|
|
1196 else
|
216
|
1197 call s:FTasmsyntax()
|
7
|
1198 if exists("b:asmsyntax")
|
|
1199 exe "setf " . b:asmsyntax
|
|
1200 else
|
|
1201 setf pov
|
|
1202 endif
|
|
1203 endif
|
|
1204 endif
|
|
1205 endfun
|
|
1206
|
|
1207 " Printcap and Termcap
|
|
1208 au BufNewFile,BufRead *printcap
|
|
1209 \ let b:ptcap_type = "print" | setf ptcap
|
|
1210 au BufNewFile,BufRead *termcap
|
|
1211 \ let b:ptcap_type = "term" | setf ptcap
|
|
1212
|
|
1213 " PCCTS / ANTRL
|
|
1214 "au BufNewFile,BufRead *.g setf antrl
|
|
1215 au BufNewFile,BufRead *.g setf pccts
|
|
1216
|
|
1217 " PPWizard
|
|
1218 au BufNewFile,BufRead *.it,*.ih setf ppwiz
|
|
1219
|
|
1220 " Oracle Pro*C/C++
|
|
1221 au BufNewFile,BufRead .pc setf proc
|
|
1222
|
|
1223 " Procmail
|
|
1224 au BufNewFile,BufRead .procmail,.procmailrc setf procmail
|
|
1225
|
|
1226 " Progress or CWEB
|
216
|
1227 au BufNewFile,BufRead *.w call s:FTprogress_cweb()
|
7
|
1228
|
216
|
1229 function! s:FTprogress_cweb()
|
7
|
1230 if exists("g:filetype_w")
|
|
1231 exe "setf " . g:filetype_w
|
|
1232 return
|
|
1233 endif
|
|
1234 if getline(1) =~ '&ANALYZE' || getline(3) =~ '&GLOBAL-DEFINE'
|
|
1235 setf progress
|
|
1236 else
|
|
1237 setf cweb
|
|
1238 endif
|
|
1239 endfun
|
|
1240
|
|
1241 " Progress or assembly
|
216
|
1242 au BufNewFile,BufRead *.i call s:FTprogress_asm()
|
7
|
1243
|
216
|
1244 function! s:FTprogress_asm()
|
7
|
1245 if exists("g:filetype_i")
|
|
1246 exe "setf " . g:filetype_i
|
|
1247 return
|
|
1248 endif
|
|
1249 " This function checks for an assembly comment the first ten lines.
|
|
1250 " If not found, assume Progress.
|
|
1251 let lnum = 1
|
500
|
1252 while lnum <= 10 && lnum < line('$')
|
7
|
1253 let line = getline(lnum)
|
|
1254 if line =~ '^\s*;' || line =~ '^\*'
|
216
|
1255 call s:FTasm()
|
7
|
1256 return
|
|
1257 elseif line !~ '^\s*$' || line =~ '^/\*'
|
|
1258 " Not an empty line: Doesn't look like valid assembly code.
|
|
1259 " Or it looks like a Progress /* comment
|
|
1260 break
|
|
1261 endif
|
|
1262 let lnum = lnum + 1
|
|
1263 endw
|
|
1264 setf progress
|
|
1265 endfun
|
|
1266
|
|
1267 " Progress or Pascal
|
216
|
1268 au BufNewFile,BufRead *.p call s:FTprogress_pascal()
|
7
|
1269
|
216
|
1270 function! s:FTprogress_pascal()
|
7
|
1271 if exists("g:filetype_p")
|
|
1272 exe "setf " . g:filetype_p
|
|
1273 return
|
|
1274 endif
|
|
1275 " This function checks for valid Pascal syntax in the first ten lines.
|
|
1276 " Look for either an opening comment or a program start.
|
|
1277 " If not found, assume Progress.
|
|
1278 let lnum = 1
|
500
|
1279 while lnum <= 10 && lnum < line('$')
|
7
|
1280 let line = getline(lnum)
|
500
|
1281 if line =~ '^\s*\(program\|unit\|procedure\|function\|const\|type\|var\)\>'
|
7
|
1282 \ || line =~ '^\s*{' || line =~ '^\s*(\*'
|
|
1283 setf pascal
|
|
1284 return
|
|
1285 elseif line !~ '^\s*$' || line =~ '^/\*'
|
|
1286 " Not an empty line: Doesn't look like valid Pascal code.
|
|
1287 " Or it looks like a Progress /* comment
|
|
1288 break
|
|
1289 endif
|
|
1290 let lnum = lnum + 1
|
|
1291 endw
|
|
1292 setf progress
|
|
1293 endfun
|
|
1294
|
|
1295
|
|
1296 " Software Distributor Product Specification File (POSIX 1387.2-1995)
|
|
1297 au BufNewFile,BufRead *.psf setf psf
|
|
1298 au BufNewFile,BufRead INDEX,INFO
|
|
1299 \ if getline(1) =~ '^\s*\(distribution\|installed_software\|root\|bundle\|product\)\s*$' |
|
|
1300 \ setf psf |
|
|
1301 \ endif
|
|
1302
|
|
1303 " Prolog
|
|
1304 au BufNewFile,BufRead *.pdb setf prolog
|
|
1305
|
389
|
1306 " Protocols
|
|
1307 au BufNewFile,BufRead /etc/protocols setf protocols
|
|
1308
|
7
|
1309 " Pyrex
|
|
1310 au BufNewFile,BufRead *.pyx,*.pxd setf pyrex
|
|
1311
|
|
1312 " Python
|
|
1313 au BufNewFile,BufRead *.py,*.pyw setf python
|
|
1314
|
|
1315 " Radiance
|
|
1316 au BufNewFile,BufRead *.rad,*.mat setf radiance
|
|
1317
|
|
1318 " Ratpoison config/command files
|
|
1319 au BufNewFile,BufRead .ratpoisonrc,ratpoisonrc setf ratpoison
|
|
1320
|
|
1321 " RCS file
|
|
1322 au BufNewFile,BufRead *\,v setf rcs
|
|
1323
|
|
1324 " Readline
|
237
|
1325 au BufNewFile,BufRead .inputrc,inputrc setf readline
|
7
|
1326
|
|
1327 " Registry for MS-Windows
|
|
1328 au BufNewFile,BufRead *.reg
|
|
1329 \ if getline(1) =~? '^REGEDIT[0-9]*\s*$\|^Windows Registry Editor Version \d*\.\d*\s*$' | setf registry | endif
|
|
1330
|
|
1331 " Renderman Interface Bytestream
|
|
1332 au BufNewFile,BufRead *.rib setf rib
|
|
1333
|
|
1334 " Rexx
|
|
1335 au BufNewFile,BufRead *.rexx,*.rex setf rexx
|
|
1336
|
|
1337 " R (Splus)
|
836
|
1338 if has("fname_case")
|
|
1339 au BufNewFile,BufRead *.s,*.S setf r
|
|
1340 else
|
|
1341 au BufNewFile,BufRead *.s setf r
|
|
1342 endif
|
7
|
1343
|
699
|
1344 " R Help file
|
836
|
1345 if has("fname_case")
|
|
1346 au BufNewFile,BufRead *.rd,*.Rd setf rhelp
|
|
1347 else
|
|
1348 au BufNewFile,BufRead *.rd setf rhelp
|
|
1349 endif
|
|
1350
|
|
1351 " R noweb file
|
|
1352 if has("fname_case")
|
|
1353 au BufNewFile,BufRead *.Rnw,*.rnw,*.Snw,*.snw setf rnoweb
|
|
1354 else
|
|
1355 au BufNewFile,BufRead *.rnw,*.snw setf rnoweb
|
|
1356 endif
|
699
|
1357
|
7
|
1358 " Rexx, Rebol or R
|
216
|
1359 au BufNewFile,BufRead *.r,*.R call s:FTr()
|
7
|
1360
|
216
|
1361 fun! s:FTr()
|
7
|
1362 if getline(1) =~ '^REBOL'
|
|
1363 setf rebol
|
|
1364 else
|
|
1365 let n = 1
|
|
1366 let max = line("$")
|
|
1367 if max > 50
|
|
1368 let max = 50
|
|
1369 endif
|
|
1370 while n < max
|
|
1371 " R has # comments
|
|
1372 if getline(n) =~ '^\s*#'
|
|
1373 setf r
|
|
1374 break
|
|
1375 endif
|
|
1376 " Rexx has /* comments */
|
|
1377 if getline(n) =~ '^\s*/\*'
|
|
1378 setf rexx
|
|
1379 break
|
|
1380 endif
|
|
1381 let n = n + 1
|
|
1382 endwhile
|
|
1383 if n >= max
|
|
1384 setf rexx
|
|
1385 endif
|
|
1386 endif
|
|
1387 endfun
|
|
1388
|
|
1389 " Remind
|
216
|
1390 au BufNewFile,BufRead .reminders* call s:StarSetf('remind')
|
7
|
1391
|
|
1392 " Resolv.conf
|
|
1393 au BufNewFile,BufRead resolv.conf setf resolv
|
|
1394
|
|
1395 " Relax NG Compact
|
|
1396 au BufNewFile,BufRead *.rnc setf rnc
|
|
1397
|
|
1398 " RPL/2
|
|
1399 au BufNewFile,BufRead *.rpl setf rpl
|
|
1400
|
|
1401 " Robots.txt
|
|
1402 au BufNewFile,BufRead robots.txt setf robots
|
|
1403
|
|
1404 " Rpcgen
|
|
1405 au BufNewFile,BufRead *.x setf rpcgen
|
|
1406
|
|
1407 " reStructuredText Documentation Format
|
|
1408 au BufNewFile,BufRead *.rst setf rst
|
|
1409
|
|
1410 " RTF
|
|
1411 au BufNewFile,BufRead *.rtf setf rtf
|
|
1412
|
|
1413 " Ruby
|
|
1414 au BufNewFile,BufRead *.rb,*.rbw,*.gem,*.gemspec setf ruby
|
|
1415
|
557
|
1416 " Rantfile is like Ruby
|
|
1417 au BufNewFile,BufRead [rR]antfile,*.rant setf ruby
|
|
1418
|
7
|
1419 " S-lang (or shader language!)
|
|
1420 au BufNewFile,BufRead *.sl setf slang
|
|
1421
|
|
1422 " Samba config
|
|
1423 au BufNewFile,BufRead smb.conf setf samba
|
|
1424
|
|
1425 " SAS script
|
|
1426 au BufNewFile,BufRead *.sas setf sas
|
|
1427
|
|
1428 " Sather
|
|
1429 au BufNewFile,BufRead *.sa setf sather
|
|
1430
|
|
1431 " Scilab
|
809
|
1432 au BufNewFile,BufRead *.sci,*.sce setf scilab
|
7
|
1433
|
|
1434 " SDL
|
|
1435 au BufNewFile,BufRead *.sdl,*.pr setf sdl
|
|
1436
|
|
1437 " sed
|
|
1438 au BufNewFile,BufRead *.sed setf sed
|
|
1439
|
36
|
1440 " Sieve (RFC 3028)
|
|
1441 au BufNewFile,BufRead *.siv setf sieve
|
|
1442
|
7
|
1443 " Sendmail
|
|
1444 au BufNewFile,BufRead sendmail.cf setf sm
|
|
1445
|
|
1446 " Sendmail .mc files are actually m4
|
|
1447 au BufNewFile,BufRead *.mc setf m4
|
|
1448
|
389
|
1449 " Services
|
|
1450 au BufNewFile,BufRead /etc/services setf services
|
|
1451
|
|
1452 " Service Location config
|
|
1453 au BufNewFile,BufRead /etc/slp.conf setf slpconf
|
|
1454
|
|
1455 " Service Location registration
|
|
1456 au BufNewFile,BufRead /etc/slp.reg setf slpreg
|
|
1457
|
|
1458 " Service Location SPI
|
|
1459 au BufNewFile,BufRead /etc/slp.spi setf slpspi
|
|
1460
|
|
1461 " Setserial config
|
|
1462 au BufNewFile,BufRead /etc/serial.conf setf setserial
|
|
1463
|
7
|
1464 " SGML
|
|
1465 au BufNewFile,BufRead *.sgm,*.sgml
|
|
1466 \ if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'linuxdoc' |
|
|
1467 \ setf sgmllnx |
|
|
1468 \ elseif getline(1) =~ '<!DOCTYPE.*DocBook' || getline(2) =~ '<!DOCTYPE.*DocBook' |
|
|
1469 \ let b:docbk_type="sgml" |
|
|
1470 \ setf docbk |
|
|
1471 \ else |
|
|
1472 \ setf sgml |
|
|
1473 \ endif
|
|
1474
|
|
1475 " SGMLDECL
|
|
1476 au BufNewFile,BufRead *.decl,*.dcl,*.dec
|
|
1477 \ if getline(1).getline(2).getline(3) =~? '^<!SGML' |
|
|
1478 \ setf sgmldecl |
|
|
1479 \ endif
|
|
1480
|
|
1481 " SGML catalog file
|
216
|
1482 au BufNewFile,BufRead catalog setf catalog
|
|
1483 au BufNewFile,BufRead sgml.catalog* call s:StarSetf('catalog')
|
7
|
1484
|
|
1485 " Shell scripts (sh, ksh, bash, bash2, csh); Allow .profile_foo etc.
|
|
1486 " Gentoo ebuilds are actually bash scripts
|
|
1487 au BufNewFile,BufRead .bashrc*,bashrc,bash.bashrc,.bash_profile*,.bash_logout*,*.bash,*.ebuild call SetFileTypeSH("bash")
|
|
1488 au BufNewFile,BufRead .kshrc*,*.ksh call SetFileTypeSH("ksh")
|
|
1489 au BufNewFile,BufRead /etc/profile,.profile*,*.sh,*.env call SetFileTypeSH(getline(1))
|
|
1490
|
216
|
1491 " Also called from scripts.vim.
|
7
|
1492 fun! SetFileTypeSH(name)
|
216
|
1493 if expand("<amatch>") =~ g:ft_ignore_pat
|
|
1494 return
|
|
1495 endif
|
7
|
1496 if a:name =~ '\<ksh\>'
|
|
1497 let b:is_kornshell = 1
|
|
1498 if exists("b:is_bash")
|
|
1499 unlet b:is_bash
|
|
1500 endif
|
|
1501 if exists("b:is_sh")
|
|
1502 unlet b:is_sh
|
|
1503 endif
|
|
1504 elseif exists("g:bash_is_sh") || a:name =~ '\<bash\>' || a:name =~ '\<bash2\>'
|
|
1505 let b:is_bash = 1
|
|
1506 if exists("b:is_kornshell")
|
|
1507 unlet b:is_kornshell
|
|
1508 endif
|
|
1509 if exists("b:is_sh")
|
|
1510 unlet b:is_sh
|
|
1511 endif
|
|
1512 elseif a:name =~ '\<sh\>'
|
|
1513 let b:is_sh = 1
|
|
1514 if exists("b:is_kornshell")
|
|
1515 unlet b:is_kornshell
|
|
1516 endif
|
|
1517 if exists("b:is_bash")
|
|
1518 unlet b:is_bash
|
|
1519 endif
|
|
1520 endif
|
26
|
1521 call SetFileTypeShell("sh")
|
|
1522 endfun
|
|
1523
|
|
1524 " For shell-like file types, check for an "exec" command hidden in a comment,
|
|
1525 " as used for Tcl.
|
216
|
1526 " Also called from scripts.vim, thus can't be local to this script.
|
26
|
1527 fun! SetFileTypeShell(name)
|
216
|
1528 if expand("<amatch>") =~ g:ft_ignore_pat
|
|
1529 return
|
|
1530 endif
|
26
|
1531 let l = 2
|
|
1532 while l < 20 && l < line("$") && getline(l) =~ '^\s*\(#\|$\)'
|
|
1533 " Skip empty and comment lines.
|
|
1534 let l = l + 1
|
|
1535 endwhile
|
|
1536 if l < line("$") && getline(l) =~ '\s*exec\s' && getline(l - 1) =~ '^\s*#.*\\$'
|
|
1537 " Found an "exec" line after a comment with continuation
|
|
1538 let n = substitute(getline(l),'\s*exec\s\+\([^ ]*/\)\=', '', '')
|
|
1539 if n =~ '\<tclsh\|\<wish'
|
|
1540 setf tcl
|
|
1541 return
|
|
1542 endif
|
|
1543 endif
|
|
1544 exe "setf " . a:name
|
7
|
1545 endfun
|
|
1546
|
|
1547 " tcsh scripts
|
26
|
1548 au BufNewFile,BufRead .tcshrc*,*.tcsh,tcsh.tcshrc,tcsh.login call SetFileTypeShell("tcsh")
|
7
|
1549
|
|
1550 " csh scripts, but might also be tcsh scripts (on some systems csh is tcsh)
|
216
|
1551 au BufNewFile,BufRead .login*,.cshrc*,csh.cshrc,csh.login,csh.logout,*.csh,.alias call s:CSH()
|
7
|
1552
|
216
|
1553 fun! s:CSH()
|
7
|
1554 if exists("g:filetype_csh")
|
26
|
1555 call SetFileTypeShell(g:filetype_csh)
|
7
|
1556 elseif &shell =~ "tcsh"
|
26
|
1557 call SetFileTypeShell("tcsh")
|
7
|
1558 else
|
26
|
1559 call SetFileTypeShell("csh")
|
7
|
1560 endif
|
|
1561 endfun
|
|
1562
|
|
1563 " Z-Shell script
|
216
|
1564 au BufNewFile,BufRead .zprofile,/etc/zprofile,.zfbfmarks setf zsh
|
|
1565 au BufNewFile,BufRead .zsh*,.zlog*,.zcompdump* call s:StarSetf('zsh')
|
7
|
1566
|
|
1567 " Scheme
|
|
1568 au BufNewFile,BufRead *.scm,*.ss setf scheme
|
|
1569
|
|
1570 " Screen RC
|
|
1571 au BufNewFile,BufRead .screenrc,screenrc setf screen
|
|
1572
|
|
1573 " Simula
|
|
1574 au BufNewFile,BufRead *.sim setf simula
|
|
1575
|
|
1576 " SINDA
|
|
1577 au BufNewFile,BufRead *.sin,*.s85 setf sinda
|
|
1578
|
819
|
1579 " SiSU
|
|
1580 au BufNewFile,BufRead *.sst,*.ssm,*.ssi,*.-sst,*._ssi setf sisu
|
|
1581 au BufNewFile,BufRead *.sst.meta,*.-sst.meta,*._sst.meta setf sisu
|
|
1582
|
7
|
1583 " SKILL
|
336
|
1584 au BufNewFile,BufRead *.il,*.ils,*.cdf setf skill
|
7
|
1585
|
|
1586 " SLRN
|
|
1587 au BufNewFile,BufRead .slrnrc setf slrnrc
|
|
1588 au BufNewFile,BufRead *.score setf slrnsc
|
|
1589
|
271
|
1590 " Smalltalk (and TeX)
|
|
1591 au BufNewFile,BufRead *.st setf st
|
|
1592 au BufNewFile,BufRead *.cls
|
|
1593 \ if getline(1) =~ '^%' |
|
|
1594 \ setf tex |
|
|
1595 \ else |
|
|
1596 \ setf st |
|
|
1597 \ endif
|
7
|
1598
|
|
1599 " Smarty templates
|
|
1600 au BufNewFile,BufRead *.tpl setf smarty
|
|
1601
|
|
1602 " SMIL or XML
|
|
1603 au BufNewFile,BufRead *.smil
|
|
1604 \ if getline(1) =~ '<?\s*xml.*?>' |
|
|
1605 \ setf xml |
|
|
1606 \ else |
|
|
1607 \ setf smil |
|
|
1608 \ endif
|
|
1609
|
|
1610 " SMIL or SNMP MIB file
|
|
1611 au BufNewFile,BufRead *.smi
|
|
1612 \ if getline(1) =~ '\<smil\>' |
|
|
1613 \ setf smil |
|
|
1614 \ else |
|
|
1615 \ setf mib |
|
|
1616 \ endif
|
|
1617
|
|
1618 " SMITH
|
|
1619 au BufNewFile,BufRead *.smt,*.smith setf smith
|
|
1620
|
|
1621 " Snobol4
|
|
1622 au BufNewFile,BufRead *.sno setf snobol4
|
|
1623
|
|
1624 " SNMP MIB files
|
|
1625 au BufNewFile,BufRead *.mib,*.my setf mib
|
|
1626
|
|
1627 " Snort Configuration
|
|
1628 au BufNewFile,BufRead *.hog,snort.conf,vision.conf,*.rules setf hog
|
|
1629
|
|
1630 " Spec (Linux RPM)
|
|
1631 au BufNewFile,BufRead *.spec setf spec
|
|
1632
|
|
1633 " Speedup (AspenTech plant simulator)
|
|
1634 au BufNewFile,BufRead *.speedup,*.spdata,*.spd setf spup
|
|
1635
|
|
1636 " Slice
|
|
1637 au BufNewFile,BufRead *.ice setf slice
|
|
1638
|
|
1639 " Spice
|
|
1640 au BufNewFile,BufRead *.sp,*.spice setf spice
|
|
1641
|
|
1642 " Spyce
|
|
1643 au BufNewFile,BufRead *.spy,*.spi setf spyce
|
|
1644
|
|
1645 " Squid
|
|
1646 au BufNewFile,BufRead squid.conf setf squid
|
|
1647
|
22
|
1648 " SQL for Oracle Designer
|
|
1649 au BufNewFile,BufRead *.tyb,*.typ,*.tyc,*.pkb,*.pks setf sql
|
|
1650
|
|
1651 " SQL
|
216
|
1652 au BufNewFile,BufRead *.sql call s:SQL()
|
22
|
1653
|
216
|
1654 fun! s:SQL()
|
22
|
1655 if exists("g:filetype_sql")
|
|
1656 exe "setf " . g:filetype_sql
|
|
1657 else
|
|
1658 setf sql
|
|
1659 endif
|
|
1660 endfun
|
7
|
1661
|
|
1662 " SQLJ
|
|
1663 au BufNewFile,BufRead *.sqlj setf sqlj
|
|
1664
|
|
1665 " SQR
|
|
1666 au BufNewFile,BufRead *.sqr,*.sqi setf sqr
|
|
1667
|
|
1668 " OpenSSH configuration
|
|
1669 au BufNewFile,BufRead ssh_config,*/.ssh/config setf sshconfig
|
|
1670
|
|
1671 " OpenSSH server configuration
|
|
1672 au BufNewFile,BufRead sshd_config setf sshdconfig
|
|
1673
|
831
|
1674 " Stata
|
|
1675 au BufNewFile,BufRead *.ado,*.class,*.do,*.imata,*.mata setf stata
|
|
1676
|
|
1677 " SMCL
|
|
1678 au BufNewFile,BufRead *.hlp,*.ihlp,*.smcl setf smcl
|
|
1679
|
7
|
1680 " Stored Procedures
|
|
1681 au BufNewFile,BufRead *.stp setf stp
|
|
1682
|
|
1683 " Standard ML
|
|
1684 au BufNewFile,BufRead *.sml setf sml
|
|
1685
|
375
|
1686 " Sysctl
|
|
1687 au BufNewFile,BufRead /etc/sysctl.conf setf sysctl
|
|
1688
|
39
|
1689 " Sudoers
|
|
1690 au BufNewFile,BufRead /etc/sudoers,sudoers.tmp setf sudoers
|
|
1691
|
826
|
1692 " If the file has an extension of 't' and is in a directory 't' then it is
|
|
1693 " almost certainly a Perl test file.
|
557
|
1694 " If the first line starts with '#' and contains 'perl' it's probably a Perl
|
|
1695 " file.
|
826
|
1696 " (Slow test) If a file contains a 'use' statement then it is almost certainly
|
|
1697 " a Perl file.
|
557
|
1698 fun! s:FTperl()
|
826
|
1699 if expand("%:e") == 't' && expand("%:p:h:t") == 't'
|
|
1700 setf perl
|
|
1701 return 1
|
|
1702 endif
|
557
|
1703 if getline(1)[0] == '#' && getline(1) =~ 'perl'
|
|
1704 setf perl
|
|
1705 return 1
|
|
1706 endif
|
826
|
1707 if search('^use\s\s*\k', 'nc', 30)
|
|
1708 setf perl
|
|
1709 return 1
|
|
1710 endif
|
557
|
1711 return 0
|
|
1712 endfun
|
|
1713
|
|
1714 " Tads (or Nroff or Perl test file)
|
7
|
1715 au BufNewFile,BufRead *.t
|
557
|
1716 \ if !s:FTnroff() && !s:FTperl() | setf tads | endif
|
7
|
1717
|
|
1718 " Tags
|
|
1719 au BufNewFile,BufRead tags setf tags
|
|
1720
|
|
1721 " TAK
|
|
1722 au BufNewFile,BufRead *.tak setf tak
|
|
1723
|
557
|
1724 " Tcl (JACL too)
|
|
1725 au BufNewFile,BufRead *.tcl,*.tk,*.itcl,*.itk,*.jacl setf tcl
|
7
|
1726
|
|
1727 " TealInfo
|
|
1728 au BufNewFile,BufRead *.tli setf tli
|
|
1729
|
|
1730 " Telix Salt
|
|
1731 au BufNewFile,BufRead *.slt setf tsalt
|
|
1732
|
|
1733 " Terminfo
|
|
1734 au BufNewFile,BufRead *.ti setf terminfo
|
|
1735
|
|
1736 " TeX
|
378
|
1737 au BufNewFile,BufRead *.latex,*.sty,*.dtx,*.ltx,*.bbl setf tex
|
|
1738 au BufNewFile,BufRead *.tex call s:FTtex()
|
|
1739
|
800
|
1740 " Choose context, plaintex, or tex (LaTeX) based on these rules:
|
|
1741 " 1. Check the first line of the file for "%&<format>".
|
|
1742 " 2. Check the first 1000 non-comment lines for LaTeX or ConTeXt keywords.
|
|
1743 " 3. Default to "latex" or to g:tex_flavor, can be set in user's vimrc.
|
378
|
1744 fun! s:FTtex()
|
800
|
1745 let firstline = getline(1)
|
|
1746 if firstline =~ '^%&\s*\a\+'
|
|
1747 let format = tolower(matchstr(firstline, '\a\+'))
|
|
1748 let format = substitute(format, 'pdf', '', '')
|
|
1749 if format == 'tex'
|
|
1750 let format = 'plain'
|
378
|
1751 endif
|
800
|
1752 else
|
|
1753 " Default value, may be changed later:
|
|
1754 let format = exists("g:tex_flavor") ? g:tex_flavor : 'plain'
|
|
1755 " Save position, go to the top of the file, find first non-comment line.
|
|
1756 let save_cursor = getpos('.')
|
|
1757 call cursor(1,1)
|
|
1758 let firstNC = search('^\s*[^[:space:]%]', 'c', 1000)
|
|
1759 if firstNC " Check the next thousand lines for a LaTeX or ConTeXt keyword.
|
|
1760 let lpat = 'documentclass\>\|usepackage\>\|begin{\|newcommand\>\|renewcommand\>'
|
|
1761 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\>'
|
|
1762 let kwline = search('^\s*\\\%(' . lpat . '\)\|^\s*\\\(' . cpat . '\)',
|
|
1763 \ 'cnp', firstNC + 1000)
|
|
1764 if kwline == 1 " lpat matched
|
|
1765 let format = 'latex'
|
|
1766 elseif kwline == 2 " cpat matched
|
|
1767 let format = 'context'
|
|
1768 endif " If neither matched, keep default set above.
|
|
1769 " let lline = search('^\s*\\\%(' . lpat . '\)', 'cn', firstNC + 1000)
|
|
1770 " let cline = search('^\s*\\\%(' . cpat . '\)', 'cn', firstNC + 1000)
|
|
1771 " if cline > 0
|
|
1772 " let format = 'context'
|
|
1773 " endif
|
|
1774 " if lline > 0 && (cline == 0 || cline > lline)
|
|
1775 " let format = 'tex'
|
|
1776 " endif
|
|
1777 endif " firstNC
|
|
1778 call setpos('.', save_cursor)
|
|
1779 endif " firstline =~ '^%&\s*\a\+'
|
694
|
1780
|
800
|
1781 " Translation from formats to file types. TODO: add AMSTeX, RevTex, others?
|
|
1782 if format == 'plain'
|
|
1783 setf plaintex
|
|
1784 elseif format == 'context'
|
694
|
1785 setf context
|
800
|
1786 else " probably LaTeX
|
694
|
1787 setf tex
|
|
1788 endif
|
800
|
1789 return
|
378
|
1790 endfun
|
|
1791
|
|
1792 " Context
|
|
1793 au BufNewFile,BufRead tex/context/*/*.tex setf context
|
7
|
1794
|
|
1795 " Texinfo
|
|
1796 au BufNewFile,BufRead *.texinfo,*.texi,*.txi setf texinfo
|
|
1797
|
|
1798 " TeX configuration
|
|
1799 au BufNewFile,BufRead texmf.cnf setf texmf
|
|
1800
|
|
1801 " Tidy config
|
|
1802 au BufNewFile,BufRead .tidyrc,tidyrc setf tidy
|
|
1803
|
|
1804 " TF mud client
|
|
1805 au BufNewFile,BufRead *.tf,.tfrc,tfrc setf tf
|
|
1806
|
33
|
1807 " TPP - Text Presentation Program
|
|
1808 au BufNewFile,BufReadPost *.tpp setf tpp
|
|
1809
|
555
|
1810 " Trustees
|
|
1811 au BufNewFile,BufRead trustees.conf setf trustees
|
|
1812
|
7
|
1813 " TSS - Geometry
|
|
1814 au BufNewFile,BufReadPost *.tssgm setf tssgm
|
|
1815
|
|
1816 " TSS - Optics
|
|
1817 au BufNewFile,BufReadPost *.tssop setf tssop
|
|
1818
|
|
1819 " TSS - Command Line (temporary)
|
|
1820 au BufNewFile,BufReadPost *.tsscl setf tsscl
|
|
1821
|
|
1822 " Motif UIT/UIL files
|
|
1823 au BufNewFile,BufRead *.uit,*.uil setf uil
|
|
1824
|
389
|
1825 " Udev conf
|
|
1826 au BufNewFile,BufRead /etc/udev/udev.conf setf udevconf
|
|
1827
|
|
1828 " Udev rules
|
|
1829 au BufNewFile,BufRead /etc/udev/rules.d/*.rules setf udevrules
|
|
1830
|
|
1831 " Udev permissions
|
|
1832 au BufNewFile,BufRead /etc/udev/permissions.d/*.permissions setf udevperm
|
|
1833 "
|
|
1834 " Udev symlinks config
|
|
1835 au BufNewFile,BufRead /etc/udev/cdsymlinks.conf setf sh
|
|
1836
|
7
|
1837 " UnrealScript
|
|
1838 au BufNewFile,BufRead *.uc setf uc
|
|
1839
|
375
|
1840 " Updatedb
|
|
1841 au BufNewFile,BufRead /etc/updatedb.conf setf updatedb
|
|
1842
|
836
|
1843 " Vera
|
|
1844 au BufNewFile,BufRead *.vr,*.vri,*.vrh setf vera
|
|
1845
|
7
|
1846 " Verilog HDL
|
|
1847 au BufNewFile,BufRead *.v setf verilog
|
|
1848
|
481
|
1849 " Verilog-AMS HDL
|
|
1850 au BufNewFile,BufRead *.va,*.vams setf verilogams
|
|
1851
|
7
|
1852 " VHDL
|
216
|
1853 au BufNewFile,BufRead *.hdl,*.vhd,*.vhdl,*.vbe,*.vst setf vhdl
|
375
|
1854 au BufNewFile,BufRead *.vhdl_[0-9]* call s:StarSetf('vhdl')
|
7
|
1855
|
|
1856 " Vim script
|
794
|
1857 au BufNewFile,BufRead *.vim,*.vba,.exrc,_exrc setf vim
|
7
|
1858
|
|
1859 " Viminfo file
|
|
1860 au BufNewFile,BufRead .viminfo,_viminfo setf viminfo
|
|
1861
|
|
1862 " Virata Config Script File
|
|
1863 au BufRead,BufNewFile *.hw,*.module,*.pkg setf virata
|
|
1864
|
|
1865 " Visual Basic (also uses *.bas) or FORM
|
216
|
1866 au BufNewFile,BufRead *.frm call s:FTVB("form")
|
7
|
1867
|
|
1868 " SaxBasic is close to Visual Basic
|
|
1869 au BufNewFile,BufRead *.sba setf vb
|
|
1870
|
|
1871 " Vgrindefs file
|
|
1872 au BufNewFile,BufRead vgrindefs setf vgrindefs
|
|
1873
|
|
1874 " VRML V1.0c
|
|
1875 au BufNewFile,BufRead *.wrl setf vrml
|
|
1876
|
|
1877 " Webmacro
|
|
1878 au BufNewFile,BufRead *.wm setf webmacro
|
|
1879
|
|
1880 " Wget config
|
|
1881 au BufNewFile,BufRead .wgetrc,wgetrc setf wget
|
|
1882
|
|
1883 " Website MetaLanguage
|
|
1884 au BufNewFile,BufRead *.wml setf wml
|
|
1885
|
|
1886 " Winbatch
|
|
1887 au BufNewFile,BufRead *.wbt setf winbatch
|
|
1888
|
753
|
1889 " WSML
|
|
1890 au BufNewFile,BufRead *.wsml setf wsml
|
|
1891
|
7
|
1892 " WvDial
|
|
1893 au BufNewFile,BufRead wvdial.conf,.wvdialrc setf wvdial
|
|
1894
|
|
1895 " CVS RC file
|
|
1896 au BufNewFile,BufRead .cvsrc setf cvsrc
|
|
1897
|
|
1898 " CVS commit file
|
|
1899 au BufNewFile,BufRead cvs\d\+ setf cvs
|
|
1900
|
|
1901 " WEB (*.web is also used for Winbatch: Guess, based on expecting "%" comment
|
|
1902 " lines in a WEB file).
|
|
1903 au BufNewFile,BufRead *.web
|
|
1904 \ if getline(1)[0].getline(2)[0].getline(3)[0].getline(4)[0].getline(5)[0] =~ "%" |
|
|
1905 \ setf web |
|
|
1906 \ else |
|
|
1907 \ setf winbatch |
|
|
1908 \ endif
|
|
1909
|
|
1910 " Windows Scripting Host and Windows Script Component
|
|
1911 au BufNewFile,BufRead *.ws[fc] setf wsh
|
|
1912
|
|
1913 " X Pixmap (dynamically sets colors, use BufEnter to make it work better)
|
|
1914 au BufEnter *.xpm
|
|
1915 \ if getline(1) =~ "XPM2" |
|
|
1916 \ setf xpm2 |
|
|
1917 \ else |
|
|
1918 \ setf xpm |
|
|
1919 \ endif
|
|
1920 au BufEnter *.xpm2 setf xpm2
|
|
1921
|
|
1922 " XFree86 config
|
|
1923 au BufNewFile,BufRead XF86Config
|
|
1924 \ if getline(1) =~ '\<XConfigurator\>' |
|
|
1925 \ let b:xf86c_xfree86_version = 3 |
|
|
1926 \ endif |
|
|
1927 \ setf xf86conf
|
|
1928
|
|
1929 " Xorg config
|
|
1930 au BufNewFile,BufRead xorg.conf,xorg.conf-4 let b:xf86c_xfree86_version = 4 | setf xf86conf
|
|
1931
|
375
|
1932 " Xinetd conf
|
|
1933 au BufNewFile,BufRead /etc/xinetd.conf setf xinetd
|
|
1934
|
7
|
1935 " XS Perl extension interface language
|
|
1936 au BufNewFile,BufRead *.xs setf xs
|
|
1937
|
|
1938 " X resources file
|
|
1939 au BufNewFile,BufRead .Xdefaults,.Xpdefaults,.Xresources,xdm-config,*.ad setf xdefaults
|
|
1940
|
|
1941 " Xmath
|
|
1942 au BufNewFile,BufRead *.msc,*.msf setf xmath
|
|
1943 au BufNewFile,BufRead *.ms
|
216
|
1944 \ if !s:FTnroff() | setf xmath | endif
|
7
|
1945
|
|
1946 " XML
|
|
1947 au BufNewFile,BufRead *.xml
|
|
1948 \ if getline(1) . getline(2) . getline(3) =~ '<!DOCTYPE.*DocBook' |
|
|
1949 \ let b:docbk_type="xml" |
|
|
1950 \ setf docbk |
|
|
1951 \ else |
|
|
1952 \ setf xml |
|
|
1953 \ endif
|
|
1954
|
|
1955 " XMI (holding UML models) is also XML
|
|
1956 au BufNewFile,BufRead *.xmi setf xml
|
|
1957
|
|
1958 " CSPROJ files are Visual Studio.NET's XML-based project config files
|
|
1959 au BufNewFile,BufRead *.csproj,*.csproj.user setf xml
|
|
1960
|
|
1961 " Qt Linguist translation source and Qt User Interface Files are XML
|
|
1962 au BufNewFile,BufRead *.ts,*.ui setf xml
|
|
1963
|
389
|
1964 " Xdg menus
|
|
1965 au BufNewFile,BufRead /etc/xdg/menus/*.menu setf xml
|
|
1966
|
419
|
1967 " Xquery
|
|
1968 au BufNewFile,BufRead *.xq,*.xql,*.xqm,*.xquery,*.xqy setf xquery
|
|
1969
|
7
|
1970 " XSD
|
|
1971 au BufNewFile,BufRead *.xsd setf xsd
|
|
1972
|
|
1973 " Xslt
|
|
1974 au BufNewFile,BufRead *.xsl,*.xslt setf xslt
|
|
1975
|
|
1976 " Yacc
|
375
|
1977 au BufNewFile,BufRead *.yy setf yacc
|
|
1978
|
|
1979 " Yacc or racc
|
|
1980 au BufNewFile,BufRead *.y call s:FTy()
|
|
1981
|
|
1982 fun! s:FTy()
|
|
1983 let n = 1
|
484
|
1984 while n < 100 && n < line("$")
|
|
1985 let line = getline(n)
|
|
1986 if line =~ '^\s*%'
|
|
1987 setf yacc
|
|
1988 return
|
|
1989 endif
|
482
|
1990 if getline(n) =~ '^\s*\(#\|class\>\)' && getline(n) !~ '^\s*#\s*include'
|
375
|
1991 setf racc
|
|
1992 return
|
|
1993 endif
|
|
1994 let n = n + 1
|
|
1995 endwhile
|
|
1996 setf yacc
|
|
1997 endfun
|
|
1998
|
7
|
1999
|
|
2000 " Yaml
|
|
2001 au BufNewFile,BufRead *.yaml,*.yml setf yaml
|
|
2002
|
809
|
2003 " Zope
|
|
2004 " dtml (zope dynamic template markup language), pt (zope page template),
|
|
2005 " cpt (zope form controller page template)
|
826
|
2006 au BufNewFile,BufRead *.dtml,*.pt,*.cpt call s:FThtml()
|
809
|
2007 " zsql (zope sql method)
|
|
2008 au BufNewFile,BufRead *.zsql call s:SQL()
|
|
2009
|
7
|
2010 " Z80 assembler asz80
|
|
2011 au BufNewFile,BufRead *.z8a setf z8a
|
|
2012
|
|
2013 augroup END
|
|
2014
|
|
2015
|
|
2016 " Source the user-specified filetype file, for backwards compatibility with
|
|
2017 " Vim 5.x.
|
216
|
2018 if exists("myfiletypefile") && filereadable(expand(myfiletypefile))
|
7
|
2019 execute "source " . myfiletypefile
|
|
2020 endif
|
|
2021
|
|
2022
|
|
2023 " Check for "*" after loading myfiletypefile, so that scripts.vim is only used
|
|
2024 " when there are no matching file name extensions.
|
|
2025 " Don't do this for compressed files.
|
|
2026 augroup filetypedetect
|
|
2027 au BufNewFile,BufRead *
|
|
2028 \ if !did_filetype() && expand("<amatch>") !~ g:ft_ignore_pat
|
|
2029 \ | runtime! scripts.vim | endif
|
|
2030 au StdinReadPost * if !did_filetype() | runtime! scripts.vim | endif
|
|
2031
|
|
2032
|
|
2033 " Extra checks for when no filetype has been detected now. Mostly used for
|
|
2034 " patterns that end in "*". E.g., "zsh*" matches "zsh.vim", but that's a Vim
|
|
2035 " script file.
|
216
|
2036 " Most of these should call s:StarSetf() to avoid names ending in .gz and the
|
|
2037 " like are used.
|
7
|
2038
|
531
|
2039 " Asterisk config file
|
|
2040 au BufNewFile,BufRead *asterisk/*.conf* call s:StarSetf('asterisk')
|
794
|
2041 au BufNewFile,BufRead *asterisk*/*voicemail.conf* call s:StarSetf('asteriskvm')
|
531
|
2042
|
7
|
2043 " BIND zone
|
805
|
2044 au BufNewFile,BufRead */named/db.*,*/bind/db.* call s:StarSetf('bindzone')
|
7
|
2045
|
|
2046 " Changelog
|
216
|
2047 au BufNewFile,BufRead [cC]hange[lL]og*
|
|
2048 \ if getline(1) =~ '; urgency='
|
|
2049 \| call s:StarSetf('debchangelog')
|
|
2050 \|else
|
|
2051 \| call s:StarSetf('changelog')
|
|
2052 \|endif
|
7
|
2053
|
|
2054 " Crontab
|
216
|
2055 au BufNewFile,BufRead crontab,crontab.* call s:StarSetf('crontab')
|
7
|
2056
|
816
|
2057 " Debian Sources.list
|
|
2058 au BufNewFile,BufRead /etc/apt/sources.list.d/* call s:StarSetf('debsources')
|
|
2059
|
7
|
2060 " Dracula
|
216
|
2061 au BufNewFile,BufRead drac.* call s:StarSetf('dracula')
|
7
|
2062
|
|
2063 " Fvwm
|
|
2064 au BufNewFile,BufRead *fvwmrc*,*fvwm95*.hook
|
216
|
2065 \ let b:fvwm_version = 1 | call s:StarSetf('fvwm')
|
7
|
2066 au BufNewFile,BufRead *fvwm2rc*
|
216
|
2067 \ if expand("<afile>:e") == "m4"
|
|
2068 \| call s:StarSetf('fvwm2m4')
|
|
2069 \|else
|
|
2070 \| let b:fvwm_version = 2 | call s:StarSetf('fvwm')
|
|
2071 \|endif
|
7
|
2072
|
|
2073 " GTK RC
|
216
|
2074 au BufNewFile,BufRead .gtkrc*,gtkrc* call s:StarSetf('gtkrc')
|
7
|
2075
|
|
2076 " Jam
|
216
|
2077 au BufNewFile,BufRead Prl*.*,JAM*.* call s:StarSetf('jam')
|
7
|
2078
|
|
2079 " Jargon
|
|
2080 au! BufNewFile,BufRead *jarg*
|
216
|
2081 \ if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'THIS IS THE JARGON FILE'
|
|
2082 \| call s:StarSetf('jargon')
|
|
2083 \|endif
|
7
|
2084
|
837
|
2085 " Kconfig
|
|
2086 au BufNewFile,BufRead Kconfig.* call s:StarSetf('kconfig')
|
|
2087
|
7
|
2088 " Makefile
|
216
|
2089 au BufNewFile,BufRead [mM]akefile* call s:StarSetf('make')
|
7
|
2090
|
389
|
2091 " Modconf
|
|
2092 au BufNewFile,BufRead /etc/modprobe.* call s:StarSetf('modconf')
|
|
2093
|
7
|
2094 " Ruby Makefile
|
216
|
2095 au BufNewFile,BufRead [rR]akefile* call s:StarSetf('ruby')
|
7
|
2096
|
|
2097 " Mutt setup file
|
484
|
2098 au BufNewFile,BufRead mutt{ng,}rc*,Mutt{ng,}rc* call s:StarSetf('muttrc')
|
7
|
2099
|
|
2100 " Nroff macros
|
216
|
2101 au BufNewFile,BufRead tmac.* call s:StarSetf('nroff')
|
7
|
2102
|
375
|
2103 " Pam conf
|
|
2104 au BufNewFile,BufRead /etc/pam.d/* call s:StarSetf('pamconf')
|
|
2105
|
7
|
2106 " Printcap and Termcap
|
|
2107 au BufNewFile,BufRead *printcap*
|
216
|
2108 \ if !did_filetype()
|
|
2109 \| let b:ptcap_type = "print" | call s:StarSetf('ptcap')
|
|
2110 \|endif
|
7
|
2111 au BufNewFile,BufRead *termcap*
|
216
|
2112 \ if !did_filetype()
|
|
2113 \| let b:ptcap_type = "term" | call s:StarSetf('ptcap')
|
|
2114 \|endif
|
7
|
2115
|
|
2116 " Vim script
|
216
|
2117 au BufNewFile,BufRead *vimrc* call s:StarSetf('vim')
|
7
|
2118
|
|
2119 " Subversion commit file
|
45
|
2120 au BufNewFile,BufRead svn-commit*.tmp setf svn
|
7
|
2121
|
|
2122 " X resources file
|
216
|
2123 au BufNewFile,BufRead Xresources*,*/app-defaults/*,*/Xresources/* call s:StarSetf('xdefaults')
|
7
|
2124
|
|
2125 " XFree86 config
|
|
2126 au BufNewFile,BufRead XF86Config-4*
|
216
|
2127 \ let b:xf86c_xfree86_version = 4 | call s:StarSetf('xf86conf')
|
7
|
2128 au BufNewFile,BufRead XF86Config*
|
216
|
2129 \ if getline(1) =~ '\<XConfigurator\>'
|
|
2130 \| let b:xf86c_xfree86_version = 3
|
|
2131 \|endif
|
|
2132 \|call s:StarSetf('xf86conf')
|
7
|
2133
|
|
2134 " X11 xmodmap
|
216
|
2135 au BufNewFile,BufRead *xmodmap* call s:StarSetf('xmodmap')
|
7
|
2136
|
375
|
2137 " Xinetd conf
|
|
2138 au BufNewFile,BufRead /etc/xinetd.d/* call s:StarSetf('xinetd')
|
|
2139
|
7
|
2140 " Z-Shell script
|
216
|
2141 au BufNewFile,BufRead zsh*,zlog* call s:StarSetf('zsh')
|
7
|
2142
|
|
2143
|
|
2144 " Generic configuration file (check this last, it's just guessing!)
|
|
2145 au BufNewFile,BufRead,StdinReadPost *
|
|
2146 \ if !did_filetype() && expand("<amatch>") !~ g:ft_ignore_pat
|
|
2147 \ && (getline(1) =~ '^#' || getline(2) =~ '^#' || getline(3) =~ '^#'
|
|
2148 \ || getline(4) =~ '^#' || getline(5) =~ '^#') |
|
|
2149 \ setf conf |
|
|
2150 \ endif
|
|
2151
|
|
2152 " Use the plugin-filetype checks last, they may overrule any of the previously
|
|
2153 " detected filetypes.
|
|
2154 runtime! ftdetect/*.vim
|
|
2155
|
|
2156 augroup END
|
|
2157
|
|
2158
|
|
2159 " If the GUI is already running, may still need to install the Syntax menu.
|
|
2160 " Don't do it when the 'M' flag is included in 'guioptions'.
|
|
2161 if has("menu") && has("gui_running")
|
|
2162 \ && !exists("did_install_syntax_menu") && &guioptions !~# "M"
|
|
2163 source <sfile>:p:h/menu.vim
|
|
2164 endif
|
|
2165
|
|
2166 " Restore 'cpoptions'
|
|
2167 let &cpo = s:cpo_save
|
|
2168 unlet s:cpo_save
|