mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-12-20 10:51:17 +00:00
treewide: migrate to pluginRC for correct DAG order
The "new" DAG order is as follows: - (luaConfigPre) - globalsScript - basic - theme - pluginConfigs - extraPluginConfigs - mappings - (luaConfigPost)
This commit is contained in:
parent
20a7751e2a
commit
a0197fe1bb
67 changed files with 101 additions and 87 deletions
|
|
@ -86,6 +86,18 @@ in {
|
|||
mapAttrsFlatten (name: value: "vim.g.${name} = ${toLuaObject value}")
|
||||
(filterNonNull cfg.globals);
|
||||
|
||||
extraPluginConfigs = resolveDag {
|
||||
name = "extra plugin configs";
|
||||
dag = mapAttrs (_: value: entryAfter value.after value.setup) cfg.extraPlugins;
|
||||
mapResult = result: concatLines (map mkLuarcSection result);
|
||||
};
|
||||
|
||||
pluginConfigs = resolveDag {
|
||||
name = "plugin configs";
|
||||
dag = cfg.pluginRC;
|
||||
mapResult = result: concatLines (map mkLuarcSection result);
|
||||
};
|
||||
|
||||
toLuaBindings = mode: maps:
|
||||
map (value: ''
|
||||
vim.keymap.set(${toLuaObject mode}, ${toLuaObject value.key}, ${toLuaObject value.action}, ${toLuaObject value.config})
|
||||
|
|
@ -104,12 +116,6 @@ in {
|
|||
omap = toLuaBindings "o" config.vim.maps.operator;
|
||||
icmap = toLuaBindings "ic" config.vim.maps.insertCommand;
|
||||
|
||||
extraPluginConfigs = resolveDag {
|
||||
name = "extra plugins config";
|
||||
dag = mapAttrs (_: value: entryAfter value.after value.setup) cfg.extraPlugins;
|
||||
mapResult = result: concatLines (map mkLuarcSection result);
|
||||
};
|
||||
|
||||
maps = [
|
||||
nmap
|
||||
imap
|
||||
|
|
@ -128,6 +134,11 @@ in {
|
|||
vim = {
|
||||
luaConfigRC = {
|
||||
globalsScript = concatLines globalsScript;
|
||||
# basic comes after globalsScript,
|
||||
# but it's defined modules/neovim/init/basic.nix
|
||||
pluginConfigs = entryAfter ["basic"] pluginConfigs;
|
||||
extraPluginConfigs = entryAfter ["pluginConfigs"] extraPluginConfigs;
|
||||
mappings = entryAfter ["extraPluginConfigs"] mappings;
|
||||
};
|
||||
|
||||
builtLuaConfigRC = let
|
||||
|
|
@ -145,11 +156,7 @@ in {
|
|||
mapResult = result:
|
||||
concatLines [
|
||||
cfg.luaConfigPre
|
||||
|
||||
(concatMapStringsSep "\n" mkLuarcSection result)
|
||||
extraPluginConfigs
|
||||
mappings
|
||||
|
||||
cfg.luaConfigPost
|
||||
];
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue