diff options
Diffstat (limited to '.config')
-rw-r--r-- | .config/nvim/plugins.vim | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/.config/nvim/plugins.vim b/.config/nvim/plugins.vim index a333ac1..1be788d 100644 --- a/.config/nvim/plugins.vim +++ b/.config/nvim/plugins.vim @@ -151,6 +151,46 @@ require('lazy').setup({ require('lspconfig')[server_name].setup(lspconfig_setup) end } + + -- fix LSPs not attaching to buffer sometimes + local filetypes = { + { + pattern = '*.php', + filetype = 'php', + }, + { + pattern = '*.js', + filetype = 'javascript', + }, + { + pattern = '*.vue', + filetype = 'vue', + }, + { + pattern = '*.twig', + filetype = 'twig', + }, + { + pattern = '*.lua', + filetype = 'lua', + }, + { + pattern = '*.vim', + filetype = 'vim', + }, + { + pattern = '*.mcfunction', + filetype = 'mcfunction', + }, + } + for _, entry in ipairs(filetypes) do + vim.api.nvim_create_autocmd({ 'BufEnter' }, { + pattern = { entry['pattern'] }, + callback = function(event) + vim.cmd('set filetype=' .. entry['filetype']) + end, + }) + end end, }, |