69 lines
2.0 KiB
Lua
69 lines
2.0 KiB
Lua
vim.filetype.add {
|
|
filename = {
|
|
vifmrc = 'vifm',
|
|
['.ansible-lint'] = 'yaml',
|
|
['.yamllint'] = 'yaml',
|
|
['ansible.cfg'] = 'ini',
|
|
['BUCK'] = 'bzl',
|
|
['flake.lock'] = 'json',
|
|
['MODULE.bazel.lock'] = 'json',
|
|
['go.mod'] = 'gomod',
|
|
['mopidy.conf'] = 'cfg',
|
|
['mpDris2.conf'] = 'cfg',
|
|
['mpd.conf'] = 'conf',
|
|
['terraform.tfstate'] = 'json',
|
|
},
|
|
extension = {
|
|
dj = 'djot',
|
|
gwl = 'wisp',
|
|
hurl = 'hurl',
|
|
j2 = 'jinja',
|
|
jinja = 'jinja',
|
|
jinja2 = 'jinja',
|
|
k = 'kcl',
|
|
kk = 'koka',
|
|
mdx = 'markdown.mdx',
|
|
mmd = 'mermaid',
|
|
ncl = 'nickel',
|
|
nu = 'nu',
|
|
purs = 'purescript',
|
|
rasi = 'rasi',
|
|
rasinc = 'rasi',
|
|
res = 'rescript',
|
|
resi = 'rescript',
|
|
river = 'hcl',
|
|
templ = 'templ',
|
|
tmpl = 'gotmpl',
|
|
typ = 'typst',
|
|
w = 'wisp',
|
|
wisp = 'wisp',
|
|
},
|
|
pattern = {
|
|
['${HOME}/.kube/config'] = 'yaml',
|
|
-- Ansible
|
|
['.*/roles/[^/]+/tasks/.+%.ya?ml'] = 'yaml.ansible',
|
|
['.*/roles/[^/]+/handlers/[^/]+%.ya?ml'] = 'yaml.ansible',
|
|
['.*/playbooks/[^/]+%.ya?ml'] = 'yaml.ansible',
|
|
-- Helm chart templates
|
|
['.*/templates/.+%.ya?ml'] = 'helm',
|
|
['.*/templates/.+%.tpl'] = 'helm',
|
|
-- Waybar config
|
|
['${XDG_CONFIG_HOME}/waybar/config'] = 'jsonc',
|
|
-- please.build
|
|
['%.?plzconfig'] = 'gitconfig',
|
|
['%.plzconfig_[%w_]+'] = 'gitconfig',
|
|
['%.plzconfig.[%w_%-]+'] = 'gitconfig',
|
|
-- Fallback logic
|
|
['.*'] = {
|
|
priority = -math.huge,
|
|
function(_, bufnr)
|
|
local first_line = vim.api.nvim_buf_get_lines(bufnr, 0, 1, false)[1] or ''
|
|
---@diagnostic disable-next-line: param-type-mismatch
|
|
if first_line:find('^#!.*[%s/]nft %-f$') then
|
|
return 'nftables'
|
|
end
|
|
end,
|
|
},
|
|
},
|
|
}
|