From 2b19d6910aed037fe2ab9d02ae76c2af2a0bf14e Mon Sep 17 00:00:00 2001 From: alemi Date: Thu, 26 Jan 2023 21:26:44 +0100 Subject: [PATCH] feat: extra lsp stuff for java --- ftplugin/java.lua | 6 ++++++ lua/plugins.lua | 1 + 2 files changed, 7 insertions(+) create mode 100644 ftplugin/java.lua 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