Use vim.filetype.add over creating an autocmd

This commit is contained in:
2026-01-26 18:58:33 +01:00
parent 788f5a7ee1
commit 177b4f26ad

View File

@@ -57,17 +57,11 @@ Autocmd('BufEnter', {
end, end,
}) })
---@type table<string, string> vim.filetype.add({
local filemap = { extension = {
['*.h'] = 'c', h = 'c',
['*/i3/**.conf'] = 'i3config' },
} pattern = {
['${XDG_CONFIG_HOME}/i3/.*%.conf'] = 'i3config'
for pat, file in pairs(filemap) do }
Autocmd('BufRead', { })
pattern = pat,
callback = function()
vim.bo.filetype = file
end
})
end