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