neovim-flake/modules/plugins/treesitter/ts-context/config.nix
diniamo a0197fe1bb treewide: migrate to pluginRC for correct DAG order
The "new" DAG order is as follows:
- (luaConfigPre)
- globalsScript
- basic
- theme
- pluginConfigs
- extraPluginConfigs
- mappings
- (luaConfigPost)
2024-07-18 10:25:58 +02:00

24 lines
611 B
Nix

{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.lua) toLuaObject;
inherit (lib.nvim.dag) entryAfter;
inherit (config.vim) treesitter;
cfg = treesitter.context;
in {
config = mkIf (treesitter.enable && cfg.enable) {
vim = {
startPlugins = ["nvim-treesitter-context"];
# set up treesitter-context after Treesitter. The ordering
# should not matter, but there is no harm in doing this
pluginRC.treesitter-context = entryAfter ["treesitter"] ''
require("treesitter-context").setup(${toLuaObject cfg.setupOpts})
'';
};
};
}