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', '/etc/httpd/mods-some/file', '/etc/httpd/sites-some/file', '/etc/httpd/conf.file/conf'], 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 \ 'beancount': ['file.beancount'], 83 \ 'bib': ['file.bib'], 84 \ 'bindzone': ['named.root', '/bind/db.file', '/named/db.file', 'any/bind/db.file', 'any/named/db.file'], 85 \ 'blank': ['file.bl'], 86 \ 'bsdl': ['file.bsd', 'file.bsdl', 'bsd', 'some-bsd'], 87 \ 'bst': ['file.bst'], 88 \ 'bzr': ['bzr_log.any', 'bzr_log.file'], 89 \ 'c': ['enlightenment/file.cfg', 'file.qc', 'file.c', 'some-enlightenment/file.cfg'], 90 \ 'cabal': ['file.cabal'], 91 \ 'cabalconfig': ['cabal.config'], 92 \ 'cabalproject': ['cabal.project', 'cabal.project.local'], 93 \ 'calendar': ['calendar', '/.calendar/file', '/share/calendar/any/calendar.file', '/share/calendar/calendar.file', 'any/share/calendar/any/calendar.file', 'any/share/calendar/calendar.file'], 94 \ 'catalog': ['catalog', 'sgml.catalogfile', 'sgml.catalog', 'sgml.catalog-file'], 95 \ 'cdl': ['file.cdl'], 96 \ 'cdrdaoconf': ['/etc/cdrdao.conf', '/etc/defaults/cdrdao', '/etc/default/cdrdao', '.cdrdao', 'any/etc/cdrdao.conf', 'any/etc/default/cdrdao', 'any/etc/defaults/cdrdao'], 97 \ 'cdrtoc': ['file.toc'], 98 \ 'cf': ['file.cfm', 'file.cfi', 'file.cfc'], 99 \ 'cfengine': ['cfengine.conf'], 100 \ 'cfg': ['file.cfg', 'file.hgrc', 'filehgrc', 'hgrc', 'some-hgrc'], 101 \ 'ch': ['file.chf'], 102 \ 'chaiscript': ['file.chai'], 103 \ 'chaskell': ['file.chs'], 104 \ 'chill': ['file..ch'], 105 \ 'chordpro': ['file.chopro', 'file.crd', 'file.cho', 'file.crdpro', 'file.chordpro'], 106 \ 'cl': ['file.eni'], 107 \ 'clean': ['file.dcl', 'file.icl'], 108 \ 'clojure': ['file.clj', 'file.cljs', 'file.cljx', 'file.cljc'], 109 \ 'cmake': ['CMakeLists.txt', 'file.cmake', 'file.cmake.in'], 110 \ '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'], 111 \ 'cobol': ['file.cbl', 'file.cob', 'file.lib'], 112 \ 'coco': ['file.atg'], 113 \ 'conaryrecipe': ['file.recipe'], 114 \ 'conf': ['auto.master'], 115 \ 'config': ['configure.in', 'configure.ac', 'Pipfile', '/etc/hostname.file'], 116 \ 'context': ['tex/context/any/file.tex', 'file.mkii', 'file.mkiv', 'file.mkvi', 'file.mkxl', 'file.mklx'], 117 \ 'cpp': ['file.cxx', 'file.c++', 'file.hh', 'file.hxx', 'file.hpp', 'file.ipp', 'file.moc', 'file.tcc', 'file.inl', 'file.tlh'], 118 \ 'crm': ['file.crm'], 119 \ 'crontab': ['crontab', 'crontab.file', '/etc/cron.d/file', 'any/etc/cron.d/file'], 120 \ 'cs': ['file.cs'], 121 \ 'csc': ['file.csc'], 122 \ 'csdl': ['file.csdl'], 123 \ 'csp': ['file.csp', 'file.fdr'], 124 \ 'css': ['file.css'], 125 \ 'cterm': ['file.con'], 126 \ 'cucumber': ['file.feature'], 127 \ 'cuda': ['file.cu', 'file.cuh'], 128 \ 'cupl': ['file.pld'], 129 \ 'cuplsim': ['file.si'], 130 \ 'cvs': ['cvs123'], 131 \ 'cvsrc': ['.cvsrc'], 132 \ 'cynpp': ['file.cyn'], 133 \ 'dart': ['file.dart', 'file.drt'], 134 \ 'datascript': ['file.ds'], 135 \ 'dcd': ['file.dcd'], 136 \ 'debchangelog': ['changelog.Debian', 'changelog.dch', 'NEWS.Debian', 'NEWS.dch', '/debian/changelog'], 137 \ 'debcontrol': ['/debian/control', 'any/debian/control'], 138 \ 'debcopyright': ['/debian/copyright', 'any/debian/copyright'], 139 \ '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'], 140 \ 'def': ['file.def'], 141 \ 'denyhosts': ['denyhosts.conf'], 142 \ 'desc': ['file.desc'], 143 \ 'desktop': ['file.desktop', '.directory', 'file.directory'], 144 \ 'dictconf': ['dict.conf', '.dictrc'], 145 \ 'dictdconf': ['dictd.conf', 'dictdfile.conf', 'dictd-file.conf'], 146 \ 'diff': ['file.diff', 'file.rej'], 147 \ 'dircolors': ['.dir_colors', '.dircolors', '/etc/DIR_COLORS', 'any/etc/DIR_COLORS'], 148 \ 'dnsmasq': ['/etc/dnsmasq.conf', '/etc/dnsmasq.d/file', 'any/etc/dnsmasq.conf', 'any/etc/dnsmasq.d/file'], 149 \ 'dockerfile': ['Containerfile', 'Dockerfile', 'file.Dockerfile'], 150 \ 'dosbatch': ['file.bat', 'file.sys'], 151 \ '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', 'file.wrap'], 152 \ 'dot': ['file.dot', 'file.gv'], 153 \ 'dracula': ['file.drac', 'file.drc', 'filelvs', 'filelpe', 'drac.file', 'lpe', 'lvs', 'some-lpe', 'some-lvs'], 154 \ 'dtd': ['file.dtd'], 155 \ 'dts': ['file.dts', 'file.dtsi'], 156 \ 'dune': ['jbuild', 'dune', 'dune-project', 'dune-workspace'], 157 \ 'dylan': ['file.dylan'], 158 \ 'dylanintr': ['file.intr'], 159 \ 'dylanlid': ['file.lid'], 160 \ 'ecd': ['file.ecd'], 161 \ 'edif': ['file.edf', 'file.edif', 'file.edo'], 162 \ 'elinks': ['elinks.conf'], 163 \ 'elixir': ['file.ex', 'file.exs', 'mix.lock'], 164 \ 'eelixir': ['file.eex', 'file.leex'], 165 \ 'elm': ['file.elm'], 166 \ 'elmfilt': ['filter-rules'], 167 \ 'epuppet': ['file.epp'], 168 \ 'erlang': ['file.erl', 'file.hrl', 'file.yaws'], 169 \ 'eruby': ['file.erb', 'file.rhtml'], 170 \ 'esmtprc': ['anyesmtprc', 'esmtprc', 'some-esmtprc'], 171 \ 'esqlc': ['file.ec', 'file.EC'], 172 \ 'esterel': ['file.strl'], 173 \ 'eterm': ['anyEterm/file.cfg', 'Eterm/file.cfg', 'some-Eterm/file.cfg'], 174 \ 'exim': ['exim.conf'], 175 \ 'expect': ['file.exp'], 176 \ 'exports': ['exports'], 177 \ 'factor': ['file.factor'], 178 \ 'falcon': ['file.fal'], 179 \ 'fan': ['file.fan', 'file.fwt'], 180 \ 'fennel': ['file.fnl'], 181 \ 'fetchmail': ['.fetchmailrc'], 182 \ 'fgl': ['file.4gl', 'file.4gh', 'file.m4gl'], 183 \ 'focexec': ['file.fex', 'file.focexec'], 184 \ 'forth': ['file.fs', 'file.ft', 'file.fth'], 185 \ 'fortran': ['file.f', 'file.for', 'file.fortran', 'file.fpp', 'file.ftn', 'file.f77', 'file.f90', 'file.f95', 'file.f03', 'file.f08'], 186 \ 'fpcmake': ['file.fpc'], 187 \ 'framescript': ['file.fsl'], 188 \ 'freebasic': ['file.fb', 'file.bi'], 189 \ 'fstab': ['fstab', 'mtab'], 190 \ 'fvwm': ['/.fvwm/file', 'any/.fvwm/file'], 191 \ 'gdb': ['.gdbinit'], 192 \ 'gdmo': ['file.mo', 'file.gdmo'], 193 \ 'gedcom': ['file.ged', 'lltxxxxx.txt', '/tmp/lltmp', '/tmp/lltmp-file', 'any/tmp/lltmp', 'any/tmp/lltmp-file'], 194 \ 'gemtext': ['file.gmi', 'file.gemini'], 195 \ 'gift': ['file.gift'], 196 \ 'gitcommit': ['COMMIT_EDITMSG', 'MERGE_MSG', 'TAG_EDITMSG'], 197 \ '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'], 198 \ 'gitolite': ['gitolite.conf', '/gitolite-admin/conf/file', 'any/gitolite-admin/conf/file'], 199 \ 'gitrebase': ['git-rebase-todo'], 200 \ 'gitsendemail': ['.gitsendemail.msg.xxxxxx'], 201 \ 'gkrellmrc': ['gkrellmrc', 'gkrellmrc_x'], 202 \ 'gnash': ['gnashrc', '.gnashrc', 'gnashpluginrc', '.gnashpluginrc'], 203 \ 'gnuplot': ['file.gpi'], 204 \ 'go': ['file.go'], 205 \ 'gp': ['file.gp', '.gprc'], 206 \ 'gpg': ['/.gnupg/options', '/.gnupg/gpg.conf', '/usr/any/gnupg/options.skel', 'any/.gnupg/gpg.conf', 'any/.gnupg/options', 'any/usr/any/gnupg/options.skel'], 207 \ 'grads': ['file.gs'], 208 \ 'gretl': ['file.gretl'], 209 \ 'groovy': ['file.gradle', 'file.groovy'], 210 \ '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'], 211 \ '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'], 212 \ 'gsp': ['file.gsp'], 213 \ 'gtkrc': ['.gtkrc', 'gtkrc', '.gtkrc-file', 'gtkrc-file'], 214 \ 'haml': ['file.haml'], 215 \ 'hamster': ['file.hsm'], 216 \ 'haskell': ['file.hs', 'file.hsc', 'file.hs-boot', 'file.hsig'], 217 \ 'haste': ['file.ht'], 218 \ 'hastepreproc': ['file.htpp'], 219 \ 'hb': ['file.hb'], 220 \ 'hercules': ['file.vc', 'file.ev', 'file.sum', 'file.errsum'], 221 \ 'hex': ['file.hex', 'file.h32'], 222 \ 'hgcommit': ['hg-editor-file.txt'], 223 \ 'hog': ['file.hog', 'snort.conf', 'vision.conf'], 224 \ 'hollywood': ['file.hws'], 225 \ 'hostconf': ['/etc/host.conf', 'any/etc/host.conf'], 226 \ 'hostsaccess': ['/etc/hosts.allow', '/etc/hosts.deny', 'any/etc/hosts.allow', 'any/etc/hosts.deny'], 227 \ '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'], 228 \ 'modula3': ['file.m3', 'file.mg', 'file.i3', 'file.ig'], 229 \ 'natural': ['file.NSA', 'file.NSC', 'file.NSG', 'file.NSL', 'file.NSM', 'file.NSN', 'file.NSP', 'file.NSS'], 230 \ 'neomuttrc': ['Neomuttrc', '.neomuttrc', '.neomuttrc-file', '/.neomutt/neomuttrc', '/.neomutt/neomuttrc-file', 'Neomuttrc', 'Neomuttrc-file', 'any/.neomutt/neomuttrc', 'any/.neomutt/neomuttrc-file', 'neomuttrc', 'neomuttrc-file'], 231 \ 'opl': ['file.OPL', 'file.OPl', 'file.OpL', 'file.Opl', 'file.oPL', 'file.oPl', 'file.opL', 'file.opl'], 232 \ 'pcmk': ['file.pcmk'], 233 \ 'r': ['file.r'], 234 \ 'rhelp': ['file.rd'], 235 \ 'rmd': ['file.rmd', 'file.smd'], 236 \ 'rnoweb': ['file.rnw', 'file.snw'], 237 \ 'rrst': ['file.rrst', 'file.srst'], 238 \ 'template': ['file.tmpl'], 239 \ 'htmlm4': ['file.html.m4'], 240 \ 'httest': ['file.htt', 'file.htb'], 241 \ 'ibasic': ['file.iba', 'file.ibi'], 242 \ 'icemenu': ['/.icewm/menu', 'any/.icewm/menu'], 243 \ 'icon': ['file.icn'], 244 \ 'indent': ['.indent.pro', 'indentrc'], 245 \ 'inform': ['file.inf', 'file.INF'], 246 \ 'initng': ['/etc/initng/any/file.i', 'file.ii', 'any/etc/initng/any/file.i'], 247 \ 'inittab': ['inittab'], 248 \ 'ipfilter': ['ipf.conf', 'ipf6.conf', 'ipf.rules'], 249 \ 'iss': ['file.iss'], 250 \ 'ist': ['file.ist', 'file.mst'], 251 \ 'j': ['file.ijs'], 252 \ 'jal': ['file.jal', 'file.JAL'], 253 \ 'jam': ['file.jpl', 'file.jpr', 'JAM-file.file', 'JAM.file', 'Prl-file.file', 'Prl.file'], 254 \ 'java': ['file.java', 'file.jav'], 255 \ 'javacc': ['file.jj', 'file.jjt'], 256 \ 'javascript': ['file.js', 'file.javascript', 'file.es', 'file.mjs', 'file.cjs'], 257 \ 'javascriptreact': ['file.jsx'], 258 \ 'jess': ['file.clp'], 259 \ 'jgraph': ['file.jgr'], 260 \ 'jovial': ['file.jov', 'file.j73', 'file.jovial'], 261 \ 'jproperties': ['file.properties', 'file.properties_xx', 'file.properties_xx_xx', 'some.properties_xx_xx_file'], 262 \ 'json': ['file.json', 'file.jsonp', 'file.json-patch', 'file.webmanifest', 'Pipfile.lock', 'file.ipynb', '.babelrc', '.eslintrc', '.prettierrc', '.firebaserc'], 263 \ 'jsonc': ['file.jsonc'], 264 \ 'jsp': ['file.jsp'], 265 \ 'julia': ['file.jl'], 266 \ 'kconfig': ['Kconfig', 'Kconfig.debug', 'Kconfig.file'], 267 \ 'kivy': ['file.kv'], 268 \ 'kix': ['file.kix'], 269 \ 'kotlin': ['file.kt', 'file.ktm', 'file.kts'], 270 \ 'kscript': ['file.ks'], 271 \ 'kwt': ['file.k'], 272 \ 'lace': ['file.ace', 'file.ACE'], 273 \ 'latte': ['file.latte', 'file.lte'], 274 \ 'ld': ['file.ld'], 275 \ 'ldif': ['file.ldif'], 276 \ 'less': ['file.less'], 277 \ 'lex': ['file.lex', 'file.l', 'file.lxx', 'file.l++'], 278 \ 'lftp': ['lftp.conf', '.lftprc', 'anylftp/rc', 'lftp/rc', 'some-lftp/rc'], 279 \ 'lhaskell': ['file.lhs'], 280 \ 'libao': ['/etc/libao.conf', '/.libao', 'any/.libao', 'any/etc/libao.conf'], 281 \ 'lifelines': ['file.ll'], 282 \ 'lilo': ['lilo.conf', 'lilo.conf-file'], 283 \ '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'], 284 \ 'liquid': ['file.liquid'], 285 \ 'lisp': ['file.lsp', 'file.lisp', 'file.el', 'file.cl', '.emacs', '.sawfishrc', 'sbclrc', '.sbclrc'], 286 \ 'lite': ['file.lite', 'file.lt'], 287 \ 'litestep': ['/LiteStep/any/file.rc', 'any/LiteStep/any/file.rc'], 288 \ 'loginaccess': ['/etc/login.access', 'any/etc/login.access'], 289 \ 'logindefs': ['/etc/login.defs', 'any/etc/login.defs'], 290 \ 'logtalk': ['file.lgt'], 291 \ 'lotos': ['file.lot', 'file.lotos'], 292 \ 'lout': ['file.lou', 'file.lout'], 293 \ 'lprolog': ['file.sig'], 294 \ 'lsl': ['file.lsl'], 295 \ 'lss': ['file.lss'], 296 \ 'lua': ['file.lua', 'file.rockspec', 'file.nse'], 297 \ 'lynx': ['lynx.cfg'], 298 \ 'matlab': ['file.m'], 299 \ 'm3build': ['m3makefile', 'm3overrides'], 300 \ 'm3quake': ['file.quake', 'cm3.cfg'], 301 \ 'm4': ['file.at'], 302 \ 'mail': ['snd.123', '.letter', '.letter.123', '.followup', '.article', '.article.123', 'pico.123', 'mutt-xx-xxx', 'muttng-xx-xxx', 'ae123.txt', 'file.eml', 'reportbug-file'], 303 \ 'mailaliases': ['/etc/mail/aliases', '/etc/aliases', 'any/etc/aliases', 'any/etc/mail/aliases'], 304 \ 'mailcap': ['.mailcap', 'mailcap'], 305 \ 'make': ['file.mk', 'file.mak', 'file.dsp', 'makefile', 'Makefile', 'makefile-file', 'Makefile-file', 'some-makefile', 'some-Makefile'], 306 \ 'mallard': ['file.page'], 307 \ 'man': ['file.man'], 308 \ 'manconf': ['/etc/man.conf', 'man.config', 'any/etc/man.conf'], 309 \ 'map': ['file.map'], 310 \ 'maple': ['file.mv', 'file.mpl', 'file.mws'], 311 \ 'markdown': ['file.markdown', 'file.mdown', 'file.mkd', 'file.mkdn', 'file.mdwn', 'file.md'], 312 \ 'mason': ['file.mason', 'file.mhtml', 'file.comp'], 313 \ 'master': ['file.mas', 'file.master'], 314 \ 'mel': ['file.mel'], 315 \ 'meson': ['meson.build', 'meson_options.txt'], 316 \ 'messages': ['/log/auth', '/log/cron', '/log/daemon', '/log/debug', '/log/kern', '/log/lpr', '/log/mail', '/log/messages', '/log/news/news', '/log/syslog', '/log/user', 317 \ '/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', 318 \ '/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', 319 \ '/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', 320 \ '/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', 321 \ '/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', 322 \ '/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'], 323 \ 'mf': ['file.mf'], 324 \ 'mgl': ['file.mgl'], 325 \ 'mgp': ['file.mgp'], 326 \ 'mib': ['file.mib', 'file.my'], 327 \ 'mix': ['file.mix', 'file.mixal'], 328 \ 'mma': ['file.nb'], 329 \ 'mmp': ['file.mmp'], 330 \ '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'], 331 \ 'modula2': ['file.m2', 'file.mi'], 332 \ 'monk': ['file.isc', 'file.monk', 'file.ssc', 'file.tsc'], 333 \ 'moo': ['file.moo'], 334 \ 'mp': ['file.mp'], 335 \ 'mplayerconf': ['mplayer.conf', '/.mplayer/config', 'any/.mplayer/config'], 336 \ 'mrxvtrc': ['mrxvtrc', '.mrxvtrc'], 337 \ 'msidl': ['file.odl', 'file.mof'], 338 \ 'msql': ['file.msql'], 339 \ 'mupad': ['file.mu'], 340 \ 'mush': ['file.mush'], 341 \ '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'], 342 \ 'mysql': ['file.mysql'], 343 \ 'n1ql': ['file.n1ql', 'file.nql'], 344 \ 'named': ['namedfile.conf', 'rndcfile.conf', 'named-file.conf', 'named.conf', 'rndc-file.conf', 'rndc-file.key', 'rndc.conf', 'rndc.key'], 345 \ 'nanorc': ['/etc/nanorc', 'file.nanorc', 'any/etc/nanorc'], 346 \ 'ncf': ['file.ncf'], 347 \ 'netrc': ['.netrc'], 348 \ 'nginx': ['file.nginx', 'nginxfile.conf', 'filenginx.conf', 'any/etc/nginx/file', 'any/usr/local/nginx/conf/file', 'any/nginx/file.conf'], 349 \ 'ninja': ['file.ninja'], 350 \ 'nqc': ['file.nqc'], 351 \ 'nroff': ['file.tr', 'file.nr', 'file.roff', 'file.tmac', 'file.mom', 'tmac.file'], 352 \ 'nsis': ['file.nsi', 'file.nsh'], 353 \ 'obj': ['file.obj'], 354 \ 'ocaml': ['file.ml', 'file.mli', 'file.mll', 'file.mly', '.ocamlinit', 'file.mlt', 'file.mlp', 'file.mlip', 'file.mli.cppo', 'file.ml.cppo'], 355 \ 'occam': ['file.occ'], 356 \ 'octave': ['octaverc', '.octaverc', 'octave.conf'], 357 \ 'omnimark': ['file.xom', 'file.xin'], 358 \ 'opam': ['opam', 'file.opam', 'file.opam.template'], 359 \ 'openroad': ['file.or'], 360 \ 'ora': ['file.ora'], 361 \ 'pamconf': ['/etc/pam.conf', '/etc/pam.d/file', 'any/etc/pam.conf', 'any/etc/pam.d/file'], 362 \ 'pamenv': ['/etc/security/pam_env.conf', '/home/user/.pam_environment', '.pam_environment', 'pam_env.conf'], 363 \ 'papp': ['file.papp', 'file.pxml', 'file.pxsl'], 364 \ 'pascal': ['file.pas', 'file.dpr', 'file.lpr'], 365 \ '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'], 366 \ 'pbtxt': ['file.pbtxt'], 367 \ 'pccts': ['file.g'], 368 \ 'pdf': ['file.pdf'], 369 \ 'perl': ['file.plx', 'file.al', 'file.psgi', 'gitolite.rc', '.gitolite.rc', 'example.gitolite.rc'], 370 \ 'pf': ['pf.conf'], 371 \ 'pfmain': ['main.cf'], 372 \ 'php': ['file.php', 'file.php9', 'file.phtml', 'file.ctp'], 373 \ 'lpc': ['file.lpc', 'file.ulpc'], 374 \ 'pike': ['file.pike', 'file.pmod'], 375 \ 'cmod': ['file.cmod'], 376 \ 'pilrc': ['file.rcp'], 377 \ 'pine': ['.pinerc', 'pinerc', '.pinercex', 'pinercex'], 378 \ 'pinfo': ['/etc/pinforc', '/.pinforc', 'any/.pinforc', 'any/etc/pinforc'], 379 \ 'pli': ['file.pli', 'file.pl1'], 380 \ 'plm': ['file.plm', 'file.p36', 'file.pac'], 381 \ 'plp': ['file.plp'], 382 \ 'plsql': ['file.pls', 'file.plsql'], 383 \ 'po': ['file.po', 'file.pot'], 384 \ 'pod': ['file.pod'], 385 \ 'poke': ['file.pk'], 386 \ 'postscr': ['file.ps', 'file.pfa', 'file.afm', 'file.eps', 'file.epsf', 'file.epsi', 'file.ai'], 387 \ 'pov': ['file.pov'], 388 \ 'povini': ['.povrayrc'], 389 \ 'ppd': ['file.ppd'], 390 \ 'ppwiz': ['file.it', 'file.ih'], 391 \ 'privoxy': ['file.action'], 392 \ 'proc': ['file.pc'], 393 \ 'procmail': ['.procmail', '.procmailrc'], 394 \ 'prolog': ['file.pdb'], 395 \ 'promela': ['file.pml'], 396 \ 'proto': ['file.proto'], 397 \ 'protocols': ['/etc/protocols', 'any/etc/protocols'], 398 \ 'ps1': ['file.ps1', 'file.psd1', 'file.psm1', 'file.pssc'], 399 \ 'ps1xml': ['file.ps1xml'], 400 \ 'psf': ['file.psf'], 401 \ 'psl': ['file.psl'], 402 \ 'puppet': ['file.pp'], 403 \ 'pyret': ['file.arr'], 404 \ 'pyrex': ['file.pyx', 'file.pxd'], 405 \ 'python': ['file.py', 'file.pyw', '.pythonstartup', '.pythonrc', 'file.ptl', 'file.pyi', 'SConstruct'], 406 \ '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'], 407 \ 'radiance': ['file.rad', 'file.mat'], 408 \ 'raku': ['file.pm6', 'file.p6', 'file.t6', 'file.pod6', 'file.raku', 'file.rakumod', 'file.rakudoc', 'file.rakutest'], 409 \ 'ratpoison': ['.ratpoisonrc', 'ratpoisonrc'], 410 \ 'rbs': ['file.rbs'], 411 \ 'rc': ['file.rc', 'file.rch'], 412 \ 'rcs': ['file,v'], 413 \ 'readline': ['.inputrc', 'inputrc'], 414 \ 'remind': ['.reminders', 'file.remind', 'file.rem', '.reminders-file'], 415 \ 'rego': ['file.rego'], 416 \ 'resolv': ['resolv.conf'], 417 \ 'reva': ['file.frt'], 418 \ 'rexx': ['file.rex', 'file.orx', 'file.rxo', 'file.rxj', 'file.jrexx', 'file.rexxj', 'file.rexx', 'file.testGroup', 'file.testUnit'], 419 \ 'rib': ['file.rib'], 420 \ 'rnc': ['file.rnc'], 421 \ 'rng': ['file.rng'], 422 \ 'robots': ['robots.txt'], 423 \ 'rpcgen': ['file.x'], 424 \ 'rpl': ['file.rpl'], 425 \ 'rst': ['file.rst'], 426 \ 'rtf': ['file.rtf'], 427 \ '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', 'Puppetfile'], 428 \ 'rust': ['file.rs'], 429 \ 'samba': ['smb.conf'], 430 \ 'sas': ['file.sas'], 431 \ 'sass': ['file.sass'], 432 \ 'sather': ['file.sa'], 433 \ 'sbt': ['file.sbt'], 434 \ 'scala': ['file.scala', 'file.sc'], 435 \ 'scheme': ['file.scm', 'file.ss', 'file.rkt', 'file.rktd', 'file.rktl'], 436 \ 'scilab': ['file.sci', 'file.sce'], 437 \ 'screen': ['.screenrc', 'screenrc'], 438 \ 'sexplib': ['file.sexp'], 439 \ 'scdoc': ['file.scd'], 440 \ 'scss': ['file.scss'], 441 \ 'sd': ['file.sd'], 442 \ 'sdc': ['file.sdc'], 443 \ 'sdl': ['file.sdl', 'file.pr'], 444 \ 'sed': ['file.sed'], 445 \ 'svelte': ['file.svelte'], 446 \ 'sensors': ['/etc/sensors.conf', '/etc/sensors3.conf', 'any/etc/sensors.conf', 'any/etc/sensors3.conf'], 447 \ 'services': ['/etc/services', 'any/etc/services'], 448 \ 'setserial': ['/etc/serial.conf', 'any/etc/serial.conf'], 449 \ 'sh': ['.bashrc', 'file.bash', '/usr/share/doc/bash-completion/filter.sh','/etc/udev/cdsymlinks.conf', 'any/etc/udev/cdsymlinks.conf'], 450 \ 'sieve': ['file.siv', 'file.sieve'], 451 \ 'simula': ['file.sim'], 452 \ 'sinda': ['file.sin', 'file.s85'], 453 \ 'sisu': ['file.sst', 'file.ssm', 'file.ssi', 'file.-sst', 'file._sst', 'file.sst.meta', 'file.-sst.meta', 'file._sst.meta'], 454 \ 'skill': ['file.il', 'file.ils', 'file.cdf'], 455 \ 'slang': ['file.sl'], 456 \ 'slice': ['file.ice'], 457 \ 'slpconf': ['/etc/slp.conf', 'any/etc/slp.conf'], 458 \ 'slpreg': ['/etc/slp.reg', 'any/etc/slp.reg'], 459 \ 'slpspi': ['/etc/slp.spi', 'any/etc/slp.spi'], 460 \ 'slrnrc': ['.slrnrc'], 461 \ 'slrnsc': ['file.score'], 462 \ 'sm': ['sendmail.cf'], 463 \ 'smarty': ['file.tpl'], 464 \ 'smcl': ['file.hlp', 'file.ihlp', 'file.smcl'], 465 \ 'smith': ['file.smt', 'file.smith'], 466 \ 'sml': ['file.sml'], 467 \ 'snobol4': ['file.sno', 'file.spt'], 468 \ 'sparql': ['file.rq', 'file.sparql'], 469 \ 'spec': ['file.spec'], 470 \ 'spice': ['file.sp', 'file.spice'], 471 \ 'spup': ['file.speedup', 'file.spdata', 'file.spd'], 472 \ 'spyce': ['file.spy', 'file.spi'], 473 \ 'sql': ['file.tyb', 'file.typ', 'file.tyc', 'file.pkb', 'file.pks'], 474 \ 'sqlj': ['file.sqlj'], 475 \ 'sqr': ['file.sqr', 'file.sqi'], 476 \ 'squid': ['squid.conf'], 477 \ 'srec': ['file.s19', 'file.s28', 'file.s37', 'file.mot', 'file.srec'], 478 \ 'sshconfig': ['ssh_config', '/.ssh/config', '/etc/ssh/ssh_config.d/file.conf', 'any/etc/ssh/ssh_config.d/file.conf', 'any/.ssh/config'], 479 \ 'sshdconfig': ['sshd_config', '/etc/ssh/sshd_config.d/file.conf', 'any/etc/ssh/sshd_config.d/file.conf'], 480 \ 'st': ['file.st'], 481 \ 'stata': ['file.ado', 'file.do', 'file.imata', 'file.mata'], 482 \ 'stp': ['file.stp'], 483 \ 'sudoers': ['any/etc/sudoers', 'sudoers.tmp', '/etc/sudoers'], 484 \ 'svg': ['file.svg'], 485 \ 'svn': ['svn-commitfile.tmp', 'svn-commit-file.tmp', 'svn-commit.tmp'], 486 \ 'swift': ['file.swift'], 487 \ 'swiftgyb': ['file.swift.gyb'], 488 \ 'sil': ['file.sil'], 489 \ 'sysctl': ['/etc/sysctl.conf', '/etc/sysctl.d/file.conf', 'any/etc/sysctl.conf', 'any/etc/sysctl.d/file.conf'], 490 \ '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'], 491 \ 'systemverilog': ['file.sv', 'file.svh'], 492 \ 'tags': ['tags'], 493 \ 'tak': ['file.tak'], 494 \ 'taskdata': ['pending.data', 'completed.data', 'undo.data'], 495 \ 'taskedit': ['file.task'], 496 \ 'tcl': ['file.tcl', 'file.tm', 'file.tk', 'file.itcl', 'file.itk', 'file.jacl', '.tclshrc', 'tclsh.rc', '.wishrc'], 497 \ 'teraterm': ['file.ttl'], 498 \ 'terminfo': ['file.ti'], 499 \ 'tex': ['file.latex', 'file.sty', 'file.dtx', 'file.ltx', 'file.bbl'], 500 \ 'texinfo': ['file.texinfo', 'file.texi', 'file.txi'], 501 \ 'texmf': ['texmf.cnf'], 502 \ 'text': ['file.text', 'README', '/usr/share/doc/bash-completion/AUTHORS'], 503 \ 'tf': ['file.tf', '.tfrc', 'tfrc'], 504 \ 'tidy': ['.tidyrc', 'tidyrc', 'tidy.conf'], 505 \ 'tilde': ['file.t.html'], 506 \ 'tli': ['file.tli'], 507 \ 'tmux': ['tmuxfile.conf', '.tmuxfile.conf', '.tmux-file.conf', '.tmux.conf', 'tmux-file.conf', 'tmux.conf'], 508 \ 'toml': ['file.toml'], 509 \ 'tpp': ['file.tpp'], 510 \ 'treetop': ['file.treetop'], 511 \ 'trustees': ['trustees.conf'], 512 \ 'tsalt': ['file.slt'], 513 \ 'tsscl': ['file.tsscl'], 514 \ 'tssgm': ['file.tssgm'], 515 \ 'tssop': ['file.tssop'], 516 \ 'twig': ['file.twig'], 517 \ 'typescriptreact': ['file.tsx'], 518 \ 'uc': ['file.uc'], 519 \ 'udevconf': ['/etc/udev/udev.conf', 'any/etc/udev/udev.conf'], 520 \ 'udevperm': ['/etc/udev/permissions.d/file.permissions', 'any/etc/udev/permissions.d/file.permissions'], 521 \ 'udevrules': ['/etc/udev/rules.d/file.rules', '/usr/lib/udev/rules.d/file.rules', '/lib/udev/rules.d/file.rules'], 522 \ 'uil': ['file.uit', 'file.uil'], 523 \ 'updatedb': ['/etc/updatedb.conf', 'any/etc/updatedb.conf'], 524 \ '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'], 525 \ 'upstreamdat': ['upstream.dat', 'UPSTREAM.DAT', 'upstream.file.dat', 'UPSTREAM.FILE.DAT', 'file.upstream.dat', 'FILE.UPSTREAM.DAT'], 526 \ 'upstreaminstalllog': ['upstreaminstall.log', 'UPSTREAMINSTALL.LOG', 'upstreaminstall.file.log', 'UPSTREAMINSTALL.FILE.LOG', 'file.upstreaminstall.log', 'FILE.UPSTREAMINSTALL.LOG'], 527 \ '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'], 528 \ 'usserverlog': ['usserver.log', 'USSERVER.LOG', 'usserver.file.log', 'USSERVER.FILE.LOG', 'file.usserver.log', 'FILE.USSERVER.LOG'], 529 \ 'usw2kagtlog': ['usw2kagt.log', 'USW2KAGT.LOG', 'usw2kagt.file.log', 'USW2KAGT.FILE.LOG', 'file.usw2kagt.log', 'FILE.USW2KAGT.LOG'], 530 \ 'vb': ['file.sba', 'file.vb', 'file.vbs', 'file.dsm', 'file.ctl'], 531 \ 'vera': ['file.vr', 'file.vri', 'file.vrh'], 532 \ 'verilog': ['file.v'], 533 \ 'verilogams': ['file.va', 'file.vams'], 534 \ 'vgrindefs': ['vgrindefs'], 535 \ 'vhdl': ['file.hdl', 'file.vhd', 'file.vhdl', 'file.vbe', 'file.vst', 'file.vhdl_123', 'file.vho', 'some.vhdl_1', 'some.vhdl_1-file'], 536 \ 'vim': ['file.vim', 'file.vba', '.exrc', '_exrc', 'some-vimrc', 'some-vimrc-file', 'vimrc', 'vimrc-file'], 537 \ 'viminfo': ['.viminfo', '_viminfo'], 538 \ 'vmasm': ['file.mar'], 539 \ 'voscm': ['file.cm'], 540 \ 'vrml': ['file.wrl'], 541 \ 'vroom': ['file.vroom'], 542 \ 'vue': ['file.vue'], 543 \ 'wast': ['file.wast', 'file.wat'], 544 \ 'webmacro': ['file.wm'], 545 \ 'wget': ['.wgetrc', 'wgetrc'], 546 \ 'winbatch': ['file.wbt'], 547 \ 'wml': ['file.wml'], 548 \ 'wsh': ['file.wsf', 'file.wsc'], 549 \ 'wsml': ['file.wsml'], 550 \ 'wvdial': ['wvdial.conf', '.wvdialrc'], 551 \ 'xdefaults': ['.Xdefaults', '.Xpdefaults', '.Xresources', 'xdm-config', 'file.ad', '/Xresources/file', '/app-defaults/file', 'Xresources', 'Xresources-file', 'any/Xresources/file', 'any/app-defaults/file'], 552 \ 'xhtml': ['file.xhtml', 'file.xht'], 553 \ 'xinetd': ['/etc/xinetd.conf', '/etc/xinetd.d/file', 'any/etc/xinetd.conf', 'any/etc/xinetd.d/file'], 554 \ 'xmath': ['file.msc', 'file.msf'], 555 \ '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', 'file.atom', 'file.rss', 'file.cdxml', 'file.psc1', 'file.mpd'], 556 \ 'xmodmap': ['anyXmodmap', 'Xmodmap', 'some-Xmodmap', 'some-xmodmap', 'some-xmodmap-file', 'xmodmap', 'xmodmap-file'], 557 \ 'xf86conf': ['xorg.conf', 'xorg.conf-4'], 558 \ 'xpm2': ['file.xpm2'], 559 \ 'xquery': ['file.xq', 'file.xql', 'file.xqm', 'file.xquery', 'file.xqy'], 560 \ 'xs': ['file.xs'], 561 \ 'xsd': ['file.xsd'], 562 \ 'xslt': ['file.xsl', 'file.xslt'], 563 \ 'yacc': ['file.yy', 'file.yxx', 'file.y++'], 564 \ 'yaml': ['file.yaml', 'file.yml'], 565 \ 'raml': ['file.raml'], 566 \ 'z8a': ['file.z8a'], 567 \ 'zimbu': ['file.zu'], 568 \ 'zimbutempl': ['file.zut'], 569 \ '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'], 570 \ 571 \ 'help': [$VIMRUNTIME . '/doc/help.txt'], 572 \ 'xpm': ['file.xpm'], 573 \ } 574 575let s:filename_case_checks = { 576 \ 'modula2': ['file.DEF', 'file.MOD'], 577 \ 'bzl': ['file.BUILD', 'BUILD'], 578 \ } 579 580func CheckItems(checks) 581 set noswapfile 582 for [ft, names] in items(a:checks) 583 for i in range(0, len(names) - 1) 584 new 585 try 586 exe 'edit ' . fnameescape(names[i]) 587 catch 588 call assert_report('cannot edit "' . names[i] . '": ' . v:exception) 589 endtry 590 if &filetype == '' && &readonly 591 " File exists but not able to edit it (permission denied) 592 else 593 call assert_equal(ft, &filetype, 'with file name: ' . names[i]) 594 endif 595 bwipe! 596 endfor 597 endfor 598 set swapfile& 599endfunc 600 601func Test_filetype_detection() 602 filetype on 603 call CheckItems(s:filename_checks) 604 if has('fname_case') 605 call CheckItems(s:filename_case_checks) 606 endif 607 filetype off 608endfunc 609 610" Filetypes detected from the file contents by scripts.vim 611let s:script_checks = { 612 \ 'virata': [['% Virata'], 613 \ ['', '% Virata'], 614 \ ['', '', '% Virata'], 615 \ ['', '', '', '% Virata'], 616 \ ['', '', '', '', '% Virata']], 617 \ 'strace': [['execve("/usr/bin/pstree", ["pstree"], 0x7ff0 /* 63 vars */) = 0'], 618 \ ['15:17:47 execve("/usr/bin/pstree", ["pstree"], ... "_=/usr/bin/strace"]) = 0'], 619 \ ['__libc_start_main and something']], 620 \ 'clojure': [['#!/path/clojure']], 621 \ 'scala': [['#!/path/scala']], 622 \ 'tcsh': [['#!/path/tcsh']], 623 \ 'zsh': [['#!/path/zsh']], 624 \ 'tcl': [['#!/path/tclsh'], 625 \ ['#!/path/wish'], 626 \ ['#!/path/expectk'], 627 \ ['#!/path/itclsh'], 628 \ ['#!/path/itkwish']], 629 \ 'expect': [['#!/path/expect']], 630 \ 'gnuplot': [['#!/path/gnuplot']], 631 \ 'make': [['#!/path/make']], 632 \ 'pike': [['#!/path/pike'], 633 \ ['#!/path/pike0'], 634 \ ['#!/path/pike9']], 635 \ 'lua': [['#!/path/lua']], 636 \ 'raku': [['#!/path/raku']], 637 \ 'perl': [['#!/path/perl']], 638 \ 'php': [['#!/path/php']], 639 \ 'python': [['#!/path/python'], 640 \ ['#!/path/python2'], 641 \ ['#!/path/python3']], 642 \ 'groovy': [['#!/path/groovy']], 643 \ 'ruby': [['#!/path/ruby']], 644 \ 'javascript': [['#!/path/node'], 645 \ ['#!/path/js'], 646 \ ['#!/path/nodejs'], 647 \ ['#!/path/rhino']], 648 \ 'bc': [['#!/path/bc']], 649 \ 'sed': [['#!/path/sed']], 650 \ 'ocaml': [['#!/path/ocaml']], 651 \ 'awk': [['#!/path/awk'], 652 \ ['#!/path/gawk']], 653 \ 'wml': [['#!/path/wml']], 654 \ 'scheme': [['#!/path/scheme']], 655 \ 'cfengine': [['#!/path/cfengine']], 656 \ 'erlang': [['#!/path/escript']], 657 \ 'haskell': [['#!/path/haskell']], 658 \ 'cpp': [['// Standard iostream objects -*- C++ -*-'], 659 \ ['// -*- C++ -*-']], 660 \ 'yaml': [['%YAML 1.2']], 661 \ 'pascal': [['#!/path/instantfpc']], 662 \ 'fennel': [['#!/path/fennel']], 663 \ } 664 665" Various forms of "env" optional arguments. 666let s:script_env_checks = { 667 \ 'perl': [['#!/usr/bin/env VAR=val perl']], 668 \ 'scala': [['#!/usr/bin/env VAR=val VVAR=vval scala']], 669 \ 'awk': [['#!/usr/bin/env VAR=val -i awk']], 670 \ 'scheme': [['#!/usr/bin/env VAR=val --ignore-environment scheme']], 671 \ 'python': [['#!/usr/bin/env VAR=val -S python -w -T']], 672 \ 'wml': [['#!/usr/bin/env VAR=val --split-string wml']], 673 \ } 674 675func Run_script_detection(test_dict) 676 filetype on 677 for [ft, files] in items(a:test_dict) 678 for file in files 679 call writefile(file, 'Xtest') 680 split Xtest 681 call assert_equal(ft, &filetype, 'for text: ' . string(file)) 682 bwipe! 683 endfor 684 endfor 685 call delete('Xtest') 686 filetype off 687endfunc 688 689func Test_script_detection() 690 call Run_script_detection(s:script_checks) 691 call Run_script_detection(s:script_env_checks) 692endfunc 693 694func Test_setfiletype_completion() 695 call feedkeys(":setfiletype java\<C-A>\<C-B>\"\<CR>", 'tx') 696 call assert_equal('"setfiletype java javacc javascript javascriptreact', @:) 697endfunc 698 699" Test for ':filetype detect' command for a buffer without a file 700func Test_emptybuf_ftdetect() 701 new 702 call setline(1, '#!/bin/sh') 703 call assert_equal('', &filetype) 704 filetype detect 705 call assert_equal('sh', &filetype) 706 close! 707endfunc 708 709" Test for ':filetype indent on' and ':filetype indent off' commands 710func Test_filetype_indent_off() 711 new Xtest.vim 712 filetype indent on 713 call assert_equal(1, g:did_indent_on) 714 call assert_equal(['filetype detection:ON plugin:OFF indent:ON'], 715 \ execute('filetype')->split("\n")) 716 filetype indent off 717 call assert_equal(0, exists('g:did_indent_on')) 718 call assert_equal(['filetype detection:ON plugin:OFF indent:OFF'], 719 \ execute('filetype')->split("\n")) 720 close 721endfunc 722 723func Test_hook_file() 724 filetype on 725 726 call writefile(['[Trigger]', 'this is pacman config'], 'Xfile.hook') 727 split Xfile.hook 728 call assert_equal('dosini', &filetype) 729 bwipe! 730 731 call writefile(['not pacman'], 'Xfile.hook') 732 split Xfile.hook 733 call assert_notequal('dosini', &filetype) 734 bwipe! 735 736 call delete('Xfile.hook') 737 filetype off 738endfunc 739 740func Test_ts_file() 741 filetype on 742 743 call writefile(['<?xml version="1.0" encoding="utf-8"?>'], 'Xfile.ts') 744 split Xfile.ts 745 call assert_equal('xml', &filetype) 746 bwipe! 747 748 call writefile(['// looks like Typescript'], 'Xfile.ts') 749 split Xfile.ts 750 call assert_equal('typescript', &filetype) 751 bwipe! 752 753 call delete('Xfile.ts') 754 filetype off 755endfunc 756 757func Test_ttl_file() 758 filetype on 759 760 call writefile(['@base <http://example.org/> .'], 'Xfile.ttl') 761 split Xfile.ttl 762 call assert_equal('turtle', &filetype) 763 bwipe! 764 765 call writefile(['looks like Tera Term Language'], 'Xfile.ttl') 766 split Xfile.ttl 767 call assert_equal('teraterm', &filetype) 768 bwipe! 769 770 call delete('Xfile.ttl') 771 filetype off 772endfunc 773 774func Test_pp_file() 775 filetype on 776 777 call writefile(['looks like puppet'], 'Xfile.pp') 778 split Xfile.pp 779 call assert_equal('puppet', &filetype) 780 bwipe! 781 782 let g:filetype_pp = 'pascal' 783 split Xfile.pp 784 call assert_equal('pascal', &filetype) 785 bwipe! 786 unlet g:filetype_pp 787 788 " Test dist#ft#FTpp() 789 call writefile(['{ pascal comment'], 'Xfile.pp') 790 split Xfile.pp 791 call assert_equal('pascal', &filetype) 792 bwipe! 793 794 call writefile(['procedure pascal'], 'Xfile.pp') 795 split Xfile.pp 796 call assert_equal('pascal', &filetype) 797 bwipe! 798 799 call delete('Xfile.pp') 800 filetype off 801endfunc 802 803func Test_ex_file() 804 filetype on 805 806 call writefile(['arbitrary content'], 'Xfile.ex') 807 split Xfile.ex 808 call assert_equal('elixir', &filetype) 809 bwipe! 810 let g:filetype_euphoria = 'euphoria4' 811 split Xfile.ex 812 call assert_equal('euphoria4', &filetype) 813 bwipe! 814 unlet g:filetype_euphoria 815 816 call writefile(['-- filetype euphoria comment'], 'Xfile.ex') 817 split Xfile.ex 818 call assert_equal('euphoria3', &filetype) 819 bwipe! 820 821 call writefile(['--filetype euphoria comment'], 'Xfile.ex') 822 split Xfile.ex 823 call assert_equal('euphoria3', &filetype) 824 bwipe! 825 826 call writefile(['ifdef '], 'Xfile.ex') 827 split Xfile.ex 828 call assert_equal('euphoria3', &filetype) 829 bwipe! 830 831 call writefile(['include '], 'Xfile.ex') 832 split Xfile.ex 833 call assert_equal('euphoria3', &filetype) 834 bwipe! 835 836 call delete('Xfile.ex') 837 filetype off 838endfunc 839 840func Test_dsl_file() 841 filetype on 842 843 call writefile([' <!doctype dsssl-spec ['], 'dslfile.dsl') 844 split dslfile.dsl 845 call assert_equal('dsl', &filetype) 846 bwipe! 847 848 call writefile(['workspace {'], 'dslfile.dsl') 849 split dslfile.dsl 850 call assert_equal('structurizr', &filetype) 851 bwipe! 852 853 call delete('dslfile.dsl') 854 filetype off 855endfunc 856 857func Test_m_file() 858 filetype on 859 860 call writefile(['looks like Matlab'], 'Xfile.m') 861 split Xfile.m 862 call assert_equal('matlab', &filetype) 863 bwipe! 864 865 let g:filetype_m = 'octave' 866 split Xfile.m 867 call assert_equal('octave', &filetype) 868 bwipe! 869 unlet g:filetype_m 870 871 " Test dist#ft#FTm() 872 873 " Objective-C 874 875 call writefile(['// Objective-C line comment'], 'Xfile.m') 876 split Xfile.m 877 call assert_equal('objc', &filetype) 878 bwipe! 879 880 call writefile(['/* Objective-C block comment */'], 'Xfile.m') 881 split Xfile.m 882 call assert_equal('objc', &filetype) 883 bwipe! 884 885 call writefile(['#import "test.m"'], 'Xfile.m') 886 split Xfile.m 887 call assert_equal('objc', &filetype) 888 bwipe! 889 890 " Octave 891 892 call writefile(['# Octave line comment'], 'Xfile.m') 893 split Xfile.m 894 call assert_equal('octave', &filetype) 895 bwipe! 896 897 call writefile(['%!test "Octave test"'], 'Xfile.m') 898 split Xfile.m 899 call assert_equal('octave', &filetype) 900 bwipe! 901 902 call writefile(['unwind_protect'], 'Xfile.m') 903 split Xfile.m 904 call assert_equal('octave', &filetype) 905 bwipe! 906 907 call writefile(['try; 42; end_try_catch'], 'Xfile.m') 908 split Xfile.m 909 call assert_equal('octave', &filetype) 910 bwipe! 911 912 " Mathematica 913 914 call writefile(['(* Mathematica comment'], 'Xfile.m') 915 split Xfile.m 916 call assert_equal('mma', &filetype) 917 bwipe! 918 919 " MATLAB 920 921 call writefile(['% MATLAB line comment'], 'Xfile.m') 922 split Xfile.m 923 call assert_equal('matlab', &filetype) 924 bwipe! 925 926 " Murphi 927 928 call writefile(['-- Murphi comment'], 'Xfile.m') 929 split Xfile.m 930 call assert_equal('murphi', &filetype) 931 bwipe! 932 933 call writefile(['/* Murphi block comment */', 'Type'], 'Xfile.m') 934 split Xfile.m 935 call assert_equal('murphi', &filetype) 936 bwipe! 937 938 call writefile(['Type'], 'Xfile.m') 939 split Xfile.m 940 call assert_equal('murphi', &filetype) 941 bwipe! 942 943 call delete('Xfile.m') 944 filetype off 945endfunc 946" vim: shiftwidth=2 sts=2 expandtab 947