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