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