-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
75 lines (75 loc) · 2.45 KB
/
Copy pathinit.lua
File metadata and controls
75 lines (75 loc) · 2.45 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
69
70
71
72
73
74
75
-- [nfnl] init.fnl
vim.loader.enable()
vim.g.nix_info_plugin_name = (vim.g.nix_info_plugin_name or "__NOT_NIX__")
do
local ok, nixInfo = pcall(require, vim.g.nix_info_plugin_name)
_G.nixInfo = nixInfo
if not ok then
local function _1_(_, default)
return default
end
package.loaded[vim.g.nix_info_plugin_name] = setmetatable({}, { __call = _1_ })
_G.nixInfo = require(vim.g.nix_info_plugin_name)
else
end
end
_G.nixInfo.isNix = (vim.g.nix_info_plugin_name ~= nil)
_G.nixInfo.lze = setmetatable(require("lze"), getmetatable(require("lzextras")))
_G.nixInfo.get_nix_plugin_path = function(name)
return (_G.nixInfo(nil, "plugins", "lazy", name) or _G.nixInfo(nil, "plugins", "start", name))
end
local function _3_(plugin)
if vim.g.nix_info_plugin_name then
local case_4_ = type(plugin.auto_enable)
if case_4_ == "table" then
for _, name in pairs(plugin.auto_enable) do
if not _G.nixInfo.get_nix_plugin_path(name) then
plugin.enabled = false
else
end
end
elseif case_4_ == "string" then
if not _G.nixInfo.get_nix_plugin_path(plugin.auto_enable) then
plugin.enabled = false
else
end
else
local and_7_ = (case_4_ == "boolean")
if and_7_ then
and_7_ = plugin.auto_enable
end
if and_7_ then
if not _G.nixInfo.get_nix_plugin_path(plugin.name) then
plugin.enabled = false
else
end
else
end
end
else
end
return plugin
end
local function _12_(plugin)
if vim.g.nix_info_plugin_name and (type(plugin.for_cat) == "string") then
plugin.enabled = _G.nixInfo(false, "settings", "cats", plugin.for_cat)
else
end
return plugin
end
_G.nixInfo.lze.register_handlers({
{ spec_field = "auto_enable", modify = _3_, set_lazy = false },
{ spec_field = "for_cat", modify = _12_, set_lazy = false },
_G.nixInfo.lze.lsp,
})
local function _14_(name)
local lspcfg = _G.nixInfo.get_nix_plugin_path("nvim-lspconfig")
if lspcfg then
local ok, config = pcall(dofile, (lspcfg .. "/lsp/" .. name .. ".lua"))
return ((ok and (config or {})).filetypes or {})
else
return nil
end
end
_G.nixInfo.lze.h.lsp.set_ft_fallback(_14_)
return require("config")