Use vim.filetype.add over creating an autocmd
This commit is contained in:
@@ -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
|
|
||||||
|
|||||||
Reference in New Issue
Block a user