-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.lua
More file actions
45 lines (38 loc) · 916 Bytes
/
utils.lua
File metadata and controls
45 lines (38 loc) · 916 Bytes
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
local M = {}
M.ensure_treesitter_parsers = function(parsers)
return {
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
if not opts.ensure_installed then
opts.ensure_installed = {}
elseif opts.ensure_installed == "all" then
return
end
table.insert(opts.ensure_installed, parsers)
end,
}
end
M.ensure_lsps = function(lsps)
return {
"williamboman/mason-lspconfig.nvim",
opts = function(_, opts)
if not opts.ensure_installed then
opts.ensure_installed = {}
end
vim.list_extend(opts.ensure_installed, lsps)
end,
}
end
M.add_cmp_source = function(plugin, source_config)
return {
"hrsh7th/nvim-cmp",
dependencies = { plugin },
opts = function(_, opts)
if not opts.sources then
opts.sources = {}
end
table.insert(opts.sources, source_config)
end,
}
end
return M