From d9eca6205af6a94189c753e92324d339fdaaca4d Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Sun, 28 Jul 2024 22:08:44 +0200 Subject: [PATCH] trigger on java file opened --- lua/kickstart/plugins/lspconfig.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/kickstart/plugins/lspconfig.lua b/lua/kickstart/plugins/lspconfig.lua index b885082..d7ee82d 100644 --- a/lua/kickstart/plugins/lspconfig.lua +++ b/lua/kickstart/plugins/lspconfig.lua @@ -262,7 +262,12 @@ return { bundles = {}, }, } - require('jdtls').start_or_attach(config) + vim.api.nvim_create_autocmd('FileType', { + pattern = 'java', + callback = function() + require('jdtls').start_or_attach(config) + end, + }) end -- Ensure the servers and tools above are installed