From 3d39ea3ea9b6e66640e59731d155d731218e7e62 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 26 May 2024 07:11:50 +0800 Subject: vim-patch:9.1.0442: hare runtime files outdated (#29011) Problem: hare runtime files outdated Solution: runtime(hare): update hare.vim to match upstream (Amelia Clarke) closes: vim/vim#14836 https://github.com/vim/vim/commit/35dfe58a540e2fb0eff953630f8e4fcbf4bc26ca Co-authored-by: Amelia Clarke --- runtime/lua/vim/filetype.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/lua/vim/filetype.lua') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index d1fdd0aa16..2ab6cc6059 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -1637,7 +1637,7 @@ local filename = { ['.xsdbcmdhistory'] = 'tcl', ['texmf.cnf'] = 'texmf', COPYING = 'text', - README = 'text', + README = detect_seq(detect.haredoc, 'text'), LICENSE = 'text', AUTHORS = 'text', tfrc = 'tf', -- cgit From 07af492f635c51d44d02d8012611cc5e11a4af19 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 31 May 2024 12:07:31 +0200 Subject: vim-patch:9.1.0453: filetype: rasi files are not recognized Problem: filetype: rasi files are not recognized Solution: regonize '*.rasi' files as rasi filetype, include a filetype and syntax plugin (Pierrick Guillaume) ported from: https://github.com/Fymyte/rasi.vim closes: vim/vim#14821 https://github.com/vim/vim/commit/280e5b13ca568ed592a894140bf1ac74356f4b33 Co-authored-by: Pierrick Guillaume --- runtime/lua/vim/filetype.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime/lua/vim/filetype.lua') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 2ab6cc6059..500632a2b2 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -873,6 +873,7 @@ local extension = { t6 = 'raku', p6 = 'raku', raml = 'raml', + rasi = 'rasi', rbs = 'rbs', rego = 'rego', rem = 'remind', -- cgit From 659d3dcd2edf1b178a20015cab399390ffda1a32 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 2 Jun 2024 17:31:37 +0200 Subject: vim-patch:9.1.0460: filetype: lintstagedrc files are not recognized MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: filetype: lintstagedrc files are not recognized Solution: recognize '.lintstagedrc' files as json filetype (İlyas Akın) see: https://github.com/lint-staged/lint-staged closes: vim/vim#14897 https://github.com/vim/vim/commit/7577afd5efd0f7ebf0dbbca09713185024263ed7 Co-authored-by: İlyas Akın --- runtime/lua/vim/filetype.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime/lua/vim/filetype.lua') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 500632a2b2..c8f9bcfd84 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -1451,6 +1451,7 @@ local filename = { ['.firebaserc'] = 'json', ['.prettierrc'] = 'json', ['.stylelintrc'] = 'json', + ['.lintstagedrc'] = 'json', ['flake.lock'] = 'json', ['.babelrc'] = 'jsonc', ['.eslintrc'] = 'jsonc', -- cgit From 8cbb1f20e557461c8417583a7f69d53aaaef920b Mon Sep 17 00:00:00 2001 From: Ilia Choly Date: Tue, 4 Jun 2024 09:06:02 -0400 Subject: refactor(lua): use tuple syntax everywhere #29111 --- runtime/lua/vim/filetype.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/lua/vim/filetype.lua') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index c8f9bcfd84..cc2fbe0cec 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -4,7 +4,7 @@ local fn = vim.fn local M = {} --- @alias vim.filetype.mapfn fun(path:string,bufnr:integer, ...):string?, fun(b:integer)? ---- @alias vim.filetype.maptbl {[1]:string|vim.filetype.mapfn, [2]:{priority:integer}} +--- @alias vim.filetype.maptbl [string|vim.filetype.mapfn, {priority:integer}] --- @alias vim.filetype.mapping.value string|vim.filetype.mapfn|vim.filetype.maptbl --- @alias vim.filetype.mapping table -- cgit From 4faad4a950c68689166f0d6ecf5694cb04a9b589 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 15 Jun 2024 10:07:36 +0200 Subject: vim-patch:9.1.0486: filetype: Snakemake files are not recognized Problem: filetype: Snakemake files are not recognized Solution: Detect '*.smk' and Snakefile files as snakemake filetype (Riley Bruins) See: https://snakemake.readthedocs.io/en/stable/snakefiles/deployment.html#distribution-and-reproducibility closes: vim/vim#14992 https://github.com/vim/vim/commit/82a579e15ad78f4b99d2957300da3076ccc7d378 Co-authored-by: Riley Bruins Co-authored-by: zeertzjq --- runtime/lua/vim/filetype.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'runtime/lua/vim/filetype.lua') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index cc2fbe0cec..2bb50d8c0b 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -985,6 +985,7 @@ local extension = { smt = 'smith', smithy = 'smithy', sml = 'sml', + smk = 'snakemake', spt = 'snobol4', sno = 'snobol4', sln = 'solution', @@ -1620,6 +1621,7 @@ local filename = { ['/etc/slp.spi'] = 'slpspi', ['.slrnrc'] = 'slrnrc', ['sendmail.cf'] = 'sm', + Snakefile = 'snakemake', ['.sqlite_history'] = 'sql', ['squid.conf'] = 'squid', ['ssh_config'] = 'sshconfig', -- cgit From af0021f990bfd9681e8889ef217d26a89fadf5f0 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 20 Jun 2024 17:45:41 +0800 Subject: vim-patch:9.1.0505: filetype: Faust files are not recognized (#29426) Problem: filetype: Faust files are not recognized Solution: Detect '*.lib' files as Faust filetype, add detection for '*.dsp' files (Faust or Make), remove '*.lib' from Cobol filetype (PowerUser64) closes: vim/vim#14894 https://github.com/vim/vim/commit/aa61b8a9087e9cd999ef07e0d87b60f43d68f2c6 Co-authored-by: PowerUser64 --- runtime/lua/vim/filetype.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/lua/vim/filetype.lua') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 2bb50d8c0b..7373c403b5 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -281,7 +281,6 @@ local extension = { cook = 'cook', cmake = 'cmake', cmod = 'cmod', - lib = 'cobol', cob = 'cobol', cbl = 'cobol', atg = 'coco', @@ -366,6 +365,7 @@ local extension = { gv = 'dot', drac = 'dracula', drc = 'dracula', + dsp = detect.dsp, dtd = 'dtd', d = detect.dtrace, dts = 'dts', @@ -417,6 +417,7 @@ local extension = { fal = 'falcon', fan = 'fan', fwt = 'fan', + lib = 'faust', fnl = 'fennel', m4gl = 'fgl', ['4gl'] = 'fgl', @@ -666,7 +667,6 @@ local extension = { eml = 'mail', mk = 'make', mak = 'make', - dsp = 'make', page = 'mallard', map = 'map', mws = 'maple', -- cgit From d82efeccc7e89230ba6673da0fdf62c09fa38c17 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 21 Jun 2024 10:29:44 +0200 Subject: vim-patch:9.1.0506: filetype: .envrc & .prettierignore not recognized Problem: filetype: .envrc & .prettierignore not recognized Solution: Detect '.envrc' as shell and '.prettierignore' as gitignore filetype (Tyler Miller) Support ft detection for `.envrc` files used by direnv, and `.prettierignore` files used by prettier. closes: vim/vim#15053 resolves: neovim/neovim#29405 https://github.com/vim/vim/commit/49012cd8c2fb0452847e5d213b07aa8a978f4762 Co-authored-by: Tyler Miller --- runtime/lua/vim/filetype.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'runtime/lua/vim/filetype.lua') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 7373c403b5..6dd920e506 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -469,6 +469,7 @@ local extension = { gmi = 'gemtext', gemini = 'gemtext', gift = 'gift', + prettierignore = 'gitignore', gleam = 'gleam', glsl = 'glsl', gn = 'gn', @@ -953,6 +954,7 @@ local extension = { ebuild = detect.bash, eclass = detect.bash, env = detect.sh, + envrc = detect.sh, ksh = detect.ksh, sh = detect.sh, mdd = 'sh', -- cgit From b0e59909075a582fbcf12b4c8a3ec1bff12c4eea Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 24 Jun 2024 22:12:15 +0800 Subject: refactor(filetype): change some patterns to extensions (#29472) Ref #29468 --- runtime/lua/vim/filetype.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'runtime/lua/vim/filetype.lua') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 6dd920e506..6d3fc48efc 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -203,6 +203,10 @@ local extension = { return 'aspvbs' end, asm = detect.asm, + s = detect.asm, + S = detect.asm, + a = detect.asm, + A = detect.asm, lst = detect.asm, mac = detect.asm, asn1 = 'asn', @@ -706,6 +710,10 @@ local extension = { mmp = 'mmp', mms = detect.mms, DEF = 'modula2', + m3 = 'modula3', + i3 = 'modula3', + mg = 'modula3', + ig = 'modula3', lm3 = 'modula3', mojo = 'mojo', ['🔥'] = 'mojo', -- 🙄 @@ -1157,6 +1165,8 @@ local extension = { wbt = 'winbatch', wit = 'wit', wml = 'wml', + wsf = 'wsh', + wsc = 'wsh', wsml = 'wsml', ad = 'xdefaults', xhtml = 'xhtml', @@ -1741,8 +1751,6 @@ local pattern = { ['.*asterisk/.*%.conf.*'] = starsetf('asterisk'), ['.*asterisk.*/.*voicemail%.conf.*'] = starsetf('asteriskvm'), ['.*/%.aptitude/config'] = 'aptconf', - ['.*%.[aA]'] = detect.asm, - ['.*%.[sS]'] = detect.asm, ['[mM]akefile%.am'] = 'automake', ['.*/bind/db%..*'] = starsetf('bindzone'), ['.*/named/db%..*'] = starsetf('bindzone'), @@ -1798,8 +1806,6 @@ local pattern = { ['.*/etc/apt/sources%.list%.d/.*%.list'] = 'debsources', ['.*/etc/apt/sources%.list'] = 'debsources', ['.*/etc/apt/sources%.list%.d/.*%.sources'] = 'deb822sources', - ['.*%.directory'] = 'desktop', - ['.*%.desktop'] = 'desktop', ['dictd.*%.conf'] = 'dictdconf', ['.*/etc/DIR_COLORS'] = 'dircolors', ['.*/etc/dnsmasq%.conf'] = 'dnsmasq', @@ -2017,7 +2023,6 @@ local pattern = { return 'modconf' end end), - ['.*%.[mi][3g]'] = 'modula3', ['Muttrc'] = 'muttrc', ['Muttngrc'] = 'muttrc', ['.*/etc/Muttrc%.d/.*'] = starsetf('muttrc'), @@ -2164,7 +2169,6 @@ local pattern = { ['.*%.[Ll][Oo][Gg]'] = detect.log, ['.*/etc/config/.*'] = starsetf(detect.uci), ['.*%.vhdl_[0-9].*'] = starsetf('vhdl'), - ['.*%.ws[fc]'] = 'wsh', ['.*/Xresources/.*'] = starsetf('xdefaults'), ['.*/app%-defaults/.*'] = starsetf('xdefaults'), ['.*/etc/xinetd%.conf'] = 'xinetd', -- cgit From 0abaccb2a795c40cd7f55b9a19fe6ecb765479e2 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 5 Jul 2024 21:39:51 +0200 Subject: vim-patch:9.1.0532: filetype: Cedar files not recognized Problem: filetype: Cedar files not recognized Solution: Detect '*.cedar' files as cedar filetype (Riley Bruins) References: https://github.com/cedar-policy closes: vim/vim#15148 https://github.com/vim/vim/commit/15addb24dd3b2645f5c04d2742ab5eb53444a3a0 Co-authored-by: Riley Bruins --- runtime/lua/vim/filetype.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime/lua/vim/filetype.lua') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 6d3fc48efc..d2cf87bea5 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -261,6 +261,7 @@ local extension = { cdc = 'cdc', cdl = 'cdl', toc = detect_line1('\\contentsline', 'tex', 'cdrtoc'), + cedar = 'cedar', cfc = 'cf', cfm = 'cf', cfi = 'cf', -- cgit From 472b5b9b20756146db39cf32c6fb678e1d8104c0 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 6 Jul 2024 18:00:09 +0200 Subject: vim-patch:9.1.0536: filetype: zone files are not recognized Problem: filetype: zone files are not recognized (rpdprd) Solution: Detect '*.zone' files as bindzone filetype fixes: vim/vim#14222 https://github.com/vim/vim/commit/f095539b3900d76f5eeaaa0897c6abf970829b31 Co-authored-by: Christian Brabandt --- runtime/lua/vim/filetype.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime/lua/vim/filetype.lua') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index d2cf87bea5..eae5817aee 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -236,6 +236,7 @@ local extension = { db = detect.bindzone, bicep = 'bicep', bicepparam = 'bicep', + zone = 'bindzone', bb = 'bitbake', bbappend = 'bitbake', bbclass = 'bitbake', -- cgit From bf92d423a9ac4bd3d30685c23a0d9a0dd772b7a7 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 8 Jul 2024 10:39:03 +0200 Subject: vim-patch:9.1.0544: filetype: ldapconf files are not recognized Problem: filetype: ldapconf files are not recognized Solution: Detect '.ldaprc', 'ldap.conf' and 'ldaprc' files as ldapconf filetype, include a simple ldapconf ftplugin file (Riley Bruins) [Specification](https://www.openldap.org/software//man.cgi?query=ldap.conf&sektion=5&apropos=0&manpath=OpenLDAP+2.4-Release) closes: vim/vim#15176 https://github.com/vim/vim/commit/62f31e949918167cb7f50cdf1737f7c28460b62b Co-authored-by: Riley Bruins --- runtime/lua/vim/filetype.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'runtime/lua/vim/filetype.lua') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index eae5817aee..179a6312de 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -1481,6 +1481,9 @@ local filename = { Kconfig = 'kconfig', ['Kconfig.debug'] = 'kconfig', ['Config.in'] = 'kconfig', + ['ldaprc'] = 'ldapconf', + ['.ldaprc'] = 'ldapconf', + ['ldap.conf'] = 'ldapconf', ['lftp.conf'] = 'lftp', ['.lftprc'] = 'lftp', ['/.libao'] = 'libao', -- cgit From dc04ef2a20bf3457269e0c2aeb7dbfbb56c47012 Mon Sep 17 00:00:00 2001 From: Evgeni Chasnovski Date: Mon, 8 Jul 2024 19:20:32 +0300 Subject: perf(filetype): skip contents check in `match()` if there is no contents (#29596) Problem: `vim.filetype.match()` tries to match on contents even if there is no contents (empty buffer or `{''}` explicit contents). This results in extra avoidable execution duration for cases. It matters, for example, when trying to match filetype based solely on file name (which still needs `contents` or `buf` to properly match earlier in the code path). Solution: skip matching based solely on contents if it is `{''}`. This works because: - Matching solely on content is done after any user-configured `vim.filetype.add()` hooks. - All default matching on content might depend on supplied path *only* if there is non-empty content (like in `require('vim.filetype.detect').match_from_hashbang()`). --- runtime/lua/vim/filetype.lua | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'runtime/lua/vim/filetype.lua') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 179a6312de..18fa1ed658 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -2598,20 +2598,24 @@ function M.match(args) contents = M._getlines(bufnr) end end - -- If name is nil, catch any errors from the contents filetype detection function. - -- If the function tries to use the filename that is nil then it will fail, - -- but this enables checks which do not need a filename to still work. - local ok - ok, ft, on_detect = pcall( - require('vim.filetype.detect').match_contents, - contents, - name, - function(ext) - return dispatch(extension[ext], name, bufnr) + + -- Match based solely on content only if there is any content (for performance) + if not (#contents == 1 and contents[1] == '') then + -- If name is nil, catch any errors from the contents filetype detection function. + -- If the function tries to use the filename that is nil then it will fail, + -- but this enables checks which do not need a filename to still work. + local ok + ok, ft, on_detect = pcall( + require('vim.filetype.detect').match_contents, + contents, + name, + function(ext) + return dispatch(extension[ext], name, bufnr) + end + ) + if ok then + return ft, on_detect end - ) - if ok then - return ft, on_detect end end end -- cgit From 136c11ca22881ac64c074070c7fda501e89b6bea Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 9 Jul 2024 19:15:22 +0200 Subject: vim-patch:9.1.0550: filetype: antlr4 files are not recognized Problem: filetype: antlr4 files are not recognized Solution: Detect '*.g4' as antlr4 filetype, include a simple antlr4 syntax and filetype plugin (Yinzuo Jiang) closes: vim/vim#15191 https://github.com/vim/vim/commit/4a7a4a3675b6ad90a525524ba4684925df212325 Co-authored-by: Yinzuo Jiang --- runtime/lua/vim/filetype.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime/lua/vim/filetype.lua') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 18fa1ed658..83892ac290 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -190,6 +190,7 @@ local extension = { aidl = 'aidl', aml = 'aml', run = 'ampl', + g4 = 'antlr4', scpt = 'applescript', ino = 'arduino', pde = 'arduino', -- cgit From 17bc5af01bfb0141b0abbe5894dc1eca7eaa684f Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 9 Jul 2024 20:05:04 +0200 Subject: vim-patch:9.1.0553: filetype: *.mcmeta files are not recognized Problem: filetype: *.mcmeta files are not recognized Solution: Detect '*.mcmeta' files as json filetype (Tomodachi94) "pack.mcmeta" was added to the JSON tests because that is the most common filename with that extension. There are currently 34,000 instances of this file extension on GitHub: https://github.com/search?q=path%3A*.mcmeta&type=code&p=2 .zip files with this extension have downloads in the millions on sites like CurseForge: https://www.curseforge.com/minecraft/search?page=1&pageSize=20&sortBy=relevancy&class=texture-packs Further reading about the file extension: https://minecraft.wiki/w/Tutorials/Creating_a_resource_pack#Creating_a_.MCMETA_file closes: vim/vim#15189 https://github.com/vim/vim/commit/d33a518025765c4a3530ad6cfb6cab83a30c8f55 Co-authored-by: Tomodachi94 --- runtime/lua/vim/filetype.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime/lua/vim/filetype.lua') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 83892ac290..c866dc1de7 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -591,6 +591,7 @@ local extension = { json = 'json', jsonp = 'json', geojson = 'json', + mcmeta = 'json', webmanifest = 'json', ipynb = 'json', ['jupyterlab-settings'] = 'json', -- cgit From c7e8fc6302dc1bb6277319be05350bc5308f3841 Mon Sep 17 00:00:00 2001 From: Evgeni Chasnovski Date: Tue, 9 Jul 2024 15:00:33 +0300 Subject: refactor(filetype): unify matching patterns with pos/neg priority Problem: due to single list of sorted patterns, their matching inside `vim.filetype.match()` was done very similarly but with extra checks to stop processing negative priority patterns before extensions. Solution: create separated sorted lists for patterns with non-negative and negative priorities. This allows to process them in a single extracted function making the main codeflow a bit nicer and more easily expandable. --- runtime/lua/vim/filetype.lua | 80 ++++++++++++++++++++++++-------------------- 1 file changed, 43 insertions(+), 37 deletions(-) (limited to 'runtime/lua/vim/filetype.lua') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index c866dc1de7..fc7e0b5094 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -2218,10 +2218,18 @@ local pattern = { -- luacheck: pop -- luacheck: pop +local function compare_by_priority(a, b) + return a[next(a)][2].priority > b[next(b)][2].priority +end + --- @param t vim.filetype.mapping --- @return vim.filetype.mapping[] +--- @return vim.filetype.mapping[] local function sort_by_priority(t) - local sorted = {} --- @type vim.filetype.mapping[] + -- Separate patterns with non-negative and negative priority because they + -- will be processed separately + local pos = {} --- @type vim.filetype.mapping[] + local neg = {} --- @type vim.filetype.mapping[] for k, v in pairs(t) do local ft = type(v) == 'table' and v[1] or v assert( @@ -2233,15 +2241,16 @@ local function sort_by_priority(t) if not opts.priority then opts.priority = 0 end - table.insert(sorted, { [k] = { ft, opts } }) + + table.insert(opts.priority >= 0 and pos or neg, { [k] = { ft, opts } }) end - table.sort(sorted, function(a, b) - return a[next(a)][2].priority > b[next(b)][2].priority - end) - return sorted + + table.sort(pos, compare_by_priority) + table.sort(neg, compare_by_priority) + return pos, neg end -local pattern_sorted = sort_by_priority(pattern) +local pattern_sorted_pos, pattern_sorted_neg = sort_by_priority(pattern) --- @param path string --- @param as_pattern? true @@ -2365,7 +2374,9 @@ function M.add(filetypes) end if filetypes.pattern then - pattern_sorted = sort_by_priority(pattern) + -- TODO: full resorting might be expensive with a lot of separate `vim.filetype.add()` calls. + -- Consider inserting new patterns precisely into already sorted lists of built-in patterns. + pattern_sorted_pos, pattern_sorted_neg = sort_by_priority(pattern) end end @@ -2451,6 +2462,24 @@ local function match_pattern(name, path, tail, pat) return (tail:match(fullpat)) end +--- @param name string +--- @param path string +--- @param tail string +--- @param pattern_sorted vim.filetype.mapping[] +--- @param bufnr integer? +local function match_pattern_sorted(name, path, tail, pattern_sorted, bufnr) + for i = 1, #pattern_sorted do + local pat, ft_data = next(pattern_sorted[i]) + local matches = match_pattern(name, path, tail, pat) + if matches then + local ft, on_detect = dispatch(ft_data[1], path, bufnr, matches) + if ft then + return ft, on_detect + end + end + end +end + --- @class vim.filetype.match.args --- @inlinedoc --- @@ -2544,23 +2573,9 @@ function M.match(args) end -- Next, check the file path against available patterns with non-negative priority - local j = 1 - for i, v in ipairs(pattern_sorted) do - local k = next(v) - local opts = v[k][2] - if opts.priority < 0 then - j = i - break - end - - local filetype = v[k][1] - local matches = match_pattern(name, path, tail, k) - if matches then - ft, on_detect = dispatch(filetype, path, bufnr, matches) - if ft then - return ft, on_detect - end - end + ft, on_detect = match_pattern_sorted(name, path, tail, pattern_sorted_pos, bufnr) + if ft then + return ft, on_detect end -- Next, check file extension @@ -2573,18 +2588,9 @@ function M.match(args) end -- Next, check patterns with negative priority - for i = j, #pattern_sorted do - local v = pattern_sorted[i] - local k = next(v) - - local filetype = v[k][1] - local matches = match_pattern(name, path, tail, k) - if matches then - ft, on_detect = dispatch(filetype, path, bufnr, matches) - if ft then - return ft, on_detect - end - end + ft, on_detect = match_pattern_sorted(name, path, tail, pattern_sorted_neg, bufnr) + if ft then + return ft, on_detect end end -- cgit From abf4b65a51b2e96191782adf68bd967f8073f018 Mon Sep 17 00:00:00 2001 From: Evgeni Chasnovski Date: Tue, 9 Jul 2024 15:30:24 +0300 Subject: perf(filetype): cache (more) pattern data during "add" time --- runtime/lua/vim/filetype.lua | 45 ++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) (limited to 'runtime/lua/vim/filetype.lua') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index fc7e0b5094..236c67790f 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -2218,6 +2218,11 @@ local pattern = { -- luacheck: pop -- luacheck: pop +--- Lookup table/cache for patterns +--- @alias vim.filetype.pattern_cache { fullpat: string, has_env: boolean, has_slash: boolean } +--- @type table +local pattern_lookup = {} + local function compare_by_priority(a, b) return a[next(a)][2].priority > b[next(b)][2].priority end @@ -2230,19 +2235,24 @@ local function sort_by_priority(t) -- will be processed separately local pos = {} --- @type vim.filetype.mapping[] local neg = {} --- @type vim.filetype.mapping[] - for k, v in pairs(t) do - local ft = type(v) == 'table' and v[1] or v + for pat, maptbl in pairs(t) do + local ft = type(maptbl) == 'table' and maptbl[1] or maptbl assert( type(ft) == 'string' or type(ft) == 'function', 'Expected string or function for filetype' ) - local opts = (type(v) == 'table' and type(v[2]) == 'table') and v[2] or {} - if not opts.priority then - opts.priority = 0 - end + -- Parse pattern for common data and cache it once + pattern_lookup[pat] = pattern_lookup[pat] or { + fullpat = '^' .. pat .. '$', + has_env = pat:find('%$%b{}') ~= nil, + has_slash = pat:find('/') ~= nil, + } - table.insert(opts.priority >= 0 and pos or neg, { [k] = { ft, opts } }) + local opts = (type(maptbl) == 'table' and type(maptbl[2]) == 'table') and maptbl[2] or {} + opts.priority = opts.priority or 0 + + table.insert(opts.priority >= 0 and pos or neg, { [pat] = { ft, opts } }) end table.sort(pos, compare_by_priority) @@ -2420,23 +2430,19 @@ local function dispatch(ft, path, bufnr, ...) return ft0, on_detect end ---- Lookup table/cache for patterns that contain an environment variable pattern, e.g. ${SOME_VAR}. ---- @type table -local expand_env_lookup = {} - --- @param name string --- @param path string --- @param tail string --- @param pat string ---- @return string|false? +--- @return string|boolean? local function match_pattern(name, path, tail, pat) - if expand_env_lookup[pat] == nil then - expand_env_lookup[pat] = pat:find('%${') ~= nil - end - if expand_env_lookup[pat] then + local pat_cache = pattern_lookup[pat] + local fullpat, has_slash = pat_cache.fullpat, pat_cache.has_slash + + if pat_cache.has_env then local return_early --- @type true? --- @type string - pat = pat:gsub('%${(%S-)}', function(env) + fullpat = fullpat:gsub('%${(%S-)}', function(env) -- If an environment variable is present in the pattern but not set, there is no match if not vim.env[env] then return_early = true @@ -2447,12 +2453,11 @@ local function match_pattern(name, path, tail, pat) if return_early then return false end + has_slash = fullpat:find('/') ~= nil end -- If the pattern contains a / match against the full path, otherwise just the tail - local fullpat = '^' .. pat .. '$' - - if pat:find('/') then + if has_slash then -- Similar to |autocmd-pattern|, if the pattern contains a '/' then check for a match against -- both the short file name (as typed) and the full file name (after expanding to full path -- and resolving symlinks) -- cgit From 9d14b76089dfafbc663b0cfa0b185c484d0f1ed3 Mon Sep 17 00:00:00 2001 From: Evgeni Chasnovski Date: Fri, 12 Jul 2024 15:41:19 +0300 Subject: refactor(filetype): extract expanding env. vars in separate function --- runtime/lua/vim/filetype.lua | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'runtime/lua/vim/filetype.lua') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 236c67790f..5e34bac728 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -2430,6 +2430,19 @@ local function dispatch(ft, path, bufnr, ...) return ft0, on_detect end +--- @param pat string +--- @return boolean +--- @return string +local function expand_envvar_pattern(pat) + local some_env_missing = false + local expanded = pat:gsub('%${(%S-)}', function(env) + local val = vim.env[env] --- @type string? + some_env_missing = some_env_missing or val == nil + return vim.pesc(val or '') + end) + return some_env_missing, expanded +end + --- @param name string --- @param path string --- @param tail string @@ -2440,20 +2453,12 @@ local function match_pattern(name, path, tail, pat) local fullpat, has_slash = pat_cache.fullpat, pat_cache.has_slash if pat_cache.has_env then - local return_early --- @type true? - --- @type string - fullpat = fullpat:gsub('%${(%S-)}', function(env) - -- If an environment variable is present in the pattern but not set, there is no match - if not vim.env[env] then - return_early = true - return nil - end - return vim.pesc(vim.env[env]) - end) - if return_early then + local some_env_missing, expanded = expand_envvar_pattern(fullpat) + -- If any environment variable is present in the pattern but not set, there is no match + if some_env_missing then return false end - has_slash = fullpat:find('/') ~= nil + fullpat, has_slash = expanded, expanded:find('/') ~= nil end -- If the pattern contains a / match against the full path, otherwise just the tail -- cgit From 708b5f86ba6513050da0af72e1b6e07386c0acdb Mon Sep 17 00:00:00 2001 From: Evgeni Chasnovski Date: Fri, 12 Jul 2024 15:53:57 +0300 Subject: refactor(filetype): use Lua patterns without implicit anchoring --- runtime/lua/vim/filetype.lua | 921 ++++++++++++++++++++++--------------------- 1 file changed, 461 insertions(+), 460 deletions(-) (limited to 'runtime/lua/vim/filetype.lua') diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 5e34bac728..f0e1af4f04 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -1730,484 +1730,487 @@ local detect_apache = starsetf('apache') local detect_muttrc = starsetf('muttrc') local detect_neomuttrc = starsetf('neomuttrc') +--- Vim regexes are converted into explicit Lua patterns (without implicit anchoring): +--- '*/debian/changelog' -> '/debian/changelog$' +--- '*/bind/db.*' -> '/bind/db%.' --- @type vim.filetype.mapping local pattern = { -- BEGIN PATTERN - ['.*/etc/a2ps/.*%.cfg'] = 'a2ps', - ['.*/etc/a2ps%.cfg'] = 'a2ps', - ['.*/usr/share/alsa/alsa%.conf'] = 'alsaconf', - ['.*/etc/asound%.conf'] = 'alsaconf', - ['.*/etc/apache2/sites%-.*/.*%.com'] = 'apache', - ['.*/etc/httpd/.*%.conf'] = 'apache', - ['.*/etc/apache2/.*%.conf.*'] = detect_apache, - ['.*/etc/apache2/conf%..*/.*'] = detect_apache, - ['.*/etc/apache2/mods%-.*/.*'] = detect_apache, - ['.*/etc/apache2/sites%-.*/.*'] = detect_apache, - ['access%.conf.*'] = detect_apache, - ['apache%.conf.*'] = detect_apache, - ['apache2%.conf.*'] = detect_apache, - ['httpd%.conf.*'] = detect_apache, - ['srm%.conf.*'] = detect_apache, - ['.*/etc/httpd/conf%..*/.*'] = detect_apache, - ['.*/etc/httpd/conf%.d/.*%.conf.*'] = detect_apache, - ['.*/etc/httpd/mods%-.*/.*'] = detect_apache, - ['.*/etc/httpd/sites%-.*/.*'] = detect_apache, - ['.*/etc/proftpd/.*%.conf.*'] = starsetf('apachestyle'), - ['.*/etc/proftpd/conf%..*/.*'] = starsetf('apachestyle'), - ['proftpd%.conf.*'] = starsetf('apachestyle'), - ['.*asterisk/.*%.conf.*'] = starsetf('asterisk'), - ['.*asterisk.*/.*voicemail%.conf.*'] = starsetf('asteriskvm'), - ['.*/%.aptitude/config'] = 'aptconf', - ['[mM]akefile%.am'] = 'automake', - ['.*/bind/db%..*'] = starsetf('bindzone'), - ['.*/named/db%..*'] = starsetf('bindzone'), - ['.*/build/conf/.*%.conf'] = 'bitbake', - ['.*/meta/conf/.*%.conf'] = 'bitbake', - ['.*/meta%-.*/conf/.*%.conf'] = 'bitbake', - ['.*%.blade%.php'] = 'blade', - ['bzr_log%..*'] = 'bzr', - ['.*enlightenment/.*%.cfg'] = 'c', - ['.*/%.cabal/config'] = 'cabalconfig', - ['.*/cabal/config'] = 'cabalconfig', - ['cabal%.project%..*'] = starsetf('cabalproject'), - ['.*/%.calendar/.*'] = starsetf('calendar'), - ['.*/share/calendar/.*/calendar%..*'] = starsetf('calendar'), - ['.*/share/calendar/calendar%..*'] = starsetf('calendar'), - ['sgml%.catalog.*'] = starsetf('catalog'), - ['.*/etc/defaults/cdrdao'] = 'cdrdaoconf', - ['.*/etc/cdrdao%.conf'] = 'cdrdaoconf', - ['.*/etc/default/cdrdao'] = 'cdrdaoconf', - ['.*hgrc'] = 'cfg', - ['.*%.[Cc][Ff][Gg]'] = { + ['/etc/a2ps/.*%.cfg$'] = 'a2ps', + ['/etc/a2ps%.cfg$'] = 'a2ps', + ['/usr/share/alsa/alsa%.conf$'] = 'alsaconf', + ['/etc/asound%.conf$'] = 'alsaconf', + ['/etc/apache2/sites%-.*/.*%.com$'] = 'apache', + ['/etc/httpd/.*%.conf$'] = 'apache', + ['/etc/apache2/.*%.conf'] = detect_apache, + ['/etc/apache2/conf%..*/'] = detect_apache, + ['/etc/apache2/mods%-.*/'] = detect_apache, + ['/etc/apache2/sites%-.*/'] = detect_apache, + ['^access%.conf'] = detect_apache, + ['^apache%.conf'] = detect_apache, + ['^apache2%.conf'] = detect_apache, + ['^httpd%.conf'] = detect_apache, + ['^srm%.conf'] = detect_apache, + ['/etc/httpd/conf%..*/'] = detect_apache, + ['/etc/httpd/conf%.d/.*%.conf'] = detect_apache, + ['/etc/httpd/mods%-.*/'] = detect_apache, + ['/etc/httpd/sites%-.*/'] = detect_apache, + ['/etc/proftpd/.*%.conf'] = starsetf('apachestyle'), + ['/etc/proftpd/conf%..*/'] = starsetf('apachestyle'), + ['^proftpd%.conf'] = starsetf('apachestyle'), + ['asterisk/.*%.conf'] = starsetf('asterisk'), + ['asterisk.*/.*voicemail%.conf'] = starsetf('asteriskvm'), + ['/%.aptitude/config$'] = 'aptconf', + ['^[mM]akefile%.am$'] = 'automake', + ['/bind/db%.'] = starsetf('bindzone'), + ['/named/db%.'] = starsetf('bindzone'), + ['/build/conf/.*%.conf$'] = 'bitbake', + ['/meta/conf/.*%.conf$'] = 'bitbake', + ['/meta%-.*/conf/.*%.conf$'] = 'bitbake', + ['%.blade%.php$'] = 'blade', + ['^bzr_log%.'] = 'bzr', + ['enlightenment/.*%.cfg$'] = 'c', + ['/%.cabal/config$'] = 'cabalconfig', + ['/cabal/config$'] = 'cabalconfig', + ['^cabal%.project%.'] = starsetf('cabalproject'), + ['/%.calendar/'] = starsetf('calendar'), + ['/share/calendar/.*/calendar%.'] = starsetf('calendar'), + ['/share/calendar/calendar%.'] = starsetf('calendar'), + ['^sgml%.catalog'] = starsetf('catalog'), + ['/etc/defaults/cdrdao$'] = 'cdrdaoconf', + ['/etc/cdrdao%.conf$'] = 'cdrdaoconf', + ['/etc/default/cdrdao$'] = 'cdrdaoconf', + ['hgrc$'] = 'cfg', + ['%.[Cc][Ff][Gg]$'] = { detect.cfg, -- Decrease priority to avoid conflicts with more specific patterns -- such as '.*/etc/a2ps/.*%.cfg', '.*enlightenment/.*%.cfg', etc. { priority = -1 }, }, - ['[cC]hange[lL]og.*'] = starsetf(detect.changelog), - ['.*%.%.ch'] = 'chill', - ['.*/etc/translate%-shell'] = 'clojure', - ['.*%.cmake%.in'] = 'cmake', + ['^[cC]hange[lL]og'] = starsetf(detect.changelog), + ['%.%.ch$'] = 'chill', + ['/etc/translate%-shell$'] = 'clojure', + ['%.cmake%.in$'] = 'cmake', -- */cmus/rc and */.cmus/rc - ['.*/%.?cmus/rc'] = 'cmusrc', + ['/%.?cmus/rc$'] = 'cmusrc', -- */cmus/*.theme and */.cmus/*.theme - ['.*/%.?cmus/.*%.theme'] = 'cmusrc', - ['.*/%.cmus/autosave'] = 'cmusrc', - ['.*/%.cmus/command%-history'] = 'cmusrc', - ['.*/etc/hostname%..*'] = starsetf('config'), - ['crontab%..*'] = starsetf('crontab'), - ['.*/etc/cron%.d/.*'] = starsetf('crontab'), - ['%.cshrc.*'] = detect.csh, - ['%.login.*'] = detect.csh, - ['cvs%d+'] = 'cvs', - ['.*%.[Dd][Aa][Tt]'] = detect.dat, - ['.*/debian/patches/.*'] = detect.dep3patch, - ['.*/etc/dnsmasq%.d/.*'] = starsetf('dnsmasq'), - ['Containerfile%..*'] = starsetf('dockerfile'), - ['Dockerfile%..*'] = starsetf('dockerfile'), - ['.*/etc/yum%.repos%.d/.*'] = starsetf('dosini'), - ['drac%..*'] = starsetf('dracula'), - ['.*/debian/changelog'] = 'debchangelog', - ['.*/debian/control'] = 'debcontrol', - ['.*/debian/copyright'] = 'debcopyright', - ['.*/etc/apt/sources%.list%.d/.*%.list'] = 'debsources', - ['.*/etc/apt/sources%.list'] = 'debsources', - ['.*/etc/apt/sources%.list%.d/.*%.sources'] = 'deb822sources', - ['dictd.*%.conf'] = 'dictdconf', - ['.*/etc/DIR_COLORS'] = 'dircolors', - ['.*/etc/dnsmasq%.conf'] = 'dnsmasq', - ['php%.ini%-.*'] = 'dosini', - ['.*/%.aws/config'] = 'confini', - ['.*/%.aws/credentials'] = 'confini', - ['.*/etc/yum%.conf'] = 'dosini', - ['.*/lxqt/.*%.conf'] = 'dosini', - ['.*/screengrab/.*%.conf'] = 'dosini', - ['.*/bpython/config'] = 'dosini', - ['.*/mypy/config'] = 'dosini', - ['.*/flatpak/repo/config'] = 'dosini', - ['.*lvs'] = 'dracula', - ['.*lpe'] = 'dracula', - ['.*/dtrace/.*%.d'] = 'dtrace', - ['.*esmtprc'] = 'esmtprc', - ['.*Eterm/.*%.cfg'] = 'eterm', - ['.*s6.*/up'] = 'execline', - ['.*s6.*/down'] = 'execline', - ['.*s6.*/run'] = 'execline', - ['.*s6.*/finish'] = 'execline', - ['s6%-.*'] = 'execline', - ['[a-zA-Z0-9].*Dict'] = detect.foam, - ['[a-zA-Z0-9].*Dict%..*'] = detect.foam, - ['[a-zA-Z].*Properties'] = detect.foam, - ['[a-zA-Z].*Properties%..*'] = detect.foam, - ['.*Transport%..*'] = detect.foam, - ['.*/constant/g'] = detect.foam, - ['.*/0/.*'] = detect.foam, - ['.*/0%.orig/.*'] = detect.foam, - ['.*/%.fvwm/.*'] = starsetf('fvwm'), - ['.*fvwmrc.*'] = starsetf(detect.fvwm_v1), - ['.*fvwm95.*%.hook'] = starsetf(detect.fvwm_v1), - ['.*fvwm2rc.*'] = starsetf(detect.fvwm_v2), - ['.*/tmp/lltmp.*'] = starsetf('gedcom'), - ['.*/etc/gitconfig%.d/.*'] = starsetf('gitconfig'), - ['.*/gitolite%-admin/conf/.*'] = starsetf('gitolite'), - ['tmac%..*'] = starsetf('nroff'), - ['.*/%.gitconfig%.d/.*'] = starsetf('gitconfig'), - ['.*%.git/.*'] = { + ['/%.?cmus/.*%.theme$'] = 'cmusrc', + ['/%.cmus/autosave$'] = 'cmusrc', + ['/%.cmus/command%-history$'] = 'cmusrc', + ['/etc/hostname%.'] = starsetf('config'), + ['^crontab%.'] = starsetf('crontab'), + ['/etc/cron%.d/'] = starsetf('crontab'), + ['^%.cshrc'] = detect.csh, + ['^%.login'] = detect.csh, + ['^cvs%d+$'] = 'cvs', + ['%.[Dd][Aa][Tt]$'] = detect.dat, + ['/debian/patches/'] = detect.dep3patch, + ['/etc/dnsmasq%.d/'] = starsetf('dnsmasq'), + ['^Containerfile%.'] = starsetf('dockerfile'), + ['^Dockerfile%.'] = starsetf('dockerfile'), + ['/etc/yum%.repos%.d/'] = starsetf('dosini'), + ['^drac%.'] = starsetf('dracula'), + ['/debian/changelog$'] = 'debchangelog', + ['/debian/control$'] = 'debcontrol', + ['/debian/copyright$'] = 'debcopyright', + ['/etc/apt/sources%.list%.d/.*%.list$'] = 'debsources', + ['/etc/apt/sources%.list$'] = 'debsources', + ['/etc/apt/sources%.list%.d/.*%.sources$'] = 'deb822sources', + ['^dictd.*%.conf$'] = 'dictdconf', + ['/etc/DIR_COLORS$'] = 'dircolors', + ['/etc/dnsmasq%.conf$'] = 'dnsmasq', + ['^php%.ini%-'] = 'dosini', + ['/%.aws/config$'] = 'confini', + ['/%.aws/credentials$'] = 'confini', + ['/etc/yum%.conf$'] = 'dosini', + ['/lxqt/.*%.conf$'] = 'dosini', + ['/screengrab/.*%.conf$'] = 'dosini', + ['/bpython/config$'] = 'dosini', + ['/mypy/config$'] = 'dosini', + ['/flatpak/repo/config$'] = 'dosini', + ['lvs$'] = 'dracula', + ['lpe$'] = 'dracula', + ['/dtrace/.*%.d$'] = 'dtrace', + ['esmtprc$'] = 'esmtprc', + ['Eterm/.*%.cfg$'] = 'eterm', + ['s6.*/up$'] = 'execline', + ['s6.*/down$'] = 'execline', + ['s6.*/run$'] = 'execline', + ['s6.*/finish$'] = 'execline', + ['^s6%-'] = 'execline', + ['^[a-zA-Z0-9].*Dict$'] = detect.foam, + ['^[a-zA-Z0-9].*Dict%.'] = detect.foam, + ['^[a-zA-Z].*Properties$'] = detect.foam, + ['^[a-zA-Z].*Properties%.'] = detect.foam, + ['Transport%.'] = detect.foam, + ['/constant/g$'] = detect.foam, + ['/0/'] = detect.foam, + ['/0%.orig/'] = detect.foam, + ['/%.fvwm/'] = starsetf('fvwm'), + ['fvwmrc'] = starsetf(detect.fvwm_v1), + ['fvwm95.*%.hook$'] = starsetf(detect.fvwm_v1), + ['fvwm2rc'] = starsetf(detect.fvwm_v2), + ['/tmp/lltmp'] = starsetf('gedcom'), + ['/etc/gitconfig%.d/'] = starsetf('gitconfig'), + ['/gitolite%-admin/conf/'] = starsetf('gitolite'), + ['^tmac%.'] = starsetf('nroff'), + ['/%.gitconfig%.d/'] = starsetf('gitconfig'), + ['%.git/'] = { detect.git, -- Decrease priority to run after simple pattern checks { priority = -1 }, }, - ['.*%.git/modules/.*/config'] = 'gitconfig', - ['.*%.git/modules/config'] = 'gitconfig', - ['.*%.git/config'] = 'gitconfig', - ['.*/etc/gitconfig'] = 'gitconfig', - ['.*/%.config/git/config'] = 'gitconfig', - ['.*%.git/config%.worktree'] = 'gitconfig', - ['.*%.git/worktrees/.*/config%.worktree'] = 'gitconfig', - ['${XDG_CONFIG_HOME}/git/config'] = 'gitconfig', - ['.*%.git/info/attributes'] = 'gitattributes', - ['.*/etc/gitattributes'] = 'gitattributes', - ['.*/%.config/git/attributes'] = 'gitattributes', - ['${XDG_CONFIG_HOME}/git/attributes'] = 'gitattributes', - ['.*%.git/info/exclude'] = 'gitignore', - ['.*/%.config/git/ignore'] = 'gitignore', - ['${XDG_CONFIG_HOME}/git/ignore'] = 'gitignore', - ['%.gitsendemail%.msg%.......'] = 'gitsendemail', - ['gkrellmrc_.'] = 'gkrellmrc', - ['.*/usr/.*/gnupg/options%.skel'] = 'gpg', - ['.*/%.gnupg/options'] = 'gpg', - ['.*/%.gnupg/gpg%.conf'] = 'gpg', - ['${GNUPGHOME}/options'] = 'gpg', - ['${GNUPGHOME}/gpg%.conf'] = 'gpg', - ['.*/etc/group'] = 'group', - ['.*/etc/gshadow'] = 'group', - ['.*/etc/group%.edit'] = 'group', - ['.*/var/backups/gshadow%.bak'] = 'group', - ['.*/etc/group%-'] = 'group', - ['.*/etc/gshadow%-'] = 'group', - ['.*/var/backups/group%.bak'] = 'group', - ['.*/etc/gshadow%.edit'] = 'group', - ['.*/boot/grub/grub%.conf'] = 'grub', - ['.*/boot/grub/menu%.lst'] = 'grub', - ['.*/etc/grub%.conf'] = 'grub', + ['%.git/modules/.*/config$'] = 'gitconfig', + ['%.git/modules/config$'] = 'gitconfig', + ['%.git/config$'] = 'gitconfig', + ['/etc/gitconfig$'] = 'gitconfig', + ['/%.config/git/config$'] = 'gitconfig', + ['%.git/config%.worktree$'] = 'gitconfig', + ['%.git/worktrees/.*/config%.worktree$'] = 'gitconfig', + ['^${XDG_CONFIG_HOME}/git/config$'] = 'gitconfig', + ['%.git/info/attributes$'] = 'gitattributes', + ['/etc/gitattributes$'] = 'gitattributes', + ['/%.config/git/attributes$'] = 'gitattributes', + ['^${XDG_CONFIG_HOME}/git/attributes$'] = 'gitattributes', + ['%.git/info/exclude$'] = 'gitignore', + ['/%.config/git/ignore$'] = 'gitignore', + ['^${XDG_CONFIG_HOME}/git/ignore$'] = 'gitignore', + ['^%.gitsendemail%.msg%.......$'] = 'gitsendemail', + ['^gkrellmrc_.$'] = 'gkrellmrc', + ['/usr/.*/gnupg/options%.skel$'] = 'gpg', + ['/%.gnupg/options$'] = 'gpg', + ['/%.gnupg/gpg%.conf$'] = 'gpg', + ['^${GNUPGHOME}/options$'] = 'gpg', + ['^${GNUPGHOME}/gpg%.conf$'] = 'gpg', + ['/etc/group$'] = 'group', + ['/etc/gshadow$'] = 'group', + ['/etc/group%.edit$'] = 'group', + ['/var/backups/gshadow%.bak$'] = 'group', + ['/etc/group%-$'] = 'group', + ['/etc/gshadow%-$'] = 'group', + ['/var/backups/group%.bak$'] = 'group', + ['/etc/gshadow%.edit$'] = 'group', + ['/boot/grub/grub%.conf$'] = 'grub', + ['/boot/grub/menu%.lst$'] = 'grub', + ['/etc/grub%.conf$'] = 'grub', -- gtkrc* and .gtkrc* - ['%.?gtkrc.*'] = starsetf('gtkrc'), - ['${VIMRUNTIME}/doc/.*%.txt'] = 'help', - ['hg%-editor%-.*%.txt'] = 'hgcommit', - ['.*/etc/host%.conf'] = 'hostconf', - ['.*/etc/hosts%.deny'] = 'hostsaccess', - ['.*/etc/hosts%.allow'] = 'hostsaccess', - ['.*%.html%.m4'] = 'htmlm4', - ['.*/%.i3/config'] = 'i3config', - ['.*/i3/config'] = 'i3config', - ['.*/%.icewm/menu'] = 'icemenu', - ['.*/etc/initng/.*/.*%.i'] = 'initng', - ['JAM.*%..*'] = starsetf('jam'), - ['Prl.*%..*'] = starsetf('jam'), - ['.*%.properties_..'] = 'jproperties', - ['.*%.properties_.._..'] = 'jproperties', - ['org%.eclipse%..*%.prefs'] = 'jproperties', - ['.*%.properties_.._.._.*'] = starsetf('jproperties'), - ['[jt]sconfig.*%.json'] = 'jsonc', - ['[jJ]ustfile'] = 'just', - ['Kconfig%..*'] = starsetf('kconfig'), - ['Config%.in%..*'] = starsetf('kconfig'), - ['.*%.[Ss][Uu][Bb]'] = 'krl', - ['lilo%.conf.*'] = starsetf('lilo'), - ['.*/etc/logcheck/.*%.d.*/.*'] = starsetf('logcheck'), - ['.*/ldscripts/.*'] = 'ld', - ['.*lftp/rc'] = 'lftp', - ['.*/%.libao'] = 'libao', - ['.*/etc/libao%.conf'] = 'libao', - ['.*/etc/.*limits%.conf'] = 'limits', - ['.*/etc/limits'] = 'limits', - ['.*/etc/.*limits%.d/.*%.conf'] = 'limits', - ['.*/supertux2/config'] = 'lisp', - ['.*/LiteStep/.*/.*%.rc'] = 'litestep', - ['.*/etc/login%.access'] = 'loginaccess', - ['.*/etc/login%.defs'] = 'logindefs', - ['%.letter%.%d+'] = 'mail', - ['%.article%.%d+'] = 'mail', - ['/tmp/SLRN[0-9A-Z.]+'] = 'mail', - ['ae%d+%.txt'] = 'mail', - ['pico%.%d+'] = 'mail', - ['mutt%-.*%-%w+'] = 'mail', - ['muttng%-.*%-%w+'] = 'mail', - ['neomutt%-.*%-%w+'] = 'mail', - ['mutt' .. string.rep('[%w_-]', 6)] = 'mail', - ['neomutt' .. string.rep('[%w_-]', 6)] = 'mail', - ['snd%.%d+'] = 'mail', - ['reportbug%-.*'] = starsetf('mail'), - ['.*/etc/mail/aliases'] = 'mailaliases', - ['.*/etc/aliases'] = 'mailaliases', - ['.*[mM]akefile'] = 'make', - ['[mM]akefile.*'] = starsetf('make'), - ['.*/etc/man%.conf'] = 'manconf', - ['.*/log/auth'] = 'messages', - ['.*/log/cron'] = 'messages', - ['.*/log/daemon'] = 'messages', - ['.*/log/debug'] = 'messages', - ['.*/log/kern'] = 'messages', - ['.*/log/lpr'] = 'messages', - ['.*/log/mail'] = 'messages', - ['.*/log/messages'] = 'messages', - ['.*/log/news/news'] = 'messages', - ['.*/log/syslog'] = 'messages', - ['.*/log/user'] = 'messages', - ['.*/log/auth%.log'] = 'messages', - ['.*/log/cron%.log'] = 'messages', - ['.*/log/daemon%.log'] = 'messages', - ['.*/log/debug%.log'] = 'messages', - ['.*/log/kern%.log'] = 'messages', - ['.*/log/lpr%.log'] = 'messages', - ['.*/log/mail%.log'] = 'messages', - ['.*/log/messages%.log'] = 'messages', - ['.*/log/news/news%.log'] = 'messages', - ['.*/log/syslog%.log'] = 'messages', - ['.*/log/user%.log'] = 'messages', - ['.*/log/auth%.err'] = 'messages', - ['.*/log/cron%.err'] = 'messages', - ['.*/log/daemon%.err'] = 'messages', - ['.*/log/debug%.err'] = 'messages', - ['.*/log/kern%.err'] = 'messages', - ['.*/log/lpr%.err'] = 'messages', - ['.*/log/mail%.err'] = 'messages', - ['.*/log/messages%.err'] = 'messages', - ['.*/log/news/news%.err'] = 'messages', - ['.*/log/syslog%.err'] = 'messages', - ['.*/log/user%.err'] = 'messages', - ['.*/log/auth%.info'] = 'messages', - ['.*/log/cron%.info'] = 'messages', - ['.*/log/daemon%.info'] = 'messages', - ['.*/log/debug%.info'] = 'messages', - ['.*/log/kern%.info'] = 'messages', - ['.*/log/lpr%.info'] = 'messages', - ['.*/log/mail%.info'] = 'messages', - ['.*/log/messages%.info'] = 'messages', - ['.*/log/news/news%.info'] = 'messages', - ['.*/log/syslog%.info'] = 'messages', - ['.*/log/user%.info'] = 'messages', - ['.*/log/auth%.warn'] = 'messages', - ['.*/log/cron%.warn'] = 'messages', - ['.*/log/daemon%.warn'] = 'messages', - ['.*/log/debug%.warn'] = 'messages', - ['.*/log/kern%.warn'] = 'messages', - ['.*/log/lpr%.warn'] = 'messages', - ['.*/log/mail%.warn'] = 'messages', - ['.*/log/messages%.warn'] = 'messages', - ['.*/log/news/news%.warn'] = 'messages', - ['.*/log/syslog%.warn'] = 'messages', - ['.*/log/user%.warn'] = 'messages', - ['.*/log/auth%.crit'] = 'messages', - ['.*/log/cron%.crit'] = 'messages', - ['.*/log/daemon%.crit'] = 'messages', - ['.*/log/debug%.crit'] = 'messages', - ['.*/log/kern%.crit'] = 'messages', - ['.*/log/lpr%.crit'] = 'messages', - ['.*/log/mail%.crit'] = 'messages', - ['.*/log/messages%.crit'] = 'messages', - ['.*/log/news/news%.crit'] = 'messages', - ['.*/log/syslog%.crit'] = 'messages', - ['.*/log/user%.crit'] = 'messages', - ['.*/log/auth%.notice'] = 'messages', - ['.*/log/cron%.notice'] = 'messages', - ['.*/log/daemon%.notice'] = 'messages', - ['.*/log/debug%.notice'] = 'messages', - ['.*/log/kern%.notice'] = 'messages', - ['.*/log/lpr%.notice'] = 'messages', - ['.*/log/mail%.notice'] = 'messages', - ['.*/log/messages%.notice'] = 'messages', - ['.*/log/news/news%.notice'] = 'messages', - ['.*/log/syslog%.notice'] = 'messages', - ['.*/log/user%.notice'] = 'messages', - ['.*%.[Mm][Oo][Dd]'] = detect.mod, - ['.*/etc/modules%.conf'] = 'modconf', - ['.*/etc/conf%.modules'] = 'modconf', - ['.*/etc/modules'] = 'modconf', - ['.*/etc/modprobe%..*'] = starsetf('modconf'), - ['.*/etc/modutils/.*'] = starsetf(function(path, bufnr) + ['^%.?gtkrc'] = starsetf('gtkrc'), + ['^${VIMRUNTIME}/doc/.*%.txt$'] = 'help', + ['^hg%-editor%-.*%.txt$'] = 'hgcommit', + ['/etc/host%.conf$'] = 'hostconf', + ['/etc/hosts%.deny$'] = 'hostsaccess', + ['/etc/hosts%.allow$'] = 'hostsaccess', + ['%.html%.m4$'] = 'htmlm4', + ['/%.i3/config$'] = 'i3config', + ['/i3/config$'] = 'i3config', + ['/%.icewm/menu$'] = 'icemenu', + ['/etc/initng/.*/.*%.i$'] = 'initng', + ['^JAM.*%.'] = starsetf('jam'), + ['^Prl.*%.'] = starsetf('jam'), + ['%.properties_..$'] = 'jproperties', + ['%.properties_.._..$'] = 'jproperties', + ['^org%.eclipse%..*%.prefs$'] = 'jproperties', + ['%.properties_.._.._'] = starsetf('jproperties'), + ['^[jt]sconfig.*%.json$'] = 'jsonc', + ['^[jJ]ustfile$'] = 'just', + ['^Kconfig%.'] = starsetf('kconfig'), + ['^Config%.in%.'] = starsetf('kconfig'), + ['%.[Ss][Uu][Bb]$'] = 'krl', + ['^lilo%.conf'] = starsetf('lilo'), + ['/etc/logcheck/.*%.d.*/'] = starsetf('logcheck'), + ['/ldscripts/'] = 'ld', + ['lftp/rc$'] = 'lftp', + ['/%.libao$'] = 'libao', + ['/etc/libao%.conf$'] = 'libao', + ['/etc/.*limits%.conf$'] = 'limits', + ['/etc/limits$'] = 'limits', + ['/etc/.*limits%.d/.*%.conf$'] = 'limits', + ['/supertux2/config$'] = 'lisp', + ['/LiteStep/.*/.*%.rc$'] = 'litestep', + ['/etc/login%.access$'] = 'loginaccess', + ['/etc/login%.defs$'] = 'logindefs', + ['^%.letter%.%d+$'] = 'mail', + ['^%.article%.%d+$'] = 'mail', + ['^/tmp/SLRN[0-9A-Z.]+$'] = 'mail', + ['^ae%d+%.txt$'] = 'mail', + ['^pico%.%d+$'] = 'mail', + ['^mutt%-.*%-%w+$'] = 'mail', + ['^muttng%-.*%-%w+$'] = 'mail', + ['^neomutt%-.*%-%w+$'] = 'mail', + ['^mutt' .. string.rep('[%w_-]', 6) .. '$'] = 'mail', + ['^neomutt' .. string.rep('[%w_-]', 6) .. '$'] = 'mail', + ['^snd%.%d+$'] = 'mail', + ['^reportbug%-'] = starsetf('mail'), + ['/etc/mail/aliases$'] = 'mailaliases', + ['/etc/aliases$'] = 'mailaliases', + ['[mM]akefile$'] = 'make', + ['^[mM]akefile'] = starsetf('make'), + ['/etc/man%.conf$'] = 'manconf', + ['/log/auth$'] = 'messages', + ['/log/cron$'] = 'messages', + ['/log/daemon$'] = 'messages', + ['/log/debug$'] = 'messages', + ['/log/kern$'] = 'messages', + ['/log/lpr$'] = 'messages', + ['/log/mail$'] = 'messages', + ['/log/messages$'] = 'messages', + ['/log/news/news$'] = 'messages', + ['/log/syslog$'] = 'messages', + ['/log/user$'] = 'messages', + ['/log/auth%.log$'] = 'messages', + ['/log/cron%.log$'] = 'messages', + ['/log/daemon%.log$'] = 'messages', + ['/log/debug%.log$'] = 'messages', + ['/log/kern%.log$'] = 'messages', + ['/log/lpr%.log$'] = 'messages', + ['/log/mail%.log$'] = 'messages', + ['/log/messages%.log$'] = 'messages', + ['/log/news/news%.log$'] = 'messages', + ['/log/syslog%.log$'] = 'messages', + ['/log/user%.log$'] = 'messages', + ['/log/auth%.err$'] = 'messages', + ['/log/cron%.err$'] = 'messages', + ['/log/daemon%.err$'] = 'messages', + ['/log/debug%.err$'] = 'messages', + ['/log/kern%.err$'] = 'messages', + ['/log/lpr%.err$'] = 'messages', + ['/log/mail%.err$'] = 'messages', + ['/log/messages%.err$'] = 'messages', + ['/log/news/news%.err$'] = 'messages', + ['/log/syslog%.err$'] = 'messages', + ['/log/user%.err$'] = 'messages', + ['/log/auth%.info$'] = 'messages', + ['/log/cron%.info$'] = 'messages', + ['/log/daemon%.info$'] = 'messages', + ['/log/debug%.info$'] = 'messages', + ['/log/kern%.info$'] = 'messages', + ['/log/lpr%.info$'] = 'messages', + ['/log/mail%.info$'] = 'messages', + ['/log/messages%.info$'] = 'messages', + ['/log/news/news%.info$'] = 'messages', + ['/log/syslog%.info$'] = 'messages', + ['/log/user%.info$'] = 'messages', + ['/log/auth%.warn$'] = 'messages', + ['/log/cron%.warn$'] = 'messages', + ['/log/daemon%.warn$'] = 'messages', + ['/log/debug%.warn$'] = 'messages', + ['/log/kern%.warn$'] = 'messages', + ['/log/lpr%.warn$'] = 'messages', + ['/log/mail%.warn$'] = 'messages', + ['/log/messages%.warn$'] = 'messages', + ['/log/news/news%.warn$'] = 'messages', + ['/log/syslog%.warn$'] = 'messages', + ['/log/user%.warn$'] = 'messages', + ['/log/auth%.crit$'] = 'messages', + ['/log/cron%.crit$'] = 'messages', + ['/log/daemon%.crit$'] = 'messages', + ['/log/debug%.crit$'] = 'messages', + ['/log/kern%.crit$'] = 'messages', + ['/log/lpr%.crit$'] = 'messages', + ['/log/mail%.crit$'] = 'messages', + ['/log/messages%.crit$'] = 'messages', + ['/log/news/news%.crit$'] = 'messages', + ['/log/syslog%.crit$'] = 'messages', + ['/log/user%.crit$'] = 'messages', + ['/log/auth%.notice$'] = 'messages', + ['/log/cron%.notice$'] = 'messages', + ['/log/daemon%.notice$'] = 'messages', + ['/log/debug%.notice$'] = 'messages', + ['/log/kern%.notice$'] = 'messages', + ['/log/lpr%.notice$'] = 'messages', + ['/log/mail%.notice$'] = 'messages', + ['/log/messages%.notice$'] = 'messages', + ['/log/news/news%.notice$'] = 'messages', + ['/log/syslog%.notice$'] = 'messages', + ['/log/user%.notice$'] = 'messages', + ['%.[Mm][Oo][Dd]$'] = detect.mod, + ['/etc/modules%.conf$'] = 'modconf', + ['/etc/conf%.modules$'] = 'modconf', + ['/etc/modules$'] = 'modconf', + ['/etc/modprobe%.'] = starsetf('modconf'), + ['/etc/modutils/'] = starsetf(function(path, bufnr) if fn.executable(fn.expand(path)) ~= 1 then return 'modconf' end end), - ['Muttrc'] = 'muttrc', - ['Muttngrc'] = 'muttrc', - ['.*/etc/Muttrc%.d/.*'] = starsetf('muttrc'), - ['.*/%.mplayer/config'] = 'mplayerconf', - ['Muttrc.*'] = detect_muttrc, - ['Muttngrc.*'] = detect_muttrc, + ['^Muttrc$'] = 'muttrc', + ['^Muttngrc$'] = 'muttrc', + ['/etc/Muttrc%.d/'] = starsetf('muttrc'), + ['/%.mplayer/config$'] = 'mplayerconf', + ['^Muttrc'] = detect_muttrc, + ['^Muttngrc'] = detect_muttrc, -- muttrc* and .muttrc* - ['%.?muttrc.*'] = detect_muttrc, + ['^%.?muttrc'] = detect_muttrc, -- muttngrc* and .muttngrc* - ['%.?muttngrc.*'] = detect_muttrc, - ['.*/%.mutt/muttrc.*'] = detect_muttrc, - ['.*/%.muttng/muttrc.*'] = detect_muttrc, - ['.*/%.muttng/muttngrc.*'] = detect_muttrc, - ['rndc.*%.conf'] = 'named', - ['rndc.*%.key'] = 'named', - ['named.*%.conf'] = 'named', - ['.*/etc/nanorc'] = 'nanorc', - ['.*%.NS[ACGLMNPS]'] = 'natural', - ['Neomuttrc.*'] = detect_neomuttrc, + ['^%.?muttngrc'] = detect_muttrc, + ['/%.mutt/muttrc'] = detect_muttrc, + ['/%.muttng/muttrc'] = detect_muttrc, + ['/%.muttng/muttngrc'] = detect_muttrc, + ['^rndc.*%.conf$'] = 'named', + ['^rndc.*%.key$'] = 'named', + ['^named.*%.conf$'] = 'named', + ['/etc/nanorc$'] = 'nanorc', + ['%.NS[ACGLMNPS]$'] = 'natural', + ['^Neomuttrc'] = detect_neomuttrc, -- neomuttrc* and .neomuttrc* - ['%.?neomuttrc.*'] = detect_neomuttrc, - ['.*/%.neomutt/neomuttrc.*'] = detect_neomuttrc, - ['nginx.*%.conf'] = 'nginx', - ['.*/etc/nginx/.*'] = 'nginx', - ['.*nginx%.conf'] = 'nginx', - ['.*/nginx/.*%.conf'] = 'nginx', - ['.*/usr/local/nginx/conf/.*'] = 'nginx', - ['.*%.[1-9]'] = detect.nroff, - ['.*%.ml%.cppo'] = 'ocaml', - ['.*%.mli%.cppo'] = 'ocaml', - ['.*/octave/history'] = 'octave', - ['.*%.opam%.template'] = 'opam', - ['.*/openvpn/.*/.*%.conf'] = 'openvpn', - ['.*%.[Oo][Pp][Ll]'] = 'opl', - ['.*/etc/pam%.conf'] = 'pamconf', - ['.*/etc/pam%.d/.*'] = starsetf('pamconf'), - ['.*/etc/passwd%-'] = 'passwd', - ['.*/etc/shadow'] = 'passwd', - ['.*/etc/shadow%.edit'] = 'passwd', - ['.*/var/backups/shadow%.bak'] = 'passwd', - ['.*/var/backups/passwd%.bak'] = 'passwd', - ['.*/etc/passwd'] = 'passwd', - ['.*/etc/passwd%.edit'] = 'passwd', - ['.*/etc/shadow%-'] = 'passwd', - ['%.?gitolite%.rc'] = 'perl', - ['example%.gitolite%.rc'] = 'perl', - ['.*%.php%d'] = 'php', - ['.*/%.pinforc'] = 'pinfo', - ['.*/etc/pinforc'] = 'pinfo', - ['.*%.[Pp][Rr][Gg]'] = detect.prg, - ['.*/etc/protocols'] = 'protocols', - ['.*printcap.*'] = starsetf(function(path, bufnr) + ['^%.?neomuttrc'] = detect_neomuttrc, + ['/%.neomutt/neomuttrc'] = detect_neomuttrc, + ['^nginx.*%.conf$'] = 'nginx', + ['/etc/nginx/'] = 'nginx', + ['nginx%.conf$'] = 'nginx', + ['/nginx/.*%.conf$'] = 'nginx', + ['/usr/local/nginx/conf/'] = 'nginx', + ['%.[1-9]$'] = detect.nroff, + ['%.ml%.cppo$'] = 'ocaml', + ['%.mli%.cppo$'] = 'ocaml', + ['/octave/history$'] = 'octave', + ['%.opam%.template$'] = 'opam', + ['/openvpn/.*/.*%.conf$'] = 'openvpn', + ['%.[Oo][Pp][Ll]$'] = 'opl', + ['/etc/pam%.conf$'] = 'pamconf', + ['/etc/pam%.d/'] = starsetf('pamconf'), + ['/etc/passwd%-$'] = 'passwd', + ['/etc/shadow$'] = 'passwd', + ['/etc/shadow%.edit$'] = 'passwd', + ['/var/backups/shadow%.bak$'] = 'passwd', + ['/var/backups/passwd%.bak$'] = 'passwd', + ['/etc/passwd$'] = 'passwd', + ['/etc/passwd%.edit$'] = 'passwd', + ['/etc/shadow%-$'] = 'passwd', + ['^%.?gitolite%.rc$'] = 'perl', + ['^example%.gitolite%.rc$'] = 'perl', + ['%.php%d$'] = 'php', + ['/%.pinforc$'] = 'pinfo', + ['/etc/pinforc$'] = 'pinfo', + ['%.[Pp][Rr][Gg]$'] = detect.prg, + ['/etc/protocols$'] = 'protocols', + ['printcap'] = starsetf(function(path, bufnr) return require('vim.filetype.detect').printcap('print') end), - ['.*baseq[2-3]/.*%.cfg'] = 'quake', - ['.*quake[1-3]/.*%.cfg'] = 'quake', - ['.*id1/.*%.cfg'] = 'quake', - ['.*/queries/.*%.scm'] = 'query', -- treesitter queries (Neovim only) - ['.*,v'] = 'rcs', - ['%.reminders.*'] = starsetf('remind'), - ['.*%-requirements%.txt'] = 'requirements', - ['requirements/.*%.txt'] = 'requirements', - ['requires/.*%.txt'] = 'requirements', - ['[rR]akefile.*'] = starsetf('ruby'), - ['[rR]antfile'] = 'ruby', - ['[rR]akefile'] = 'ruby', - ['.*/etc/sensors%.d/[^.].*'] = starsetf('sensors'), - ['.*/etc/sensors%.conf'] = 'sensors', - ['.*/etc/sensors3%.conf'] = 'sensors', - ['.*/etc/services'] = 'services', - ['.*/etc/serial%.conf'] = 'setserial', - ['.*/etc/udev/cdsymlinks%.conf'] = 'sh', - ['.*/neofetch/config%.conf'] = 'sh', - ['%.bash[_%-]aliases'] = detect.bash, - ['%.bash[_%-]history'] = detect.bash, - ['%.bash[_%-]logout'] = detect.bash, - ['%.bash[_%-]profile'] = detect.bash, - ['%.kshrc.*'] = detect.ksh, - ['%.profile.*'] = detect.sh, - ['.*/etc/profile'] = detect.sh, - ['bash%-fc[%-%.].*'] = detect.bash, - ['%.tcshrc.*'] = detect.tcsh, - ['.*/etc/sudoers%.d/.*'] = starsetf('sudoers'), - ['.*%._sst%.meta'] = 'sisu', - ['.*%.%-sst%.meta'] = 'sisu', - ['.*%.sst%.meta'] = 'sisu', - ['.*/etc/slp%.conf'] = 'slpconf', - ['.*/etc/slp%.reg'] = 'slpreg', - ['.*/etc/slp%.spi'] = 'slpspi', - ['.*/etc/ssh/ssh_config%.d/.*%.conf'] = 'sshconfig', - ['.*/%.ssh/config'] = 'sshconfig', - ['.*/%.ssh/.*%.conf'] = 'sshconfig', - ['.*/etc/ssh/sshd_config%.d/.*%.conf'] = 'sshdconfig', - ['.*%.[Ss][Rr][Cc]'] = detect.src, - ['.*/etc/sudoers'] = 'sudoers', - ['svn%-commit.*%.tmp'] = 'svn', - ['.*/sway/config'] = 'swayconfig', - ['.*/%.sway/config'] = 'swayconfig', - ['.*%.swift%.gyb'] = 'swiftgyb', - ['.*%.[Ss][Yy][Ss]'] = detect.sys, - ['.*/etc/sysctl%.conf'] = 'sysctl', - ['.*/etc/sysctl%.d/.*%.conf'] = 'sysctl', - ['.*/systemd/.*%.automount'] = 'systemd', - ['.*/systemd/.*%.dnssd'] = 'systemd', - ['.*/systemd/.*%.link'] = 'systemd', - ['.*/systemd/.*%.mount'] = 'systemd', - ['.*/systemd/.*%.netdev'] = 'systemd', - ['.*/systemd/.*%.network'] = 'systemd', - ['.*/systemd/.*%.nspawn'] = 'systemd', - ['.*/systemd/.*%.path'] = 'systemd', - ['.*/systemd/.*%.service'] = 'systemd', - ['.*/systemd/.*%.slice'] = 'systemd', - ['.*/systemd/.*%.socket'] = 'systemd', - ['.*/systemd/.*%.swap'] = 'systemd', - ['.*/systemd/.*%.target'] = 'systemd', - ['.*/systemd/.*%.timer'] = 'systemd', - ['.*/etc/systemd/.*%.conf%.d/.*%.conf'] = 'systemd', - ['.*/%.config/systemd/user/.*%.d/.*%.conf'] = 'systemd', - ['.*/etc/systemd/system/.*%.d/.*%.conf'] = 'systemd', - ['.*/etc/systemd/system/.*%.d/%.#.*'] = 'systemd', - ['.*/etc/systemd/system/%.#.*'] = 'systemd', - ['.*/%.config/systemd/user/.*%.d/%.#.*'] = 'systemd', - ['.*/%.config/systemd/user/%.#.*'] = 'systemd', - ['.*termcap.*'] = starsetf(function(path, bufnr) + ['baseq[2-3]/.*%.cfg$'] = 'quake', + ['quake[1-3]/.*%.cfg$'] = 'quake', + ['id1/.*%.cfg$'] = 'quake', + ['/queries/.*%.scm$'] = 'query', -- treesitter queries (Neovim only) + [',v$'] = 'rcs', + ['^%.reminders'] = starsetf('remind'), + ['%-requirements%.txt$'] = 'requirements', + ['^requirements/.*%.txt$'] = 'requirements', + ['^requires/.*%.txt$'] = 'requirements', + ['^[rR]akefile'] = starsetf('ruby'), + ['^[rR]antfile$'] = 'ruby', + ['^[rR]akefile$'] = 'ruby', + ['/etc/sensors%.d/[^.]'] = starsetf('sensors'), + ['/etc/sensors%.conf$'] = 'sensors', + ['/etc/sensors3%.conf$'] = 'sensors', + ['/etc/services$'] = 'services', + ['/etc/serial%.conf$'] = 'setserial', + ['/etc/udev/cdsymlinks%.conf$'] = 'sh', + ['/neofetch/config%.conf$'] = 'sh', + ['^%.bash[_%-]aliases$'] = detect.bash, + ['^%.bash[_%-]history$'] = detect.bash, + ['^%.bash[_%-]logout$'] = detect.bash, + ['^%.bash[_%-]profile$'] = detect.bash, + ['^%.kshrc'] = detect.ksh, + ['^%.profile'] = detect.sh, + ['/etc/profile$'] = detect.sh, + ['^bash%-fc[%-%.]'] = detect.bash, + ['^%.tcshrc'] = detect.tcsh, + ['/etc/sudoers%.d/'] = starsetf('sudoers'), + ['%._sst%.meta$'] = 'sisu', + ['%.%-sst%.meta$'] = 'sisu', + ['%.sst%.meta$'] = 'sisu', + ['/etc/slp%.conf$'] = 'slpconf', + ['/etc/slp%.reg$'] = 'slpreg', + ['/etc/slp%.spi$'] = 'slpspi', + ['/etc/ssh/ssh_config%.d/.*%.conf$'] = 'sshconfig', + ['/%.ssh/config$'] = 'sshconfig', + ['/%.ssh/.*%.conf$'] = 'sshconfig', + ['/etc/ssh/sshd_config%.d/.*%.conf$'] = 'sshdconfig', + ['%.[Ss][Rr][Cc]$'] = detect.src, + ['/etc/sudoers$'] = 'sudoers', + ['^svn%-commit.*%.tmp$'] = 'svn', + ['/sway/config$'] = 'swayconfig', + ['/%.sway/config$'] = 'swayconfig', + ['%.swift%.gyb$'] = 'swiftgyb', + ['%.[Ss][Yy][Ss]$'] = detect.sys, + ['/etc/sysctl%.conf$'] = 'sysctl', + ['/etc/sysctl%.d/.*%.conf$'] = 'sysctl', + ['/systemd/.*%.automount$'] = 'systemd', + ['/systemd/.*%.dnssd$'] = 'systemd', + ['/systemd/.*%.link$'] = 'systemd', + ['/systemd/.*%.mount$'] = 'systemd', + ['/systemd/.*%.netdev$'] = 'systemd', + ['/systemd/.*%.network$'] = 'systemd', + ['/systemd/.*%.nspawn$'] = 'systemd', + ['/systemd/.*%.path$'] = 'systemd', + ['/systemd/.*%.service$'] = 'systemd', + ['/systemd/.*%.slice$'] = 'systemd', + ['/systemd/.*%.socket$'] = 'systemd', + ['/systemd/.*%.swap$'] = 'systemd', + ['/systemd/.*%.target$'] = 'systemd', + ['/systemd/.*%.timer$'] = 'systemd', + ['/etc/systemd/.*%.conf%.d/.*%.conf$'] = 'systemd', + ['/%.config/systemd/user/.*%.d/.*%.conf$'] = 'systemd', + ['/etc/systemd/system/.*%.d/.*%.conf$'] = 'systemd', + ['/etc/systemd/system/.*%.d/%.#'] = 'systemd', + ['/etc/systemd/system/%.#'] = 'systemd', + ['/%.config/systemd/user/.*%.d/%.#'] = 'systemd', + ['/%.config/systemd/user/%.#'] = 'systemd', + ['termcap'] = starsetf(function(path, bufnr) return require('vim.filetype.detect').printcap('term') end), - ['.*/tex/latex/.*%.cfg'] = 'tex', - ['.*%.t%.html'] = 'tilde', - ['%.?tmux.*%.conf'] = 'tmux', - ['%.?tmux.*%.conf.*'] = { 'tmux', { priority = -1 } }, - ['.*/%.cargo/config'] = 'toml', - ['.*/%.cargo/credentials'] = 'toml', - ['.*/etc/udev/udev%.conf'] = 'udevconf', - ['.*/etc/udev/permissions%.d/.*%.permissions'] = 'udevperm', - ['.*/etc/updatedb%.conf'] = 'updatedb', - ['.*/%.init/.*%.override'] = 'upstart', - ['.*/usr/share/upstart/.*%.conf'] = 'upstart', - ['.*/%.config/ups