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