mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-07 02:41:33 +00:00
wrapper/rc: add vim.additionaLuafiles
Allows the user to specify a list of lua files that will be called via `luafile`. All paths that are passed to this option are checked by `builtins.isPath` so attempting to source paths that do not exist do not result in a broken Lua configuration.
This commit is contained in:
parent
7c1a8e2c1e
commit
407ecf00d5
3 changed files with 57 additions and 9 deletions
|
@ -133,6 +133,14 @@ in {
|
|||
configRC = {
|
||||
globalsScript = entryAnywhere (concatStringsSep "\n" globalsScript);
|
||||
|
||||
# Call additional lua files with :luafile in Vimscript
|
||||
# section of the configuration, only after
|
||||
# the luaScript section has been evaluated
|
||||
extraLuaFiles = let
|
||||
callLuaFiles = map (file: "luafile ${file}") cfg.extraLuaFiles;
|
||||
in
|
||||
entryAfter ["globalScript"] (concatStringsSep "\n" callLuaFiles);
|
||||
|
||||
# wrap the lua config in a lua block
|
||||
# using the wrapLuaConfic function from the lib
|
||||
luaScript = let
|
||||
|
@ -148,7 +156,7 @@ in {
|
|||
inherit mapResult;
|
||||
};
|
||||
in
|
||||
entryAfter ["globalsScript"] luaConfig;
|
||||
entryAnywhere luaConfig;
|
||||
|
||||
extraPluginConfigs = let
|
||||
mapResult = result: (wrapLuaConfig {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue