From c3569c1b5137efbe7871e76fa271d533e1e2765b Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Tue, 5 Nov 2024 11:42:23 +0100 Subject: [PATCH] explore workspace dir pusing oil.nvim to configure libraries manually --- lua/kickstart/plugins/lspconfig.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lua/kickstart/plugins/lspconfig.lua b/lua/kickstart/plugins/lspconfig.lua index 98eded4..dff0980 100644 --- a/lua/kickstart/plugins/lspconfig.lua +++ b/lua/kickstart/plugins/lspconfig.lua @@ -29,6 +29,9 @@ return { -- Allows extra capabilities provided by nvim-cmp 'hrsh7th/cmp-nvim-lsp', + + -- Needed to explore Workspace in Java + 'stevearc/oil.nvim', }, config = function() -- Brief aside: **What is LSP?** @@ -273,11 +276,15 @@ return { end vim.api.nvim_create_autocmd('FileType', { pattern = 'java', - callback = function() + callback = function(opt) local project_name = vim.fn.fnamemodify(vim.fn.getcwd(), ':p:h:t') -- calculate workspace dir local workspace_dir = vim.fn.stdpath 'data' .. '/site/java/workspace-root/' .. project_name require('jdtls').start_or_attach(generate_config(workspace_dir)) + vim.keymap.set('n', 'we', 'Oil ' .. workspace_dir .. '', { + desc = '[W]orkspace [E]xplorer', + buffer = opt.buf, + }) end, }) end