-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathminimal_debug_init.lua
65 lines (54 loc) · 1.88 KB
/
minimal_debug_init.lua
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
local on_windows = vim.loop.os_uname().version:match "Windows"
local function join_paths(...)
local path_sep = on_windows and "\\" or "/"
local result = table.concat({ ... }, path_sep)
return result
end
vim.opt.runtimepath = vim.env.VIMRUNTIME
vim.opt.completeopt = "menu"
local temp_dir = vim.loop.os_getenv "TEMP" or "/tmp"
vim.opt.packpath = join_paths(temp_dir, "nvim-lsp-installer-debug", "site")
local package_root = join_paths(temp_dir, "nvim-lsp-installer-debug", "site", "pack")
local install_path = join_paths(package_root, "packer", "start", "packer.nvim")
local compile_path = join_paths(install_path, "plugin", "packer_compiled.lua")
local function load_plugins()
require("packer").startup {
{
"wbthomason/packer.nvim",
"neovim/nvim-lspconfig",
"williamboman/nvim-lsp-installer",
"sheerun/vim-polyglot",
"purescript-contrib/purescript-vim",
},
config = {
package_root = package_root,
compile_path = compile_path,
},
}
end
function _G.load_config()
local lspconfig = require "lspconfig"
local function on_attach(client, bufnr)
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
end
require("nvim-lsp-installer").setup {
log = vim.log.levels.DEBUG,
}
-- ==================================================
-- ========= SETUP RELEVANT SERVER(S) HERE! =========
-- =================================================
--
-- lspconfig.sumneko_lua.setup { on_attach = on_attach }
lspconfig.jdtls.setup({on_attach = on_attach})
lspconfig.purescriptls.setup {}
end
if vim.fn.isdirectory(install_path) == 0 then
vim.fn.system { "git", "clone", "https://github.com/wbthomason/packer.nvim", install_path }
load_plugins()
require("packer").sync()
vim.cmd [[autocmd User PackerComplete ++once lua load_config()]]
else
load_plugins()
require("packer").sync()
_G.load_config()
end