refactor filetype function + add docker compose fix
This commit is contained in:
parent
1a7bee8041
commit
fc3cdeaad9
|
@ -1,6 +1,10 @@
|
|||
vim.cmd([[
|
||||
augroup filetypedetect
|
||||
autocmd! BufRead,BufNewFile .swcrc setfiletype json
|
||||
autocmd! BufRead,BufNewFile .prettierrc setfiletype json
|
||||
augroup END
|
||||
]])
|
||||
local function set_filetype(pattern, filetype)
|
||||
vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
|
||||
pattern = pattern,
|
||||
command = 'set filetype=' .. filetype,
|
||||
})
|
||||
end
|
||||
|
||||
set_filetype('.swcrc', 'json')
|
||||
set_filetype('.prettierrc', 'json')
|
||||
set_filetype('docker-compose.yml', 'yaml.docker-compose')
|
||||
|
|
Loading…
Reference in New Issue