mirror of
https://github.com/Baipyrus/nvim-config.git
synced 2024-11-14 13:03:49 +00:00
explore workspace dir pusing oil.nvim to configure libraries manually
This commit is contained in:
parent
ad214db84e
commit
c3569c1b51
@ -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', '<leader>we', '<cmd>Oil ' .. workspace_dir .. '<cr>', {
|
||||
desc = '[W]orkspace [E]xplorer',
|
||||
buffer = opt.buf,
|
||||
})
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user