mirror of
https://github.com/Baipyrus/nvim-config.git
synced 2024-12-25 04:41:46 +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
|
-- Allows extra capabilities provided by nvim-cmp
|
||||||
'hrsh7th/cmp-nvim-lsp',
|
'hrsh7th/cmp-nvim-lsp',
|
||||||
|
|
||||||
|
-- Needed to explore Workspace in Java
|
||||||
|
'stevearc/oil.nvim',
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
-- Brief aside: **What is LSP?**
|
-- Brief aside: **What is LSP?**
|
||||||
@ -273,11 +276,15 @@ return {
|
|||||||
end
|
end
|
||||||
vim.api.nvim_create_autocmd('FileType', {
|
vim.api.nvim_create_autocmd('FileType', {
|
||||||
pattern = 'java',
|
pattern = 'java',
|
||||||
callback = function()
|
callback = function(opt)
|
||||||
local project_name = vim.fn.fnamemodify(vim.fn.getcwd(), ':p:h:t')
|
local project_name = vim.fn.fnamemodify(vim.fn.getcwd(), ':p:h:t')
|
||||||
-- calculate workspace dir
|
-- calculate workspace dir
|
||||||
local workspace_dir = vim.fn.stdpath 'data' .. '/site/java/workspace-root/' .. project_name
|
local workspace_dir = vim.fn.stdpath 'data' .. '/site/java/workspace-root/' .. project_name
|
||||||
require('jdtls').start_or_attach(generate_config(workspace_dir))
|
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,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user