diff --git a/ftplugin/java.lua b/ftplugin/java.lua new file mode 100644 index 0000000..0384a62 --- /dev/null +++ b/ftplugin/java.lua @@ -0,0 +1,6 @@ +local nvim_jdtls = require("jdtls") +nvim_jdtls.start_or_attach({ + cmd = { 'jdtls' }, + root_dir = vim.fs.dirname(vim.fs.find({'.gradlew', '.git', 'mvnw'}, {upward = true})[1]), +}) +require('keybinds'):set_lsp_keys({}) diff --git a/lua/plugins.lua b/lua/plugins.lua index 2642a25..4310893 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -42,6 +42,7 @@ local init_fn = function(use) use 'neovim/nvim-lspconfig' -- import LSP configurations use 'simrat39/rust-tools.nvim' -- extra LSP defaults for rust + use 'mfussenegger/nvim-jdtls' -- extra LSP stuff for java use 'L3MON4D3/LuaSnip' -- snippet engine