comparison src/testdir/test_filetype.vim @ 12027:c2aa4af29251 v8.0.0894

patch 8.0.0894: there is no test for runtime filetype detection commit https://github.com/vim/vim/commit/0a0217abfabcee8b0779df2e18a186a4b41e18ce Author: Bram Moolenaar <Bram@vim.org> Date: Wed Aug 9 22:06:48 2017 +0200 patch 8.0.0894: there is no test for runtime filetype detection Problem: There is no test for runtime filetype detection. Solution: Test a list of filetypes from patterns.
author Christian Brabandt <cb@256bit.org>
date Wed, 09 Aug 2017 22:15:04 +0200
parents 561b76ed9d12
children a39e7e2ae7da
comparison
equal deleted inserted replaced
12026:fcbb47ff27ce 12027:c2aa4af29251
39 39
40 bwipe! 40 bwipe!
41 call delete('Xfile') 41 call delete('Xfile')
42 filetype off 42 filetype off
43 endfunc 43 endfunc
44
45 " Filetypes detected just from matching the file name.
46 let s:filename_checks = {
47 \ 'a2ps': ['/etc/a2ps.cfg', '/etc/a2ps/file.cfg', 'a2psrc', '.a2psrc'],
48 \ 'a65': ['file.a65'],
49 \ 'abap': ['file.abap'],
50 \ 'abc': ['file.abc'],
51 \ 'abel': ['file.abl'],
52 \ 'acedb': ['file.wrm'],
53 \ 'ada': ['file.adb', 'file.ads', 'file.ada', 'file.gpr'],
54 \ 'ahdl': ['file.tdf'],
55 \ 'alsaconf': ['.asoundrc', '/usr/share/alsa/alsa.conf', '/etc/asound.conf'],
56 \ 'aml': ['file.aml'],
57 \ 'ampl': ['file.run'],
58 \ 'ant': ['build.xml'],
59 \ 'apache': ['.htaccess', '/etc/httpd/file.conf'],
60 \ 'applescript': ['file.scpt'],
61 \ 'aptconf': ['apt.conf', '/.aptitude/config'],
62 \ 'arch': ['.arch-inventory'],
63 \ 'arduino': ['file.ino', 'file.pde'],
64 \ 'art': ['file.art'],
65 \ 'asciidoc': ['file.asciidoc', 'file.adoc'],
66 \ 'asn': ['file.asn', 'file.asn1'],
67 \ 'atlas': ['file.atl', 'file.as'],
68 \ 'autohotkey': ['file.ahk'],
69 \ 'autoit': ['file.au3'],
70 \ 'automake': ['GNUmakefile.am'],
71 \ 'ave': ['file.ave'],
72 \ 'awk': ['file.awk'],
73 \ 'b': ['file.mch', 'file.ref', 'file.imp'],
74 \ 'bc': ['file.bc'],
75 \ 'bdf': ['file.bdf'],
76 \ 'bib': ['file.bib'],
77 \ 'bindzone': ['named.root'],
78 \ 'blank': ['file.bl'],
79 \ 'bst': ['file.bst'],
80 \ 'bzr': ['bzr_log.any'],
81 \ 'c': ['*enlightenment/file.cfg', 'file.qc', 'file.c'],
82 \ 'cabal': ['file.cabal'],
83 \ 'calendar': ['calendar'],
84 \ 'catalog': ['catalog'],
85 \ 'cdl': ['file.cdl'],
86 \ 'cdrdaoconf': ['/etc/cdrdao.conf', '/etc/defaults/cdrdao', '/etc/default/cdrdao', '.cdrdao'],
87 \ 'cdrtoc': ['file.toc'],
88 \ 'cf': ['file.cfm', 'file.cfi', 'file.cfc'],
89 \ 'cfengine': ['cfengine.conf'],
90 \ 'cfg': ['file.cfg', 'file.hgrc', 'filehgrc'],
91 \ 'ch': ['file.chf'],
92 \ 'chaiscript': ['file.chai'],
93 \ 'chaskell': ['file.chs'],
94 \ 'chill': ['file..ch'],
95 \ 'chordpro': ['file.chopro', 'file.crd', 'file.cho', 'file.crdpro', 'file.chordpro'],
96 \ 'cl': ['file.eni'],
97 \ 'clean': ['file.dcl', 'file.icl'],
98 \ 'clojure': ['file.clj', 'file.cljs', 'file.cljx', 'file.cljc'],
99 \ 'cmake': ['CMakeLists.txt', 'file.cmake', 'file.cmake.in'],
100 \ 'cmusrc': ['any/.cmus/autosave', 'any/.cmus/rc', 'any/.cmus/command-history', 'any/.cmus/file.theme', 'any/cmus/rc', 'any/cmus/file.theme'],
101 \ 'cobol': ['file.cbl', 'file.cob', 'file.lib'],
102 \ 'coco': ['file.atg'],
103 \ 'conaryrecipe': ['file.recipe'],
104 \ 'conf': ['auto.master'],
105 \ 'config': ['configure.in', 'configure.ac'],
106 \ 'context': ['tex/context/any/file.tex', 'file.mkii', 'file.mkiv', 'file.mkvi'],
107 \ 'cpp': ['file.cxx', 'file.c++', 'file.hh', 'file.hxx', 'file.hpp', 'file.ipp', 'file.moc', 'file.tcc', 'file.inl', 'file.tlh'],
108 \ 'crm': ['file.crm'],
109 \ 'cs': ['file.cs'],
110 \ 'csc': ['file.csc'],
111 \ 'csdl': ['file.csdl'],
112 \ 'csp': ['file.csp', 'file.fdr'],
113 \ 'css': ['file.css'],
114 \ 'cterm': ['file.con'],
115 \ 'cucumber': ['file.feature'],
116 \ 'cuda': ['file.cu'],
117 \ 'cupl': ['file.pld'],
118 \ 'cuplsim': ['file.si'],
119 \ 'cvs': ['cvs123'],
120 \ 'cvsrc': ['.cvsrc'],
121 \ 'cynpp': ['file.cyn'],
122 \ 'datascript': ['file.ds'],
123 \ 'dcd': ['file.dcd'],
124 \ 'debcontrol': ['/debian/control'],
125 \ 'debsources': ['/etc/apt/sources.list', '/etc/apt/sources.list.d/file.list'],
126 \ 'def': ['file.def'],
127 \ 'denyhosts': ['denyhosts.conf'],
128 \ 'desc': ['file.desc'],
129 \ 'desktop': ['file.desktop', '.directory'],
130 \ 'dictconf': ['dict.conf', '.dictrc'],
131 \ 'dictdconf': ['dictd.conf'],
132 \ 'diff': ['file.diff', 'file.rej'],
133 \ 'dircolors': ['.dir_colors', '.dircolors', '/etc/DIR_COLORS'],
134 \ 'dnsmasq': ['/etc/dnsmasq.conf'],
135 \ 'dockerfile': ['Dockerfile', 'file.Dockerfile'],
136 \ 'dosbatch': ['file.bat', 'file.sys'],
137 \ 'dosini': ['.editorconfig', '/etc/yum.conf', 'file.ini'],
138 \ 'dot': ['file.dot'],
139 \ 'dracula': ['file.drac', 'file.drc', '*lvs', '*lpe'],
140 \ 'dsl': ['file.dsl'],
141 \ 'dtd': ['file.dtd'],
142 \ 'dts': ['file.dts', 'file.dtsi'],
143 \ 'dylan': ['file.dylan'],
144 \ 'dylanintr': ['file.intr'],
145 \ 'dylanlid': ['file.lid'],
146 \ 'ecd': ['file.ecd'],
147 \ 'edif': ['file.edf', 'file.edif', 'file.edo'],
148 \ 'elinks': ['/etc/elinks.conf', '/.elinks/elinks.conf'],
149 \ 'elmfilt': ['filter-rules'],
150 \ 'erlang': ['file.erl', 'file.hrl', 'file.yaws'],
151 \ 'eruby': ['file.erb', 'file.rhtml'],
152 \ 'esmtprc': ['*esmtprc'],
153 \ 'esqlc': ['file.ec', 'file.EC'],
154 \ 'esterel': ['file.strl'],
155 \ 'eterm': ['*Eterm/file.cfg'],
156 \ 'exim': ['exim.conf'],
157 \ 'expect': ['file.exp'],
158 \ 'exports': ['exports'],
159 \ 'factor': ['file.factor'],
160 \ 'falcon': ['file.fal'],
161 \ 'fan': ['file.fan', 'file.fwt'],
162 \ 'fetchmail': ['.fetchmailrc'],
163 \ 'fgl': ['file.4gl', 'file.4gh', 'file.m4gl'],
164 \ 'focexec': ['file.fex', 'file.focexec'],
165 \ 'forth': ['file.fs', 'file.ft'],
166 \ 'fortran': ['file.f', 'file.for', 'file.fortran', 'file.fpp', 'file.ftn', 'file.f77', 'file.f90', 'file.f95', 'file.f03', 'file.f08'],
167 \ 'framescript': ['file.fsl'],
168 \ 'freebasic': ['file.fb', 'file.bi'],
169 \ 'fstab': ['fstab', 'mtab'],
170 \ 'gdb': ['.gdbinit'],
171 \ 'gdmo': ['file.mo', 'file.gdmo'],
172 \ 'gedcom': ['file.ged', 'lltxxxxx.txt'],
173 \ 'gitcommit': ['COMMIT_EDITMSG', 'MERGE_MSG', 'TAG_EDITMSG'],
174 \ 'gitconfig': ['file.git/config', '.gitconfig', '.gitmodules', 'file.git/modules//config', '/.config/git/config'],
175 \ 'gitolite': ['gitolite.conf'],
176 \ 'gitrebase': ['git-rebase-todo'],
177 \ 'gitsendemail': ['.gitsendemail.msg.??????'],
178 \ 'gkrellmrc': ['gkrellmrc', 'gkrellmrc_?'],
179 \ 'gnash': ['gnashrc', '.gnashrc', 'gnashpluginrc', '.gnashpluginrc'],
180 \ 'gnuplot': ['file.gpi'],
181 \ 'go': ['file.go'],
182 \ 'gp': ['file.gp', '.gprc'],
183 \ 'gpg': ['/.gnupg/options', '/.gnupg/gpg.conf', '/usr/*/gnupg/options.skel'],
184 \ 'grads': ['file.gs'],
185 \ 'gretl': ['file.gretl'],
186 \ 'groovy': ['file.gradle', 'file.groovy'],
187 \ 'group': ['any/etc/group', 'any/etc/group-', 'any/etc/group.edit', 'any/etc/gshadow', 'any/etc/gshadow-', 'any/etc/gshadow.edit', 'any/var/backups/group.bak', 'any/var/backups/gshadow.bak'],
188 \ 'grub': ['/boot/grub/menu.lst', '/boot/grub/grub.conf', '/etc/grub.conf'],
189 \ 'gsp': ['file.gsp'],
190 \ 'gtkrc': ['.gtkrc', 'gtkrc'],
191 \ 'haml': ['file.haml'],
192 \ 'hamster': ['file.hsc', 'file.hsm'],
193 \ 'haskell': ['file.hs', 'file.hs-boot'],
194 \ 'haste': ['file.ht'],
195 \ 'hastepreproc': ['file.htpp'],
196 \ 'hb': ['file.hb'],
197 \ 'hercules': ['file.vc', 'file.ev', 'file.sum', 'file.errsum'],
198 \ 'hex': ['file.hex', 'file.h32'],
199 \ 'hgcommit': ['hg-editor-file.txt'],
200 \ 'hog': ['file.hog', 'snort.conf', 'vision.conf'],
201 \ 'hostconf': ['/etc/host.conf'],
202 \ 'hostsaccess': ['/etc/hosts.allow', '/etc/hosts.deny'],
203 \ 'htmlcheetah': ['file.tmpl'],
204 \ 'htmlm4': ['file.html.m4'],
205 \ 'httest': ['file.htt', 'file.htb'],
206 \ 'ibasic': ['file.iba', 'file.ibi'],
207 \ 'icemenu': ['/.icewm/menu'],
208 \ 'icon': ['file.icn'],
209 \ 'indent': ['.indent.pro', 'indentrc'],
210 \ 'inform': ['file.inf', 'file.INF'],
211 \ 'initng': ['/etc/initng/*/file.i', 'file.ii'],
212 \ 'inittab': ['inittab'],
213 \ 'ipfilter': ['ipf.conf', 'ipf6.conf', 'ipf.rules'],
214 \ 'iss': ['file.iss'],
215 \ 'ist': ['file.ist', 'file.mst'],
216 \ 'j': ['file.ijs'],
217 \ 'jal': ['file.jal', 'file.JAL'],
218 \ 'jam': ['file.jpl', 'file.jpr'],
219 \ 'java': ['file.java', 'file.jav'],
220 \ 'javacc': ['file.jj', 'file.jjt'],
221 \ 'javascript': ['file.js', 'file.javascript', 'file.es', 'file.jsx', 'file.mjs'],
222 \ 'jess': ['file.clp'],
223 \ 'jgraph': ['file.jgr'],
224 \ 'jovial': ['file.jov', 'file.j73', 'file.jovial'],
225 \ 'jproperties': ['file.properties', 'file.properties_??', 'file.properties_??_??'],
226 \ 'json': ['file.json', 'file.jsonp', 'file.webmanifest'],
227 \ 'jsp': ['file.jsp'],
228 \ 'kconfig': ['Kconfig', 'Kconfig.debug'],
229 \ 'kivy': ['file.kv'],
230 \ 'kix': ['file.kix'],
231 \ 'kscript': ['file.ks'],
232 \ 'kwt': ['file.k'],
233 \ 'lace': ['file.ace', 'file.ACE'],
234 \ 'latte': ['file.latte', 'file.lte'],
235 \ 'ld': ['file.ld'],
236 \ 'ldif': ['file.ldif'],
237 \ 'less': ['file.less'],
238 \ 'lex': ['file.lex', 'file.l', 'file.lxx', 'file.l++'],
239 \ 'lftp': ['lftp.conf', '.lftprc', '*lftp/rc'],
240 \ 'lhaskell': ['file.lhs'],
241 \ 'libao': ['/etc/libao.conf', '/.libao'],
242 \ 'lifelines': ['file.ll'],
243 \ 'lilo': ['lilo.conf'],
244 \ 'limits': ['/etc/limits', '/etc/*limits.conf', '/etc/*limits.d/file.conf'],
245 \ 'liquid': ['file.liquid'],
246 \ 'lisp': ['sbclrc', '.sbclrc'],
247 \ 'lite': ['file.lite', 'file.lt'],
248 \ 'litestep': ['/LiteStep/*/file.rc'],
249 \ 'loginaccess': ['/etc/login.access'],
250 \ 'logindefs': ['/etc/login.defs'],
251 \ 'logtalk': ['file.lgt'],
252 \ 'lotos': ['file.lot', 'file.lotos'],
253 \ 'lout': ['file.lou', 'file.lout'],
254 \ 'lprolog': ['file.sig'],
255 \ 'lsl': ['file.lsl'],
256 \ 'lss': ['file.lss'],
257 \ 'lua': ['file.lua', 'file.rockspec', 'file.nse'],
258 \ 'lynx': ['lynx.cfg'],
259 \ 'm4': ['file.at'],
260 \ 'mail': ['snd.123', '.letter', '.letter.123', '.followup', '.article', '.article.123', 'pico.123', 'mutt-xx-xxx', 'muttng-xx-xxx', 'ae123.txt', 'file.eml'],
261 \ 'mailaliases': ['/etc/mail/aliases', '/etc/aliases'],
262 \ 'mailcap': ['.mailcap', 'mailcap'],
263 \ 'make': ['file.mk', 'file.mak', 'file.dsp'],
264 \ 'mallard': ['file.page'],
265 \ 'man': ['file.man'],
266 \ 'manconf': ['/etc/man.conf', 'man.config'],
267 \ 'map': ['file.map'],
268 \ 'maple': ['file.mv', 'file.mpl', 'file.mws'],
269 \ 'markdown': ['file.markdown', 'file.mdown', 'file.mkd', 'file.mkdn', 'file.mdwn', 'file.md'],
270 \ 'mason': ['file.mason', 'file.mhtml', 'file.comp'],
271 \ 'master': ['file.mas', 'file.master'],
272 \ 'mel': ['file.mel'],
273 \ 'messages': ['/log/auth', '/log/cron', '/log/daemon', '/log/debug', '/log/kern', '/log/lpr', '/log/mail', '/log/messages', '/log/news/news', '/log/syslog', '/log/user',
274 \ '/log/auth.log', '/log/cron.log', '/log/daemon.log', '/log/debug.log', '/log/kern.log', '/log/lpr.log', '/log/mail.log', '/log/messages.log', '/log/news/news.log', '/log/syslog.log', '/log/user.log',
275 \ '/log/auth.err', '/log/cron.err', '/log/daemon.err', '/log/debug.err', '/log/kern.err', '/log/lpr.err', '/log/mail.err', '/log/messages.err', '/log/news/news.err', '/log/syslog.err', '/log/user.err',
276 \ '/log/auth.info', '/log/cron.info', '/log/daemon.info', '/log/debug.info', '/log/kern.info', '/log/lpr.info', '/log/mail.info', '/log/messages.info', '/log/news/news.info', '/log/syslog.info', '/log/user.info',
277 \ '/log/auth.warn', '/log/cron.warn', '/log/daemon.warn', '/log/debug.warn', '/log/kern.warn', '/log/lpr.warn', '/log/mail.warn', '/log/messages.warn', '/log/news/news.warn', '/log/syslog.warn', '/log/user.warn',
278 \ '/log/auth.crit', '/log/cron.crit', '/log/daemon.crit', '/log/debug.crit', '/log/kern.crit', '/log/lpr.crit', '/log/mail.crit', '/log/messages.crit', '/log/news/news.crit', '/log/syslog.crit', '/log/user.crit',
279 \ '/log/auth.notice', '/log/cron.notice', '/log/daemon.notice', '/log/debug.notice', '/log/kern.notice', '/log/lpr.notice', '/log/mail.notice', '/log/messages.notice', '/log/news/news.notice', '/log/syslog.notice', '/log/user.notice'],
280 \ 'mf': ['file.mf'],
281 \ 'mgl': ['file.mgl'],
282 \ 'mgp': ['file.mgp'],
283 \ 'mib': ['file.mib', 'file.my'],
284 \ 'mix': ['file.mix', 'file.mixal'],
285 \ 'mma': ['file.nb'],
286 \ 'mmp': ['file.mmp'],
287 \ 'modconf': ['/etc/modules.conf', '/etc/modules', '/etc/conf.modules'],
288 \ 'modula2': ['file.m2', 'file.DEF', 'file.MOD', 'file.mi'],
289 \ 'monk': ['file.isc', 'file.monk', 'file.ssc', 'file.tsc'],
290 \ 'moo': ['file.moo'],
291 \ 'mp': ['file.mp'],
292 \ 'mplayerconf': ['mplayer.conf', '/.mplayer/config'],
293 \ 'mrxvtrc': ['mrxvtrc', '.mrxvtrc'],
294 \ 'msidl': ['file.odl', 'file.mof'],
295 \ 'msql': ['file.msql'],
296 \ 'mupad': ['file.mu'],
297 \ 'mush': ['file.mush'],
298 \ 'muttrc': ['Muttngrc', 'Muttrc'],
299 \ 'mysql': ['file.mysql'],
300 \ 'named': ['namedfile.conf', 'rndcfile.conf'],
301 \ 'nanorc': ['/etc/nanorc', 'file.nanorc'],
302 \ 'ncf': ['file.ncf'],
303 \ 'netrc': ['.netrc'],
304 \ 'ninja': ['file.ninja'],
305 \ 'nqc': ['file.nqc'],
306 \ 'nroff': ['file.tr', 'file.nr', 'file.roff', 'file.tmac', 'file.mom'],
307 \ 'nsis': ['file.nsi', 'file.nsh'],
308 \ 'obj': ['file.obj'],
309 \ 'ocaml': ['file.ml', 'file.mli', 'file.mll', 'file.mly', '.ocamlinit'],
310 \ 'occam': ['file.occ'],
311 \ 'omnimark': ['file.xom', 'file.xin'],
312 \ 'openroad': ['file.or'],
313 \ 'ora': ['file.ora'],
314 \ 'pamconf': ['/etc/pam.conf'],
315 \ 'papp': ['file.papp', 'file.pxml', 'file.pxsl'],
316 \ 'pascal': ['file.pas', 'file.dpr'],
317 \ 'passwd': ['any/etc/passwd', 'any/etc/passwd-', 'any/etc/passwd.edit', 'any/etc/shadow', 'any/etc/shadow-', 'any/etc/shadow.edit', 'any/var/backups/passwd.bak', 'any/var/backups/shadow.bak'],
318 \ 'pccts': ['file.g'],
319 \ 'pdf': ['file.pdf'],
320 \ 'perl': ['file.plx', 'file.al', 'file.psgi', 'gitolite.rc', '.gitolite.rc', 'example.gitolite.rc'],
321 \ 'perl6': ['file.p6', 'file.pm6', 'file.pl6'],
322 \ 'pf': ['pf.conf'],
323 \ 'pfmain': ['main.cf'],
324 \ 'php': ['file.php', 'file.php9', 'file.phtml', 'file.ctp'],
325 \ 'pike': ['file.pike', 'file.lpc', 'file.ulpc', 'file.pmod'],
326 \ 'pilrc': ['file.rcp'],
327 \ 'pine': ['.pinerc', 'pinerc', '.pinercex', 'pinercex'],
328 \ 'pinfo': ['/etc/pinforc', '/.pinforc'],
329 \ 'pli': ['file.pli', 'file.pl1'],
330 \ 'plm': ['file.plm', 'file.p36', 'file.pac'],
331 \ 'plp': ['file.plp'],
332 \ 'plsql': ['file.pls', 'file.plsql'],
333 \ 'po': ['file.po', 'file.pot'],
334 \ 'pod': ['file.pod'],
335 \ 'pod6': ['file.pod6'],
336 \ 'postscr': ['file.ps', 'file.pfa', 'file.afm', 'file.eps', 'file.epsf', 'file.epsi', 'file.ai'],
337 \ 'pov': ['file.pov'],
338 \ 'povini': ['.povrayrc'],
339 \ 'ppd': ['file.ppd'],
340 \ 'ppwiz': ['file.it', 'file.ih'],
341 \ 'privoxy': ['file.action'],
342 \ 'proc': ['file.pc'],
343 \ 'procmail': ['.procmail', '.procmailrc'],
344 \ 'prolog': ['file.pdb'],
345 \ 'promela': ['file.pml'],
346 \ 'proto': ['file.proto'],
347 \ 'protocols': ['/etc/protocols'],
348 \ 'psf': ['file.psf'],
349 \ 'pyrex': ['file.pyx', 'file.pxd'],
350 \ 'python': ['file.py', 'file.pyw', '.pythonstartup', '.pythonrc', 'file.ptl'],
351 \ 'quake': ['anybaseq2/file.cfg', 'anyid1/file.cfg', 'quake3/file.cfg'],
352 \ 'radiance': ['file.rad', 'file.mat'],
353 \ 'ratpoison': ['.ratpoisonrc', 'ratpoisonrc'],
354 \ 'rc': ['file.rc', 'file.rch'],
355 \ 'rcs': ['file,v'],
356 \ 'readline': ['.inputrc', 'inputrc'],
357 \ 'remind': ['.reminders', 'file.remind', 'file.rem'],
358 \ 'resolv': ['resolv.conf'],
359 \ 'reva': ['file.frt'],
360 \ 'rexx': ['file.rex', 'file.orx', 'file.rxo', 'file.rxj', 'file.jrexx', 'file.rexxj', 'file.rexx', 'file.testGroup', 'file.testUnit'],
361 \ 'rib': ['file.rib'],
362 \ 'rnc': ['file.rnc'],
363 \ 'rng': ['file.rng'],
364 \ 'robots': ['robots.txt'],
365 \ 'rpcgen': ['file.x'],
366 \ 'rpl': ['file.rpl'],
367 \ 'rst': ['file.rst'],
368 \ 'rtf': ['file.rtf'],
369 \ 'ruby': ['.irbrc', 'irbrc', 'file.rb', 'file.rbw', 'file.gemspec', 'file.ru', 'Gemfile', 'file.builder', 'file.rxml', 'file.rjs', 'file.rant', 'file.rake'],
370 \ 'rust': ['file.rs'],
371 \ 'samba': ['smb.conf'],
372 \ 'sas': ['file.sas'],
373 \ 'sass': ['file.sass'],
374 \ 'sather': ['file.sa'],
375 \ 'sbt': ['file.sbt'],
376 \ 'scala': ['file.scala'],
377 \ 'scheme': ['file.scm', 'file.ss', 'file.rkt'],
378 \ 'scilab': ['file.sci', 'file.sce'],
379 \ 'screen': ['.screenrc', 'screenrc'],
380 \ 'scss': ['file.scss'],
381 \ 'sd': ['file.sd'],
382 \ 'sdc': ['file.sdc'],
383 \ 'sdl': ['file.sdl', 'file.pr'],
384 \ 'sed': ['file.sed'],
385 \ 'sensors': ['/etc/sensors.conf', '/etc/sensors3.conf'],
386 \ 'services': ['/etc/services'],
387 \ 'setserial': ['/etc/serial.conf'],
388 \ 'sh': ['/etc/udev/cdsymlinks.conf'],
389 \ 'sieve': ['file.siv'],
390 \ 'simula': ['file.sim'],
391 \ 'sinda': ['file.sin', 'file.s85'],
392 \ 'sisu': ['file.sst', 'file.ssm', 'file.ssi', 'file.-sst', 'file._sst', 'file.sst.meta', 'file.-sst.meta', 'file._sst.meta'],
393 \ 'skill': ['file.il', 'file.ils', 'file.cdf'],
394 \ 'slang': ['file.sl'],
395 \ 'slice': ['file.ice'],
396 \ 'slpconf': ['/etc/slp.conf'],
397 \ 'slpreg': ['/etc/slp.reg'],
398 \ 'slpspi': ['/etc/slp.spi'],
399 \ 'slrnrc': ['.slrnrc'],
400 \ 'slrnsc': ['file.score'],
401 \ 'sm': ['sendmail.cf'],
402 \ 'smarty': ['file.tpl'],
403 \ 'smcl': ['file.hlp', 'file.ihlp', 'file.smcl'],
404 \ 'smith': ['file.smt', 'file.smith'],
405 \ 'sml': ['file.sml'],
406 \ 'snobol4': ['file.sno', 'file.spt'],
407 \ 'spec': ['file.spec'],
408 \ 'spice': ['file.sp', 'file.spice'],
409 \ 'spup': ['file.speedup', 'file.spdata', 'file.spd'],
410 \ 'spyce': ['file.spy', 'file.spi'],
411 \ 'sql': ['file.tyb', 'file.typ', 'file.tyc', 'file.pkb', 'file.pks'],
412 \ 'sqlj': ['file.sqlj'],
413 \ 'sqr': ['file.sqr', 'file.sqi'],
414 \ 'squid': ['squid.conf'],
415 \ 'srec': ['file.s19', 'file.s28', 'file.s37', 'file.mot', 'file.srec'],
416 \ 'sshconfig': ['ssh_config', '/.ssh/config'],
417 \ 'sshdconfig': ['sshd_config'],
418 \ 'st': ['file.st'],
419 \ 'stata': ['file.ado', 'file.do', 'file.imata', 'file.mata'],
420 \ 'stp': ['file.stp'],
421 \ 'sudoers': ['any/etc/sudoers', 'sudoers.tmp'],
422 \ 'svg': ['file.svg'],
423 \ 'svn': ['svn-commitfile.tmp'],
424 \ 'sysctl': ['/etc/sysctl.conf', '/etc/sysctl.d/file.conf'],
425 \ 'systemd': ['any/systemd/file.automount', 'any/systemd/file.mount', 'any/systemd/file.path', 'any/systemd/file.service', 'any/systemd/file.socket', 'any/systemd/file.swap', 'any/systemd/file.target', 'any/systemd/file.timer'],
426 \ 'systemverilog': ['file.sv', 'file.svh'],
427 \ 'tags': ['tags'],
428 \ 'tak': ['file.tak'],
429 \ 'taskdata': ['pending.data', 'completed.data', 'undo.data'],
430 \ 'taskedit': ['file.task'],
431 \ 'tcl': ['file.tcl', 'file.tk', 'file.itcl', 'file.itk', 'file.jacl'],
432 \ 'teraterm': ['file.ttl'],
433 \ 'terminfo': ['file.ti'],
434 \ 'tex': ['file.latex', 'file.sty', 'file.dtx', 'file.ltx', 'file.bbl'],
435 \ 'texinfo': ['file.texinfo', 'file.texi', 'file.txi'],
436 \ 'texmf': ['texmf.cnf'],
437 \ 'text': ['file.text', 'README'],
438 \ 'tf': ['file.tf', '.tfrc', 'tfrc'],
439 \ 'tidy': ['.tidyrc', 'tidyrc'],
440 \ 'tilde': ['file.t.html'],
441 \ 'tli': ['file.tli'],
442 \ 'tmux': ['tmuxfile.conf', '.tmuxfile.conf'],
443 \ 'tpp': ['file.tpp'],
444 \ 'treetop': ['file.treetop'],
445 \ 'trustees': ['trustees.conf'],
446 \ 'tsalt': ['file.slt'],
447 \ 'tsscl': ['file.tsscl'],
448 \ 'tssgm': ['file.tssgm'],
449 \ 'tssop': ['file.tssop'],
450 \ 'twig': ['file.twig'],
451 \ 'uc': ['file.uc'],
452 \ 'udevconf': ['/etc/udev/udev.conf'],
453 \ 'udevperm': ['/etc/udev/permissions.d/file.permissions'],
454 \ 'uil': ['file.uit', 'file.uil'],
455 \ 'updatedb': ['/etc/updatedb.conf'],
456 \ 'upstart': ['/usr/share/upstart/file.conf', '/usr/share/upstart/file.override', '/etc/init/file.conf', '/etc/init/file.override', '/.init/file.conf', '/.init/file.override', '/.config/upstart/file.conf', '/.config/upstart/file.override'],
457 \ 'upstreamdat': ['upstream.dat', 'UPSTREAM.DAT', 'upstream.file.dat', 'UPSTREAM.FILE.DAT', 'file.upstream.dat', 'FILE.UPSTREAM.DAT'],
458 \ 'upstreaminstalllog': ['upstreaminstall.log', 'UPSTREAMINSTALL.LOG', 'upstreaminstall.file.log', 'UPSTREAMINSTALL.FILE.LOG', 'file.upstreaminstall.log', 'FILE.UPSTREAMINSTALL.LOG'],
459 \ 'upstreamlog': ['fdrupstream.log', 'upstream.log', 'UPSTREAM.LOG', 'upstream.file.log', 'UPSTREAM.FILE.LOG', 'file.upstream.log', 'FILE.UPSTREAM.LOG', 'UPSTREAM-file.log', 'UPSTREAM-FILE.LOG'],
460 \ 'usserverlog': ['usserver.log', 'USSERVER.LOG', 'usserver.file.log', 'USSERVER.FILE.LOG', 'file.usserver.log', 'FILE.USSERVER.LOG'],
461 \ 'usw2kagtlog': ['usw2kagt.log', 'USW2KAGT.LOG', 'usw2kagt.file.log', 'USW2KAGT.FILE.LOG', 'file.usw2kagt.log', 'FILE.USW2KAGT.LOG'],
462 \ 'vb': ['file.sba', 'file.vb', 'file.vbs', 'file.dsm', 'file.ctl'],
463 \ 'vera': ['file.vr', 'file.vri', 'file.vrh'],
464 \ 'verilog': ['file.v'],
465 \ 'verilogams': ['file.va', 'file.vams'],
466 \ 'vgrindefs': ['vgrindefs'],
467 \ 'vhdl': ['file.hdl', 'file.vhd', 'file.vhdl', 'file.vbe', 'file.vst'],
468 \ 'vim': ['file.vim', 'file.vba', '.exrc', '_exrc'],
469 \ 'viminfo': ['.viminfo', '_viminfo'],
470 \ 'vmasm': ['file.mar'],
471 \ 'voscm': ['file.cm'],
472 \ 'vrml': ['file.wrl'],
473 \ 'vroom': ['file.vroom'],
474 \ 'webmacro': ['file.wm'],
475 \ 'wget': ['.wgetrc', 'wgetrc'],
476 \ 'winbatch': ['file.wbt'],
477 \ 'wml': ['file.wml'],
478 \ 'wsml': ['file.wsml'],
479 \ 'wvdial': ['wvdial.conf', '.wvdialrc'],
480 \ 'xdefaults': ['.Xdefaults', '.Xpdefaults', '.Xresources', 'xdm-config', 'file.ad'],
481 \ 'xhtml': ['file.xhtml', 'file.xht'],
482 \ 'xinetd': ['/etc/xinetd.conf'],
483 \ 'xmath': ['file.msc', 'file.msf'],
484 \ 'xml': ['/etc/blkid.tab', '/etc/blkid.tab.old', 'file.xmi', 'file.csproj', 'file.csproj.user', 'file.ts', 'file.ui', 'file.tpm', '/etc/xdg/menus/file.menu', 'fglrxrc', 'file.xlf', 'file.xliff', 'file.xul'],
485 \ 'xmodmap': ['anyXmodmap'],
486 \ 'xf86conf': ['xorg.conf', 'xorg.conf-4'],
487 \ 'xpm2': ['file.xpm2'],
488 \ 'xquery': ['file.xq', 'file.xql', 'file.xqm', 'file.xquery', 'file.xqy'],
489 \ 'xs': ['file.xs'],
490 \ 'xsd': ['file.xsd'],
491 \ 'xslt': ['file.xsl', 'file.xslt'],
492 \ 'yacc': ['file.yy', 'file.yxx', 'file.y++'],
493 \ 'yaml': ['file.yaml', 'file.yml'],
494 \ 'z8a': ['file.z8a'],
495 \ 'zimbu': ['file.zu'],
496 \ 'zimbutempl': ['file.zut'],
497 \ 'zsh': ['.zprofile', '/etc/zprofile', '.zfbfmarks', 'file.zsh'],
498 \
499 \ 'aap': ['file.aap'],
500 \ 'help': [$VIMRUNTIME . '/doc/help.txt'],
501 \ 'xpm': ['file.xpm'],
502 \ }
503
504 func Test_filetype_detection()
505 filetype on
506 for [ft, names] in items(s:filename_checks)
507 for i in range(0, len(names) - 1)
508 new
509 try
510 exe 'edit ' . names[i]
511 catch
512 call assert_report('cannot edit "' . names[i] . '": ' . v:errmsg)
513 endtry
514 call assert_equal(ft, &filetype, 'with file name: ' . names[i])
515 bwipe!
516 endfor
517 endfor
518 endfunc