diff --git a/dot_config/nvim/ftplugin/java.lua b/dot_config/nvim/ftplugin/java.lua new file mode 100644 index 0000000..a395eb3 --- /dev/null +++ b/dot_config/nvim/ftplugin/java.lua @@ -0,0 +1,4 @@ +local config = { + root_dir = vim.fs.dirname(vim.fs.find({ 'gradlew', '.git', 'mvnw' }, { upward = true })[1]), +} +require('jdtls').start_or_attach(config) diff --git a/dot_config/nvim/lua/plugins.lua b/dot_config/nvim/lua/plugins.lua index 24bf7bc..7a3b845 100644 --- a/dot_config/nvim/lua/plugins.lua +++ b/dot_config/nvim/lua/plugins.lua @@ -128,6 +128,7 @@ return require('packer').startup({ -- LSP server use { 'neovim/nvim-lspconfig', + requires = { "mfussenegger/nvim-jdtls" }, config = function() require('plugins.lspconfig') end } diff --git a/dot_config/nvim/lua/plugins/lspconfig.lua b/dot_config/nvim/lua/plugins/lspconfig.lua index b47509a..16f42db 100644 --- a/dot_config/nvim/lua/plugins/lspconfig.lua +++ b/dot_config/nvim/lua/plugins/lspconfig.lua @@ -1,7 +1,7 @@ local get_servers_to_install = function() local servers_to_install = { "clangd", "pyright", "jsonls", "dockerls", "rust_analyzer", "elixirls", - "jdtls", "zls", "gopls", "texlab", "rnix" + "zls", "gopls", "texlab", "rnix" } return servers_to_install end