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