2024-04-23 13:08:36 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit (lib.modules) mkIf;
|
2024-04-28 17:19:25 +00:00
|
|
|
inherit (lib.nvim.lua) toLuaObject;
|
2024-04-23 13:08:36 +00:00
|
|
|
inherit (lib.nvim.dag) entryAfter;
|
|
|
|
|
|
|
|
inherit (config.vim) treesitter;
|
|
|
|
cfg = treesitter.context;
|
|
|
|
in {
|
|
|
|
config = mkIf (treesitter.enable && cfg.enable) {
|
2024-04-28 17:19:25 +00:00
|
|
|
vim = {
|
|
|
|
startPlugins = ["nvim-treesitter-context"];
|
2024-04-23 13:08:36 +00:00
|
|
|
|
2024-04-28 17:19:25 +00:00
|
|
|
# set up treesitter-context after Treesitter. The ordering
|
|
|
|
# should not matter, but there is no harm in doing this
|
2024-07-20 08:30:48 +00:00
|
|
|
pluginRC.treesitter-context = entryAfter ["treesitter"] ''
|
2024-04-28 17:19:25 +00:00
|
|
|
require("treesitter-context").setup(${toLuaObject cfg.setupOpts})
|
|
|
|
'';
|
|
|
|
};
|
2024-04-23 13:08:36 +00:00
|
|
|
};
|
|
|
|
}
|