-
-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathprepare-config.lua
More file actions
68 lines (60 loc) · 1.32 KB
/
prepare-config.lua
File metadata and controls
68 lines (60 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable',
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
local temp_path = './.test_plugins'
-- Setup lazy.nvim
require('lazy').setup({
{
'nvim-lua/plenary.nvim',
lazy = false,
},
'MunifTanjim/nui.nvim',
'mfussenegger/nvim-dap',
{
'JavaHello/spring-boot.nvim',
commit = '218c0c26c14d99feca778e4d13f5ec3e8b1b60f0',
},
{
'nvim-java/nvim-java',
dir = '.',
config = function()
local is_nixos = vim.fn.filereadable('/etc/NIXOS') == 1
local is_ci = vim.env.CI ~= nil
local config = {
jdk = {
auto_install = not is_nixos,
},
}
if is_ci then
config.log = {
level = 'debug',
use_console = true,
}
end
require('java').setup(config)
vim.lsp.enable('jdtls')
end,
},
}, {
root = temp_path,
lockfile = temp_path .. '/lazy-lock.json',
defaults = { lazy = false },
})
vim.api.nvim_create_autocmd('LspAttach', {
callback = function(args)
-- stylua: ignore
vim.lsp.completion.enable(true, args.data.client_id, args.buf, { autotrigger = true })
vim.keymap.set('i', '<C-Space>', function()
vim.lsp.completion.get()
end, { buffer = args.buf })
end,
})