Skip to content

Commit 6b78b96

Browse files
feat: run userconfig before init.lua and allow spec loading
1 parent 40e7110 commit 6b78b96

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

.luarc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
},
55

66
"diagnostics": {
7-
"globals": ["vim", "Snacks", "FROSTY_PACKAGES", "FROSTY_RUNTIMEPATHS"]
7+
"globals": ["vim", "Snacks", "FROSTY_USERCONFIG", "FROSTY_PACKAGES", "FROSTY_RUNTIMEPATHS"]
88
}
99
}
1010

flake.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@
6969
${lib.optionalString includeBlinkLib ''package.cpath = package.cpath .. ";${pkgs.vimPlugins.blink-cmp.blink-fuzzy-lib}/lib/lib?.so"''}
7070
FROSTY_PACKAGES="${packageList}"
7171
FROSTY_RUNTIMEPATHS={"${./.}", "${builtins.concatStringsSep "," treesitterParsers}"}
72-
dofile("${./.}/init.lua")
7372
${lib.optionalString allowUserConfigEnvVar ''
7473
local stat = vim.uv.fs_stat(vim.env.FROSTY_USERCONFIG or "")
7574
if stat and stat.type == "file" then
76-
dofile(vim.env.FROSTY_USERCONFIG)
75+
FROSTY_USERCONFIG = dofile(vim.env.FROSTY_USERCONFIG)
7776
end''}
77+
dofile("${./.}/init.lua")
7878
'';
7979
}))
8080
.overrideAttrs (old: {

init.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ require("lazy").setup {
4141
spec = {
4242
{ import = "plugins" },
4343
{ import = "languages" },
44+
FROSTY_USERCONFIG,
4445
},
4546

4647
defaults = {

0 commit comments

Comments
 (0)