1" Test :setfiletype 2 3func Test_detection() 4 filetype on 5 augroup filetypedetect 6 au BufNewFile,BufRead * call assert_equal(1, did_filetype()) 7 augroup END 8 new something.vim 9 call assert_equal('vim', &filetype) 10 11 bwipe! 12 filetype off 13endfunc 14 15func Test_conf_type() 16 filetype on 17 call writefile(['# some comment', 'must be conf'], 'Xfile') 18 augroup filetypedetect 19 au BufNewFile,BufRead * call assert_equal(0, did_filetype()) 20 augroup END 21 split Xfile 22 call assert_equal('conf', &filetype) 23 24 bwipe! 25 call delete('Xfile') 26 filetype off 27endfunc 28 29func Test_other_type() 30 filetype on 31 augroup filetypedetect 32 au BufNewFile,BufRead * call assert_equal(0, did_filetype()) 33 au BufNewFile,BufRead Xfile setf testfile 34 au BufNewFile,BufRead * call assert_equal(1, did_filetype()) 35 augroup END 36 call writefile(['# some comment', 'must be conf'], 'Xfile') 37 split Xfile 38 call assert_equal('testfile', &filetype) 39 40 bwipe! 41 call delete('Xfile') 42 filetype off 43endfunc 44 45" Filetypes detected just from matching the file name. 46let s:filename_checks = { 47 \ '8th': ['file.8th'], 48 \ 'a2ps': ['/etc/a2ps.cfg', '/etc/a2ps/file.cfg', 'a2psrc', '.a2psrc', 'any/etc/a2ps.cfg', 'any/etc/a2ps/file.cfg'], 49 \ 'a65': ['file.a65'], 50 \ 'aap': ['file.aap'], 51 \ 'abap': ['file.abap'], 52 \ 'abc': ['file.abc'], 53 \ 'abel': ['file.abl'], 54 \ 'acedb': ['file.wrm'], 55 \ 'ada': ['file.adb', 'file.ads', 'file.ada', 'file.gpr'], 56 \ 'ahdl': ['file.tdf'], 57 \ 'aidl': ['file.aidl'], 58 \ 'alsaconf': ['.asoundrc', '/usr/share/alsa/alsa.conf', '/etc/asound.conf', 'any/etc/asound.conf', 'any/usr/share/alsa/alsa.conf'], 59 \ 'aml': ['file.aml'], 60 \ 'ampl': ['file.run'], 61 \ 'ant': ['build.xml'], 62 \ 'apache': ['.htaccess', '/etc/httpd/file.conf', '/etc/apache2/sites-2/file.com', '/etc/apache2/some.config', '/etc/apache2/conf.file/conf', '/etc/apache2/mods-some/file', '/etc/apache2/sites-some/file', '/etc/httpd/conf.d/file.config', '/etc/apache2/conf.file/file', '/etc/apache2/file.conf', '/etc/apache2/file.conf-file', '/etc/apache2/mods-file/file', '/etc/apache2/sites-file/file', '/etc/apache2/sites-file/file.com', '/etc/httpd/conf.d/file.conf', '/etc/httpd/conf.d/file.conf-file', 'access.conf', 'access.conf-file', 'any/etc/apache2/conf.file/file', 'any/etc/apache2/file.conf', 'any/etc/apache2/file.conf-file', 'any/etc/apache2/mods-file/file', 'any/etc/apache2/sites-file/file', 'any/etc/apache2/sites-file/file.com', 'any/etc/httpd/conf.d/file.conf', 'any/etc/httpd/conf.d/file.conf-file', 'any/etc/httpd/file.conf', 'apache.conf', 'apache.conf-file', 'apache2.conf', 'apache2.conf-file', 'httpd.conf', 'httpd.conf-file', 'srm.conf', 'srm.conf-file'], 63 \ 'apachestyle': ['/etc/proftpd/file.config,/etc/proftpd/conf.file/file', '/etc/proftpd/conf.file/file', '/etc/proftpd/file.conf', '/etc/proftpd/file.conf-file', 'any/etc/proftpd/conf.file/file', 'any/etc/proftpd/file.conf', 'any/etc/proftpd/file.conf-file', 'proftpd.conf', 'proftpd.conf-file'], 64 \ 'applescript': ['file.scpt'], 65 \ 'aptconf': ['apt.conf', '/.aptitude/config', 'any/.aptitude/config'], 66 \ 'arch': ['.arch-inventory', '=tagging-method'], 67 \ 'arduino': ['file.ino', 'file.pde'], 68 \ 'art': ['file.art'], 69 \ 'asciidoc': ['file.asciidoc', 'file.adoc'], 70 \ 'asn': ['file.asn', 'file.asn1'], 71 \ 'asterisk': ['asterisk/file.conf', 'asterisk/file.conf-file', 'some-asterisk/file.conf', 'some-asterisk/file.conf-file'], 72 \ 'atlas': ['file.atl', 'file.as'], 73 \ 'autohotkey': ['file.ahk'], 74 \ 'autoit': ['file.au3'], 75 \ 'automake': ['GNUmakefile.am', 'makefile.am', 'Makefile.am'], 76 \ 'ave': ['file.ave'], 77 \ 'awk': ['file.awk', 'file.gawk'], 78 \ 'b': ['file.mch', 'file.ref', 'file.imp'], 79 \ 'bzl': ['file.bazel', 'file.bzl', 'WORKSPACE'], 80 \ 'bc': ['file.bc'], 81 \ 'bdf': ['file.bdf'], 82 \ 'bib': ['file.bib'], 83 \ 'bindzone': ['named.root', '/bind/db.file', '/named/db.file', 'any/bind/db.file', 'any/named/db.file'], 84 \ 'blank': ['file.bl'], 85 \ 'bsdl': ['file.bsd', 'file.bsdl', 'bsd', 'some-bsd'], 86 \ 'bst': ['file.bst'], 87 \ 'bzr': ['bzr_log.any', 'bzr_log.file'], 88 \ 'c': ['enlightenment/file.cfg', 'file.qc', 'file.c', 'some-enlightenment/file.cfg'], 89 \ 'cabal': ['file.cabal'], 90 \ 'cabalconfig': ['cabal.config'], 91 \ 'cabalproject': ['cabal.project', 'cabal.project.local'], 92 \ 'calendar': ['calendar', '/.calendar/file', '/share/calendar/any/calendar.file', '/share/calendar/calendar.file', 'any/share/calendar/any/calendar.file', 'any/share/calendar/calendar.file'], 93 \ 'catalog': ['catalog', 'sgml.catalogfile', 'sgml.catalog', 'sgml.catalog-file'], 94 \ 'cdl': ['file.cdl'], 95 \ 'cdrdaoconf': ['/etc/cdrdao.conf', '/etc/defaults/cdrdao', '/etc/default/cdrdao', '.cdrdao', 'any/etc/cdrdao.conf', 'any/etc/default/cdrdao', 'any/etc/defaults/cdrdao'], 96 \ 'cdrtoc': ['file.toc'], 97 \ 'cf': ['file.cfm', 'file.cfi', 'file.cfc'], 98 \ 'cfengine': ['cfengine.conf'], 99 \ 'cfg': ['file.cfg', 'file.hgrc', 'filehgrc', 'hgrc', 'some-hgrc'], 100 \ 'ch': ['file.chf'], 101 \ 'chaiscript': ['file.chai'], 102 \ 'chaskell': ['file.chs'], 103 \ 'chill': ['file..ch'], 104 \ 'chordpro': ['file.chopro', 'file.crd', 'file.cho', 'file.crdpro', 'file.chordpro'], 105 \ 'cl': ['file.eni'], 106 \ 'clean': ['file.dcl', 'file.icl'], 107 \ 'clojure': ['file.clj', 'file.cljs', 'file.cljx', 'file.cljc'], 108 \ 'cmake': ['CMakeLists.txt', 'file.cmake', 'file.cmake.in'], 109 \ 'cmusrc': ['any/.cmus/autosave', 'any/.cmus/rc', 'any/.cmus/command-history', 'any/.cmus/file.theme', 'any/cmus/rc', 'any/cmus/file.theme', '/.cmus/autosave', '/.cmus/command-history', '/.cmus/file.theme', '/.cmus/rc', '/cmus/file.theme', '/cmus/rc'], 110 \ 'cobol': ['file.cbl', 'file.cob', 'file.lib'], 111 \ 'coco': ['file.atg'], 112 \ 'conaryrecipe': ['file.recipe'], 113 \ 'conf': ['auto.master'], 114 \ 'config': ['configure.in', 'configure.ac', 'Pipfile', '/etc/hostname.file'], 115 \ 'context': ['tex/context/any/file.tex', 'file.mkii', 'file.mkiv', 'file.mkvi', 'file.mkxl', 'file.mklx'], 116 \ 'cpp': ['file.cxx', 'file.c++', 'file.hh', 'file.hxx', 'file.hpp', 'file.ipp', 'file.moc', 'file.tcc', 'file.inl', 'file.tlh'], 117 \ 'crm': ['file.crm'], 118 \ 'crontab': ['crontab', 'crontab.file', '/etc/cron.d/file', 'any/etc/cron.d/file'], 119 \ 'cs': ['file.cs'], 120 \ 'csc': ['file.csc'], 121 \ 'csdl': ['file.csdl'], 122 \ 'csp': ['file.csp', 'file.fdr'], 123 \ 'css': ['file.css'], 124 \ 'cterm': ['file.con'], 125 \ 'cucumber': ['file.feature'], 126 \ 'cuda': ['file.cu', 'file.cuh'], 127 \ 'cupl': ['file.pld'], 128 \ 'cuplsim': ['file.si'], 129 \ 'cvs': ['cvs123'], 130 \ 'cvsrc': ['.cvsrc'], 131 \ 'cynpp': ['file.cyn'], 132 \ 'dart': ['file.dart', 'file.drt'], 133 \ 'datascript': ['file.ds'], 134 \ 'dcd': ['file.dcd'], 135 \ 'debchangelog': ['changelog.Debian', 'changelog.dch', 'NEWS.Debian', 'NEWS.dch', '/debian/changelog'], 136 \ 'debcontrol': ['/debian/control', 'any/debian/control'], 137 \ 'debcopyright': ['/debian/copyright', 'any/debian/copyright'], 138 \ 'debsources': ['/etc/apt/sources.list', '/etc/apt/sources.list.d/file.list', 'any/etc/apt/sources.list', 'any/etc/apt/sources.list.d/file.list'], 139 \ 'def': ['file.def'], 140 \ 'denyhosts': ['denyhosts.conf'], 141 \ 'desc': ['file.desc'], 142 \ 'desktop': ['file.desktop', '.directory', 'file.directory'], 143 \ 'dictconf': ['dict.conf', '.dictrc'], 144 \ 'dictdconf': ['dictd.conf'], 145 \ 'diff': ['file.diff', 'file.rej'], 146 \ 'dircolors': ['.dir_colors', '.dircolors', '/etc/DIR_COLORS', 'any/etc/DIR_COLORS'], 147 \ 'dnsmasq': ['/etc/dnsmasq.conf', '/etc/dnsmasq.d/file', 'any/etc/dnsmasq.conf', 'any/etc/dnsmasq.d/file'], 148 \ 'dockerfile': ['Containerfile', 'Dockerfile', 'file.Dockerfile'], 149 \ 'dosbatch': ['file.bat', 'file.sys'], 150 \ 'dosini': ['.editorconfig', '/etc/pacman.conf', '/etc/yum.conf', 'file.ini', 'npmrc', '.npmrc', 'php.ini', 'php.ini-5', 'php.ini-file', '/etc/yum.repos.d/file', 'any/etc/pacman.conf', 'any/etc/yum.conf', 'any/etc/yum.repos.d/file'], 151 \ 'dot': ['file.dot', 'file.gv'], 152 \ 'dracula': ['file.drac', 'file.drc', 'filelvs', 'filelpe', 'drac.file', 'lpe', 'lvs', 'some-lpe', 'some-lvs'], 153 \ 'dsl': ['file.dsl'], 154 \ 'dtd': ['file.dtd'], 155 \ 'dts': ['file.dts', 'file.dtsi'], 156 \ 'dylan': ['file.dylan'], 157 \ 'dylanintr': ['file.intr'], 158 \ 'dylanlid': ['file.lid'], 159 \ 'ecd': ['file.ecd'], 160 \ 'edif': ['file.edf', 'file.edif', 'file.edo'], 161 \ 'elinks': ['elinks.conf'], 162 \ 'elm': ['file.elm'], 163 \ 'elmfilt': ['filter-rules'], 164 \ 'erlang': ['file.erl', 'file.hrl', 'file.yaws'], 165 \ 'eruby': ['file.erb', 'file.rhtml'], 166 \ 'esmtprc': ['anyesmtprc', 'esmtprc', 'some-esmtprc'], 167 \ 'esqlc': ['file.ec', 'file.EC'], 168 \ 'esterel': ['file.strl'], 169 \ 'eterm': ['anyEterm/file.cfg', 'Eterm/file.cfg', 'some-Eterm/file.cfg'], 170 \ 'exim': ['exim.conf'], 171 \ 'expect': ['file.exp'], 172 \ 'exports': ['exports'], 173 \ 'factor': ['file.factor'], 174 \ 'falcon': ['file.fal'], 175 \ 'fan': ['file.fan', 'file.fwt'], 176 \ 'fetchmail': ['.fetchmailrc'], 177 \ 'fgl': ['file.4gl', 'file.4gh', 'file.m4gl'], 178 \ 'focexec': ['file.fex', 'file.focexec'], 179 \ 'forth': ['file.fs', 'file.ft', 'file.fth'], 180 \ 'fortran': ['file.f', 'file.for', 'file.fortran', 'file.fpp', 'file.ftn', 'file.f77', 'file.f90', 'file.f95', 'file.f03', 'file.f08'], 181 \ 'framescript': ['file.fsl'], 182 \ 'freebasic': ['file.fb', 'file.bi'], 183 \ 'fstab': ['fstab', 'mtab'], 184 \ 'fvwm': ['/.fvwm/file', 'any/.fvwm/file'], 185 \ 'gdb': ['.gdbinit'], 186 \ 'gdmo': ['file.mo', 'file.gdmo'], 187 \ 'gedcom': ['file.ged', 'lltxxxxx.txt', '/tmp/lltmp', '/tmp/lltmp-file', 'any/tmp/lltmp', 'any/tmp/lltmp-file'], 188 \ 'gitcommit': ['COMMIT_EDITMSG', 'MERGE_MSG', 'TAG_EDITMSG'], 189 \ 'gitconfig': ['file.git/config', '.gitconfig', '.gitmodules', 'file.git/modules//config', '/.config/git/config', '/etc/gitconfig', '/etc/gitconfig.d/file', '/.gitconfig.d/file', 'any/.config/git/config', 'any/.gitconfig.d/file', 'some.git/config', 'some.git/modules/any/config'], 190 \ 'gitolite': ['gitolite.conf', '/gitolite-admin/conf/file', 'any/gitolite-admin/conf/file'], 191 \ 'gitrebase': ['git-rebase-todo'], 192 \ 'gitsendemail': ['.gitsendemail.msg.xxxxxx'], 193 \ 'gkrellmrc': ['gkrellmrc', 'gkrellmrc_x'], 194 \ 'gnash': ['gnashrc', '.gnashrc', 'gnashpluginrc', '.gnashpluginrc'], 195 \ 'gnuplot': ['file.gpi'], 196 \ 'go': ['file.go'], 197 \ 'gp': ['file.gp', '.gprc'], 198 \ 'gpg': ['/.gnupg/options', '/.gnupg/gpg.conf', '/usr/any/gnupg/options.skel', 'any/.gnupg/gpg.conf', 'any/.gnupg/options', 'any/usr/any/gnupg/options.skel'], 199 \ 'grads': ['file.gs'], 200 \ 'gretl': ['file.gretl'], 201 \ 'groovy': ['file.gradle', 'file.groovy'], 202 \ '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', '/etc/group', '/etc/group-', '/etc/group.edit', '/etc/gshadow', '/etc/gshadow-', '/etc/gshadow.edit', '/var/backups/group.bak', '/var/backups/gshadow.bak'], 203 \ 'grub': ['/boot/grub/menu.lst', '/boot/grub/grub.conf', '/etc/grub.conf', 'any/boot/grub/grub.conf', 'any/boot/grub/menu.lst', 'any/etc/grub.conf'], 204 \ 'gsp': ['file.gsp'], 205 \ 'gtkrc': ['.gtkrc', 'gtkrc', '.gtkrc-file', 'gtkrc-file'], 206 \ 'haml': ['file.haml'], 207 \ 'hamster': ['file.hsm'], 208 \ 'haskell': ['file.hs', 'file.hsc', 'file.hs-boot'], 209 \ 'haste': ['file.ht'], 210 \ 'hastepreproc': ['file.htpp'], 211 \ 'hb': ['file.hb'], 212 \ 'hercules': ['file.vc', 'file.ev', 'file.sum', 'file.errsum'], 213 \ 'hex': ['file.hex', 'file.h32'], 214 \ 'hgcommit': ['hg-editor-file.txt'], 215 \ 'hog': ['file.hog', 'snort.conf', 'vision.conf'], 216 \ 'hollywood': ['file.hws'], 217 \ 'hostconf': ['/etc/host.conf', 'any/etc/host.conf'], 218 \ 'hostsaccess': ['/etc/hosts.allow', '/etc/hosts.deny', 'any/etc/hosts.allow', 'any/etc/hosts.deny'], 219 \ 'logcheck': ['/etc/logcheck/file.d-some/file', '/etc/logcheck/file.d/file', 'any/etc/logcheck/file.d-some/file', 'any/etc/logcheck/file.d/file'], 220 \ 'modula3': ['file.m3', 'file.mg', 'file.i3', 'file.ig'], 221 \ 'natural': ['file.NSA', 'file.NSC', 'file.NSG', 'file.NSL', 'file.NSM', 'file.NSN', 'file.NSP', 'file.NSS'], 222 \ 'neomuttrc': ['Neomuttrc', '.neomuttrc', '.neomuttrc-file', '/.neomutt/neomuttrc', '/.neomutt/neomuttrc-file', 'Neomuttrc', 'Neomuttrc-file', 'any/.neomutt/neomuttrc', 'any/.neomutt/neomuttrc-file', 'neomuttrc', 'neomuttrc-file'], 223 \ 'opl': ['file.OPL', 'file.OPl', 'file.OpL', 'file.Opl', 'file.oPL', 'file.oPl', 'file.opL', 'file.opl'], 224 \ 'pcmk': ['file.pcmk'], 225 \ 'r': ['file.r'], 226 \ 'rhelp': ['file.rd'], 227 \ 'rmd': ['file.rmd', 'file.smd'], 228 \ 'rnoweb': ['file.rnw', 'file.snw'], 229 \ 'rrst': ['file.rrst', 'file.srst'], 230 \ 'template': ['file.tmpl'], 231 \ 'htmlm4': ['file.html.m4'], 232 \ 'httest': ['file.htt', 'file.htb'], 233 \ 'ibasic': ['file.iba', 'file.ibi'], 234 \ 'icemenu': ['/.icewm/menu', 'any/.icewm/menu'], 235 \ 'icon': ['file.icn'], 236 \ 'indent': ['.indent.pro', 'indentrc'], 237 \ 'inform': ['file.inf', 'file.INF'], 238 \ 'initng': ['/etc/initng/any/file.i', 'file.ii', 'any/etc/initng/any/file.i'], 239 \ 'inittab': ['inittab'], 240 \ 'ipfilter': ['ipf.conf', 'ipf6.conf', 'ipf.rules'], 241 \ 'iss': ['file.iss'], 242 \ 'ist': ['file.ist', 'file.mst'], 243 \ 'j': ['file.ijs'], 244 \ 'jal': ['file.jal', 'file.JAL'], 245 \ 'jam': ['file.jpl', 'file.jpr', 'JAM-file.file', 'JAM.file', 'Prl-file.file', 'Prl.file'], 246 \ 'java': ['file.java', 'file.jav'], 247 \ 'javacc': ['file.jj', 'file.jjt'], 248 \ 'javascript': ['file.js', 'file.javascript', 'file.es', 'file.mjs', 'file.cjs'], 249 \ 'javascriptreact': ['file.jsx'], 250 \ 'jess': ['file.clp'], 251 \ 'jgraph': ['file.jgr'], 252 \ 'jovial': ['file.jov', 'file.j73', 'file.jovial'], 253 \ 'jproperties': ['file.properties', 'file.properties_xx', 'file.properties_xx_xx', 'some.properties_xx_xx_file'], 254 \ 'json': ['file.json', 'file.jsonp', 'file.webmanifest', 'Pipfile.lock'], 255 \ 'jsp': ['file.jsp'], 256 \ 'kconfig': ['Kconfig', 'Kconfig.debug', 'Kconfig.file'], 257 \ 'kivy': ['file.kv'], 258 \ 'kix': ['file.kix'], 259 \ 'kotlin': ['file.kt', 'file.ktm', 'file.kts'], 260 \ 'kscript': ['file.ks'], 261 \ 'kwt': ['file.k'], 262 \ 'lace': ['file.ace', 'file.ACE'], 263 \ 'latte': ['file.latte', 'file.lte'], 264 \ 'ld': ['file.ld'], 265 \ 'ldif': ['file.ldif'], 266 \ 'less': ['file.less'], 267 \ 'lex': ['file.lex', 'file.l', 'file.lxx', 'file.l++'], 268 \ 'lftp': ['lftp.conf', '.lftprc', 'anylftp/rc', 'lftp/rc', 'some-lftp/rc'], 269 \ 'lhaskell': ['file.lhs'], 270 \ 'libao': ['/etc/libao.conf', '/.libao', 'any/.libao', 'any/etc/libao.conf'], 271 \ 'lifelines': ['file.ll'], 272 \ 'lilo': ['lilo.conf', 'lilo.conf-file'], 273 \ 'limits': ['/etc/limits', '/etc/anylimits.conf', '/etc/anylimits.d/file.conf', '/etc/limits.conf', '/etc/limits.d/file.conf', '/etc/some-limits.conf', '/etc/some-limits.d/file.conf', 'any/etc/limits', 'any/etc/limits.conf', 'any/etc/limits.d/file.conf', 'any/etc/some-limits.conf', 'any/etc/some-limits.d/file.conf'], 274 \ 'liquid': ['file.liquid'], 275 \ 'lisp': ['file.lsp', 'file.lisp', 'file.el', 'file.cl', '.emacs', '.sawfishrc', 'sbclrc', '.sbclrc'], 276 \ 'lite': ['file.lite', 'file.lt'], 277 \ 'litestep': ['/LiteStep/any/file.rc', 'any/LiteStep/any/file.rc'], 278 \ 'loginaccess': ['/etc/login.access', 'any/etc/login.access'], 279 \ 'logindefs': ['/etc/login.defs', 'any/etc/login.defs'], 280 \ 'logtalk': ['file.lgt'], 281 \ 'lotos': ['file.lot', 'file.lotos'], 282 \ 'lout': ['file.lou', 'file.lout'], 283 \ 'lprolog': ['file.sig'], 284 \ 'lsl': ['file.lsl'], 285 \ 'lss': ['file.lss'], 286 \ 'lua': ['file.lua', 'file.rockspec', 'file.nse'], 287 \ 'lynx': ['lynx.cfg'], 288 \ 'm4': ['file.at'], 289 \ 'mail': ['snd.123', '.letter', '.letter.123', '.followup', '.article', '.article.123', 'pico.123', 'mutt-xx-xxx', 'muttng-xx-xxx', 'ae123.txt', 'file.eml', 'reportbug-file'], 290 \ 'mailaliases': ['/etc/mail/aliases', '/etc/aliases', 'any/etc/aliases', 'any/etc/mail/aliases'], 291 \ 'mailcap': ['.mailcap', 'mailcap'], 292 \ 'make': ['file.mk', 'file.mak', 'file.dsp', 'makefile', 'Makefile', 'makefile-file', 'Makefile-file', 'some-makefile', 'some-Makefile'], 293 \ 'mallard': ['file.page'], 294 \ 'man': ['file.man'], 295 \ 'manconf': ['/etc/man.conf', 'man.config', 'any/etc/man.conf'], 296 \ 'map': ['file.map'], 297 \ 'maple': ['file.mv', 'file.mpl', 'file.mws'], 298 \ 'markdown': ['file.markdown', 'file.mdown', 'file.mkd', 'file.mkdn', 'file.mdwn', 'file.md'], 299 \ 'mason': ['file.mason', 'file.mhtml', 'file.comp'], 300 \ 'master': ['file.mas', 'file.master'], 301 \ 'mel': ['file.mel'], 302 \ 'meson': ['meson.build', 'meson_options.txt'], 303 \ 'messages': ['/log/auth', '/log/cron', '/log/daemon', '/log/debug', '/log/kern', '/log/lpr', '/log/mail', '/log/messages', '/log/news/news', '/log/syslog', '/log/user', 304 \ '/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', 305 \ '/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', 306 \ '/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', 307 \ '/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', 308 \ '/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', 309 \ '/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'], 310 \ 'mf': ['file.mf'], 311 \ 'mgl': ['file.mgl'], 312 \ 'mgp': ['file.mgp'], 313 \ 'mib': ['file.mib', 'file.my'], 314 \ 'mix': ['file.mix', 'file.mixal'], 315 \ 'mma': ['file.nb'], 316 \ 'mmp': ['file.mmp'], 317 \ 'modconf': ['/etc/modules.conf', '/etc/modules', '/etc/conf.modules', '/etc/modprobe.file', 'any/etc/conf.modules', 'any/etc/modprobe.file', 'any/etc/modules', 'any/etc/modules.conf'], 318 \ 'modula2': ['file.m2', 'file.mi'], 319 \ 'monk': ['file.isc', 'file.monk', 'file.ssc', 'file.tsc'], 320 \ 'moo': ['file.moo'], 321 \ 'mp': ['file.mp'], 322 \ 'mplayerconf': ['mplayer.conf', '/.mplayer/config', 'any/.mplayer/config'], 323 \ 'mrxvtrc': ['mrxvtrc', '.mrxvtrc'], 324 \ 'msidl': ['file.odl', 'file.mof'], 325 \ 'msql': ['file.msql'], 326 \ 'mupad': ['file.mu'], 327 \ 'mush': ['file.mush'], 328 \ 'muttrc': ['Muttngrc', 'Muttrc', '.muttngrc', '.muttngrc-file', '.muttrc', '.muttrc-file', '/.mutt/muttngrc', '/.mutt/muttngrc-file', '/.mutt/muttrc', '/.mutt/muttrc-file', '/.muttng/muttngrc', '/.muttng/muttngrc-file', '/.muttng/muttrc', '/.muttng/muttrc-file', '/etc/Muttrc.d/file', 'Muttngrc-file', 'Muttrc-file', 'any/.mutt/muttngrc', 'any/.mutt/muttngrc-file', 'any/.mutt/muttrc', 'any/.mutt/muttrc-file', 'any/.muttng/muttngrc', 'any/.muttng/muttngrc-file', 'any/.muttng/muttrc', 'any/.muttng/muttrc-file', 'any/etc/Muttrc.d/file', 'muttngrc', 'muttngrc-file', 'muttrc', 'muttrc-file'], 329 \ 'mysql': ['file.mysql'], 330 \ 'n1ql': ['file.n1ql', 'file.nql'], 331 \ 'named': ['namedfile.conf', 'rndcfile.conf', 'named-file.conf', 'named.conf', 'rndc-file.conf', 'rndc-file.key', 'rndc.conf', 'rndc.key'], 332 \ 'nanorc': ['/etc/nanorc', 'file.nanorc', 'any/etc/nanorc'], 333 \ 'ncf': ['file.ncf'], 334 \ 'netrc': ['.netrc'], 335 \ 'ninja': ['file.ninja'], 336 \ 'nqc': ['file.nqc'], 337 \ 'nroff': ['file.tr', 'file.nr', 'file.roff', 'file.tmac', 'file.mom', 'tmac.file'], 338 \ 'nsis': ['file.nsi', 'file.nsh'], 339 \ 'obj': ['file.obj'], 340 \ 'ocaml': ['file.ml', 'file.mli', 'file.mll', 'file.mly', '.ocamlinit'], 341 \ 'occam': ['file.occ'], 342 \ 'omnimark': ['file.xom', 'file.xin'], 343 \ 'openroad': ['file.or'], 344 \ 'ora': ['file.ora'], 345 \ 'pamconf': ['/etc/pam.conf', '/etc/pam.d/file', 'any/etc/pam.conf', 'any/etc/pam.d/file'], 346 \ 'pamenv': ['/etc/security/pam_env.conf', '/home/user/.pam_environment', '.pam_environment', 'pam_env.conf'], 347 \ 'papp': ['file.papp', 'file.pxml', 'file.pxsl'], 348 \ 'pascal': ['file.pas', 'file.pp', 'file.dpr', 'file.lpr'], 349 \ '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', '/etc/passwd', '/etc/passwd-', '/etc/passwd.edit', '/etc/shadow', '/etc/shadow-', '/etc/shadow.edit', '/var/backups/passwd.bak', '/var/backups/shadow.bak'], 350 \ 'pbtxt': ['file.pbtxt'], 351 \ 'pccts': ['file.g'], 352 \ 'pdf': ['file.pdf'], 353 \ 'perl': ['file.plx', 'file.al', 'file.psgi', 'gitolite.rc', '.gitolite.rc', 'example.gitolite.rc'], 354 \ 'perl6': ['file.p6', 'file.pm6', 'file.pl6', 'file.raku', 'file.rakumod'], 355 \ 'pf': ['pf.conf'], 356 \ 'pfmain': ['main.cf'], 357 \ 'php': ['file.php', 'file.php9', 'file.phtml', 'file.ctp'], 358 \ 'lpc': ['file.lpc', 'file.ulpc'], 359 \ 'pike': ['file.pike', 'file.pmod'], 360 \ 'cmod': ['file.cmod'], 361 \ 'pilrc': ['file.rcp'], 362 \ 'pine': ['.pinerc', 'pinerc', '.pinercex', 'pinercex'], 363 \ 'pinfo': ['/etc/pinforc', '/.pinforc', 'any/.pinforc', 'any/etc/pinforc'], 364 \ 'pli': ['file.pli', 'file.pl1'], 365 \ 'plm': ['file.plm', 'file.p36', 'file.pac'], 366 \ 'plp': ['file.plp'], 367 \ 'plsql': ['file.pls', 'file.plsql'], 368 \ 'po': ['file.po', 'file.pot'], 369 \ 'pod': ['file.pod'], 370 \ 'pod6': ['file.pod6'], 371 \ 'postscr': ['file.ps', 'file.pfa', 'file.afm', 'file.eps', 'file.epsf', 'file.epsi', 'file.ai'], 372 \ 'pov': ['file.pov'], 373 \ 'povini': ['.povrayrc'], 374 \ 'ppd': ['file.ppd'], 375 \ 'ppwiz': ['file.it', 'file.ih'], 376 \ 'privoxy': ['file.action'], 377 \ 'proc': ['file.pc'], 378 \ 'procmail': ['.procmail', '.procmailrc'], 379 \ 'prolog': ['file.pdb'], 380 \ 'promela': ['file.pml'], 381 \ 'proto': ['file.proto'], 382 \ 'protocols': ['/etc/protocols', 'any/etc/protocols'], 383 \ 'psf': ['file.psf'], 384 \ 'pyrex': ['file.pyx', 'file.pxd'], 385 \ 'python': ['file.py', 'file.pyw', '.pythonstartup', '.pythonrc', 'file.ptl', 'file.pyi', 'SConstruct'], 386 \ 'quake': ['anybaseq2/file.cfg', 'anyid1/file.cfg', 'quake3/file.cfg', 'baseq2/file.cfg', 'id1/file.cfg', 'quake1/file.cfg', 'some-baseq2/file.cfg', 'some-id1/file.cfg', 'some-quake1/file.cfg'], 387 \ 'radiance': ['file.rad', 'file.mat'], 388 \ 'ratpoison': ['.ratpoisonrc', 'ratpoisonrc'], 389 \ 'rc': ['file.rc', 'file.rch'], 390 \ 'rcs': ['file,v'], 391 \ 'readline': ['.inputrc', 'inputrc'], 392 \ 'remind': ['.reminders', 'file.remind', 'file.rem', '.reminders-file'], 393 \ 'rego': ['file.rego'], 394 \ 'resolv': ['resolv.conf'], 395 \ 'reva': ['file.frt'], 396 \ 'rexx': ['file.rex', 'file.orx', 'file.rxo', 'file.rxj', 'file.jrexx', 'file.rexxj', 'file.rexx', 'file.testGroup', 'file.testUnit'], 397 \ 'rib': ['file.rib'], 398 \ 'rnc': ['file.rnc'], 399 \ 'rng': ['file.rng'], 400 \ 'robots': ['robots.txt'], 401 \ 'rpcgen': ['file.x'], 402 \ 'rpl': ['file.rpl'], 403 \ 'rst': ['file.rst'], 404 \ 'rtf': ['file.rtf'], 405 \ 'ruby': ['.irbrc', 'irbrc', 'file.rb', 'file.rbw', 'file.gemspec', 'file.ru', 'Gemfile', 'file.builder', 'file.rxml', 'file.rjs', 'file.rant', 'file.rake', 'rakefile', 'Rakefile', 'rantfile', 'Rantfile', 'rakefile-file', 'Rakefile-file'], 406 \ 'rust': ['file.rs'], 407 \ 'samba': ['smb.conf'], 408 \ 'sas': ['file.sas'], 409 \ 'sass': ['file.sass'], 410 \ 'sather': ['file.sa'], 411 \ 'sbt': ['file.sbt'], 412 \ 'scala': ['file.scala'], 413 \ 'scheme': ['file.scm', 'file.ss', 'file.rkt'], 414 \ 'scilab': ['file.sci', 'file.sce'], 415 \ 'screen': ['.screenrc', 'screenrc'], 416 \ 'scss': ['file.scss'], 417 \ 'sd': ['file.sd'], 418 \ 'sdc': ['file.sdc'], 419 \ 'sdl': ['file.sdl', 'file.pr'], 420 \ 'sed': ['file.sed'], 421 \ 'sensors': ['/etc/sensors.conf', '/etc/sensors3.conf', 'any/etc/sensors.conf', 'any/etc/sensors3.conf'], 422 \ 'services': ['/etc/services', 'any/etc/services'], 423 \ 'setserial': ['/etc/serial.conf', 'any/etc/serial.conf'], 424 \ 'sh': ['/etc/udev/cdsymlinks.conf', 'any/etc/udev/cdsymlinks.conf'], 425 \ 'sieve': ['file.siv', 'file.sieve'], 426 \ 'simula': ['file.sim'], 427 \ 'sinda': ['file.sin', 'file.s85'], 428 \ 'sisu': ['file.sst', 'file.ssm', 'file.ssi', 'file.-sst', 'file._sst', 'file.sst.meta', 'file.-sst.meta', 'file._sst.meta'], 429 \ 'skill': ['file.il', 'file.ils', 'file.cdf'], 430 \ 'slang': ['file.sl'], 431 \ 'slice': ['file.ice'], 432 \ 'slpconf': ['/etc/slp.conf', 'any/etc/slp.conf'], 433 \ 'slpreg': ['/etc/slp.reg', 'any/etc/slp.reg'], 434 \ 'slpspi': ['/etc/slp.spi', 'any/etc/slp.spi'], 435 \ 'slrnrc': ['.slrnrc'], 436 \ 'slrnsc': ['file.score'], 437 \ 'sm': ['sendmail.cf'], 438 \ 'smarty': ['file.tpl'], 439 \ 'smcl': ['file.hlp', 'file.ihlp', 'file.smcl'], 440 \ 'smith': ['file.smt', 'file.smith'], 441 \ 'sml': ['file.sml'], 442 \ 'snobol4': ['file.sno', 'file.spt'], 443 \ 'spec': ['file.spec'], 444 \ 'spice': ['file.sp', 'file.spice'], 445 \ 'spup': ['file.speedup', 'file.spdata', 'file.spd'], 446 \ 'spyce': ['file.spy', 'file.spi'], 447 \ 'sql': ['file.tyb', 'file.typ', 'file.tyc', 'file.pkb', 'file.pks'], 448 \ 'sqlj': ['file.sqlj'], 449 \ 'sqr': ['file.sqr', 'file.sqi'], 450 \ 'squid': ['squid.conf'], 451 \ 'srec': ['file.s19', 'file.s28', 'file.s37', 'file.mot', 'file.srec'], 452 \ 'sshconfig': ['ssh_config', '/.ssh/config', '/etc/ssh/ssh_config.d/file.conf', 'any/etc/ssh/ssh_config.d/file.conf', 'any/.ssh/config'], 453 \ 'sshdconfig': ['sshd_config', '/etc/ssh/sshd_config.d/file.conf', 'any/etc/ssh/sshd_config.d/file.conf'], 454 \ 'st': ['file.st'], 455 \ 'stata': ['file.ado', 'file.do', 'file.imata', 'file.mata'], 456 \ 'stp': ['file.stp'], 457 \ 'sudoers': ['any/etc/sudoers', 'sudoers.tmp', '/etc/sudoers'], 458 \ 'svg': ['file.svg'], 459 \ 'svn': ['svn-commitfile.tmp', 'svn-commit-file.tmp', 'svn-commit.tmp'], 460 \ 'swift': ['file.swift'], 461 \ 'swiftgyb': ['file.swift.gyb'], 462 \ 'sil': ['file.sil'], 463 \ 'sysctl': ['/etc/sysctl.conf', '/etc/sysctl.d/file.conf', 'any/etc/sysctl.conf', 'any/etc/sysctl.d/file.conf'], 464 \ 'systemd': ['any/systemd/file.automount', 'any/systemd/file.dnssd', 'any/systemd/file.link', 'any/systemd/file.mount', 'any/systemd/file.netdev', 'any/systemd/file.network', 'any/systemd/file.nspawn', 'any/systemd/file.path', 'any/systemd/file.service', 'any/systemd/file.slice', 'any/systemd/file.socket', 'any/systemd/file.swap', 'any/systemd/file.target', 'any/systemd/file.timer', '/etc/systemd/some.conf.d/file.conf', '/etc/systemd/system/some.d/file.conf', '/etc/systemd/system/some.d/.#file', '/etc/systemd/system/.#otherfile', '/home/user/.config/systemd/user/some.d/mine.conf', '/home/user/.config/systemd/user/some.d/.#file', '/home/user/.config/systemd/user/.#otherfile', '/.config/systemd/user/.#', '/.config/systemd/user/.#-file', '/.config/systemd/user/file.d/.#', '/.config/systemd/user/file.d/.#-file', '/.config/systemd/user/file.d/file.conf', '/etc/systemd/file.conf.d/file.conf', '/etc/systemd/system/.#', '/etc/systemd/system/.#-file', '/etc/systemd/system/file.d/.#', '/etc/systemd/system/file.d/.#-file', '/etc/systemd/system/file.d/file.conf', '/systemd/file.automount', '/systemd/file.dnssd', '/systemd/file.link', '/systemd/file.mount', '/systemd/file.netdev', '/systemd/file.network', '/systemd/file.nspawn', '/systemd/file.path', '/systemd/file.service', '/systemd/file.slice', '/systemd/file.socket', '/systemd/file.swap', '/systemd/file.target', '/systemd/file.timer', 'any/.config/systemd/user/.#', 'any/.config/systemd/user/.#-file', 'any/.config/systemd/user/file.d/.#', 'any/.config/systemd/user/file.d/.#-file', 'any/.config/systemd/user/file.d/file.conf', 'any/etc/systemd/file.conf.d/file.conf', 'any/etc/systemd/system/.#', 'any/etc/systemd/system/.#-file', 'any/etc/systemd/system/file.d/.#', 'any/etc/systemd/system/file.d/.#-file', 'any/etc/systemd/system/file.d/file.conf'], 465 \ 'systemverilog': ['file.sv', 'file.svh'], 466 \ 'tags': ['tags'], 467 \ 'tak': ['file.tak'], 468 \ 'taskdata': ['pending.data', 'completed.data', 'undo.data'], 469 \ 'taskedit': ['file.task'], 470 \ 'tcl': ['file.tcl', 'file.tk', 'file.itcl', 'file.itk', 'file.jacl'], 471 \ 'teraterm': ['file.ttl'], 472 \ 'terminfo': ['file.ti'], 473 \ 'tex': ['file.latex', 'file.sty', 'file.dtx', 'file.ltx', 'file.bbl'], 474 \ 'texinfo': ['file.texinfo', 'file.texi', 'file.txi'], 475 \ 'texmf': ['texmf.cnf'], 476 \ 'text': ['file.text', 'README'], 477 \ 'tf': ['file.tf', '.tfrc', 'tfrc'], 478 \ 'tidy': ['.tidyrc', 'tidyrc', 'tidy.conf'], 479 \ 'tilde': ['file.t.html'], 480 \ 'tli': ['file.tli'], 481 \ 'tmux': ['tmuxfile.conf', '.tmuxfile.conf', '.tmux-file.conf', '.tmux.conf', 'tmux-file.conf', 'tmux.conf'], 482 \ 'toml': ['file.toml'], 483 \ 'tpp': ['file.tpp'], 484 \ 'treetop': ['file.treetop'], 485 \ 'trustees': ['trustees.conf'], 486 \ 'tsalt': ['file.slt'], 487 \ 'tsscl': ['file.tsscl'], 488 \ 'tssgm': ['file.tssgm'], 489 \ 'tssop': ['file.tssop'], 490 \ 'twig': ['file.twig'], 491 \ 'typescriptreact': ['file.tsx'], 492 \ 'uc': ['file.uc'], 493 \ 'udevconf': ['/etc/udev/udev.conf', 'any/etc/udev/udev.conf'], 494 \ 'udevperm': ['/etc/udev/permissions.d/file.permissions', 'any/etc/udev/permissions.d/file.permissions'], 495 \ 'udevrules': ['/etc/udev/rules.d/file.rules', '/usr/lib/udev/rules.d/file.rules', '/lib/udev/rules.d/file.rules'], 496 \ 'uil': ['file.uit', 'file.uil'], 497 \ 'updatedb': ['/etc/updatedb.conf', 'any/etc/updatedb.conf'], 498 \ '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', 'any/.config/upstart/file.conf', 'any/.config/upstart/file.override', 'any/.init/file.conf', 'any/.init/file.override', 'any/etc/init/file.conf', 'any/etc/init/file.override', 'any/usr/share/upstart/file.conf', 'any/usr/share/upstart/file.override'], 499 \ 'upstreamdat': ['upstream.dat', 'UPSTREAM.DAT', 'upstream.file.dat', 'UPSTREAM.FILE.DAT', 'file.upstream.dat', 'FILE.UPSTREAM.DAT'], 500 \ 'upstreaminstalllog': ['upstreaminstall.log', 'UPSTREAMINSTALL.LOG', 'upstreaminstall.file.log', 'UPSTREAMINSTALL.FILE.LOG', 'file.upstreaminstall.log', 'FILE.UPSTREAMINSTALL.LOG'], 501 \ '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'], 502 \ 'usserverlog': ['usserver.log', 'USSERVER.LOG', 'usserver.file.log', 'USSERVER.FILE.LOG', 'file.usserver.log', 'FILE.USSERVER.LOG'], 503 \ 'usw2kagtlog': ['usw2kagt.log', 'USW2KAGT.LOG', 'usw2kagt.file.log', 'USW2KAGT.FILE.LOG', 'file.usw2kagt.log', 'FILE.USW2KAGT.LOG'], 504 \ 'vb': ['file.sba', 'file.vb', 'file.vbs', 'file.dsm', 'file.ctl'], 505 \ 'vera': ['file.vr', 'file.vri', 'file.vrh'], 506 \ 'verilog': ['file.v'], 507 \ 'verilogams': ['file.va', 'file.vams'], 508 \ 'vgrindefs': ['vgrindefs'], 509 \ 'vhdl': ['file.hdl', 'file.vhd', 'file.vhdl', 'file.vbe', 'file.vst', 'file.vhdl_123', 'file.vho', 'some.vhdl_1', 'some.vhdl_1-file'], 510 \ 'vim': ['file.vim', 'file.vba', '.exrc', '_exrc', 'some-vimrc', 'some-vimrc-file', 'vimrc', 'vimrc-file'], 511 \ 'viminfo': ['.viminfo', '_viminfo'], 512 \ 'vmasm': ['file.mar'], 513 \ 'voscm': ['file.cm'], 514 \ 'vrml': ['file.wrl'], 515 \ 'vroom': ['file.vroom'], 516 \ 'vue': ['file.vue'], 517 \ 'wast': ['file.wast', 'file.wat'], 518 \ 'webmacro': ['file.wm'], 519 \ 'wget': ['.wgetrc', 'wgetrc'], 520 \ 'winbatch': ['file.wbt'], 521 \ 'wml': ['file.wml'], 522 \ 'wsh': ['file.wsf', 'file.wsc'], 523 \ 'wsml': ['file.wsml'], 524 \ 'wvdial': ['wvdial.conf', '.wvdialrc'], 525 \ 'xdefaults': ['.Xdefaults', '.Xpdefaults', '.Xresources', 'xdm-config', 'file.ad', '/Xresources/file', '/app-defaults/file', 'Xresources', 'Xresources-file', 'any/Xresources/file', 'any/app-defaults/file'], 526 \ 'xhtml': ['file.xhtml', 'file.xht'], 527 \ 'xinetd': ['/etc/xinetd.conf', '/etc/xinetd.d/file', 'any/etc/xinetd.conf', 'any/etc/xinetd.d/file'], 528 \ 'xmath': ['file.msc', 'file.msf'], 529 \ 'xml': ['/etc/blkid.tab', '/etc/blkid.tab.old', 'file.xmi', 'file.csproj', 'file.csproj.user', 'file.ui', 'file.tpm', '/etc/xdg/menus/file.menu', 'fglrxrc', 'file.xlf', 'file.xliff', 'file.xul', 'file.wsdl', 'file.wpl', 'any/etc/blkid.tab', 'any/etc/blkid.tab.old', 'any/etc/xdg/menus/file.menu'], 530 \ 'xmodmap': ['anyXmodmap', 'Xmodmap', 'some-Xmodmap', 'some-xmodmap', 'some-xmodmap-file', 'xmodmap', 'xmodmap-file'], 531 \ 'xf86conf': ['xorg.conf', 'xorg.conf-4'], 532 \ 'xpm2': ['file.xpm2'], 533 \ 'xquery': ['file.xq', 'file.xql', 'file.xqm', 'file.xquery', 'file.xqy'], 534 \ 'xs': ['file.xs'], 535 \ 'xsd': ['file.xsd'], 536 \ 'xslt': ['file.xsl', 'file.xslt'], 537 \ 'yacc': ['file.yy', 'file.yxx', 'file.y++'], 538 \ 'yaml': ['file.yaml', 'file.yml'], 539 \ 'raml': ['file.raml'], 540 \ 'z8a': ['file.z8a'], 541 \ 'zimbu': ['file.zu'], 542 \ 'zimbutempl': ['file.zut'], 543 \ 'zsh': ['.zprofile', '/etc/zprofile', '.zfbfmarks', 'file.zsh', '.zcompdump', '.zlogin', '.zlogout', '.zshenv', '.zshrc', '.zcompdump-file', '.zlog', '.zlog-file', '.zsh', '.zsh-file', 'any/etc/zprofile', 'zlog', 'zlog-file', 'zsh', 'zsh-file'], 544 \ 545 \ 'help': [$VIMRUNTIME . '/doc/help.txt'], 546 \ 'xpm': ['file.xpm'], 547 \ } 548 549let s:filename_case_checks = { 550 \ 'modula2': ['file.DEF', 'file.MOD'], 551 \ 'bzl': ['file.BUILD', 'BUILD'], 552 \ } 553 554func CheckItems(checks) 555 set noswapfile 556 for [ft, names] in items(a:checks) 557 for i in range(0, len(names) - 1) 558 new 559 try 560 exe 'edit ' . fnameescape(names[i]) 561 catch 562 call assert_report('cannot edit "' . names[i] . '": ' . v:exception) 563 endtry 564 if &filetype == '' && &readonly 565 " File exists but not able to edit it (permission denied) 566 else 567 call assert_equal(ft, &filetype, 'with file name: ' . names[i]) 568 endif 569 bwipe! 570 endfor 571 endfor 572 set swapfile& 573endfunc 574 575func Test_filetype_detection() 576 filetype on 577 call CheckItems(s:filename_checks) 578 if has('fname_case') 579 call CheckItems(s:filename_case_checks) 580 endif 581 filetype off 582endfunc 583 584" Filetypes detected from the file contents by scripts.vim 585let s:script_checks = { 586 \ 'virata': [['% Virata'], 587 \ ['', '% Virata'], 588 \ ['', '', '% Virata'], 589 \ ['', '', '', '% Virata'], 590 \ ['', '', '', '', '% Virata']], 591 \ 'strace': [['execve("/usr/bin/pstree", ["pstree"], 0x7ff0 /* 63 vars */) = 0'], 592 \ ['15:17:47 execve("/usr/bin/pstree", ["pstree"], ... "_=/usr/bin/strace"]) = 0'], 593 \ ['__libc_start_main and something']], 594 \ 'clojure': [['#!/path/clojure']], 595 \ 'scala': [['#!/path/scala']], 596 \ 'tcsh': [['#!/path/tcsh']], 597 \ 'zsh': [['#!/path/zsh']], 598 \ 'tcl': [['#!/path/tclsh'], 599 \ ['#!/path/wish'], 600 \ ['#!/path/expectk'], 601 \ ['#!/path/itclsh'], 602 \ ['#!/path/itkwish']], 603 \ 'expect': [['#!/path/expect']], 604 \ 'gnuplot': [['#!/path/gnuplot']], 605 \ 'make': [['#!/path/make']], 606 \ 'pike': [['#!/path/pike'], 607 \ ['#!/path/pike0'], 608 \ ['#!/path/pike9']], 609 \ 'lua': [['#!/path/lua']], 610 \ 'perl6': [['#!/path/perl6']], 611 \ 'perl': [['#!/path/perl']], 612 \ 'php': [['#!/path/php']], 613 \ 'python': [['#!/path/python'], 614 \ ['#!/path/python2'], 615 \ ['#!/path/python3']], 616 \ 'groovy': [['#!/path/groovy']], 617 \ 'ruby': [['#!/path/ruby']], 618 \ 'javascript': [['#!/path/node'], 619 \ ['#!/path/js'], 620 \ ['#!/path/nodejs'], 621 \ ['#!/path/rhino']], 622 \ 'bc': [['#!/path/bc']], 623 \ 'sed': [['#!/path/sed']], 624 \ 'ocaml': [['#!/path/ocaml']], 625 \ 'awk': [['#!/path/awk'], 626 \ ['#!/path/gawk']], 627 \ 'wml': [['#!/path/wml']], 628 \ 'scheme': [['#!/path/scheme']], 629 \ 'cfengine': [['#!/path/cfengine']], 630 \ 'erlang': [['#!/path/escript']], 631 \ 'haskell': [['#!/path/haskell']], 632 \ 'cpp': [['// Standard iostream objects -*- C++ -*-'], 633 \ ['// -*- C++ -*-']], 634 \ 'yaml': [['%YAML 1.2']], 635 \ } 636 637" Various forms of "env" optional arguments. 638let s:script_env_checks = { 639 \ 'perl': [['#!/usr/bin/env VAR=val perl']], 640 \ 'scala': [['#!/usr/bin/env VAR=val VVAR=vval scala']], 641 \ 'awk': [['#!/usr/bin/env VAR=val -i awk']], 642 \ 'scheme': [['#!/usr/bin/env VAR=val --ignore-environment scheme']], 643 \ 'python': [['#!/usr/bin/env VAR=val -S python -w -T']], 644 \ 'wml': [['#!/usr/bin/env VAR=val --split-string wml']], 645 \ } 646 647func Run_script_detection(test_dict) 648 filetype on 649 for [ft, files] in items(a:test_dict) 650 for file in files 651 call writefile(file, 'Xtest') 652 split Xtest 653 call assert_equal(ft, &filetype, 'for text: ' . string(file)) 654 bwipe! 655 endfor 656 endfor 657 call delete('Xtest') 658 filetype off 659endfunc 660 661func Test_script_detection() 662 call Run_script_detection(s:script_checks) 663 call Run_script_detection(s:script_env_checks) 664endfunc 665 666func Test_setfiletype_completion() 667 call feedkeys(":setfiletype java\<C-A>\<C-B>\"\<CR>", 'tx') 668 call assert_equal('"setfiletype java javacc javascript javascriptreact', @:) 669endfunc 670 671" Test for ':filetype detect' command for a buffer without a file 672func Test_emptybuf_ftdetect() 673 new 674 call setline(1, '#!/bin/sh') 675 call assert_equal('', &filetype) 676 filetype detect 677 call assert_equal('sh', &filetype) 678 close! 679endfunc 680 681" Test for ':filetype indent on' and ':filetype indent off' commands 682func Test_filetype_indent_off() 683 new Xtest.vim 684 filetype indent on 685 call assert_equal(1, g:did_indent_on) 686 call assert_equal(['filetype detection:ON plugin:OFF indent:ON'], 687 \ execute('filetype')->split("\n")) 688 filetype indent off 689 call assert_equal(0, exists('g:did_indent_on')) 690 call assert_equal(['filetype detection:ON plugin:OFF indent:OFF'], 691 \ execute('filetype')->split("\n")) 692 close 693endfunc 694 695func Test_hook_file() 696 filetype on 697 698 call writefile(['[Trigger]', 'this is pacman config'], 'Xfile.hook') 699 split Xfile.hook 700 call assert_equal('dosini', &filetype) 701 bwipe! 702 703 call writefile(['not pacman'], 'Xfile.hook') 704 split Xfile.hook 705 call assert_notequal('dosini', &filetype) 706 bwipe! 707 708 call delete('Xfile.hook') 709 filetype off 710endfunc 711 712func Test_ts_file() 713 filetype on 714 715 call writefile(['<?xml version="1.0" encoding="utf-8"?>'], 'Xfile.ts') 716 split Xfile.ts 717 call assert_equal('xml', &filetype) 718 bwipe! 719 720 call writefile(['// looks like Typescript'], 'Xfile.ts') 721 split Xfile.ts 722 call assert_equal('typescript', &filetype) 723 bwipe! 724 725 call delete('Xfile.ts') 726 filetype off 727endfunc 728 729 730" vim: shiftwidth=2 sts=2 expandtab 731