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