mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 18:31:35 +00:00
plugins/treesitter: move nvim-treesitter-context to its own dir
This commit is contained in:
parent
2680be20a3
commit
495e7620d2
3 changed files with 97 additions and 0 deletions
31
modules/plugins/treesitter/ts-context/config.nix
Normal file
31
modules/plugins/treesitter/ts-context/config.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.trivial) boolToString;
|
||||
inherit (lib.nvim.lua) nullString;
|
||||
inherit (lib.nvim.dag) entryAfter;
|
||||
|
||||
inherit (config.vim) treesitter;
|
||||
cfg = treesitter.context;
|
||||
in {
|
||||
config = mkIf (treesitter.enable && cfg.enable) {
|
||||
vim.startPlugins = ["nvim-treesitter-context"];
|
||||
|
||||
vim.luaConfigRC.treesitter-context = entryAfter ["treesitter"] ''
|
||||
require'treesitter-context'.setup {
|
||||
enable = true,
|
||||
max_lines = ${toString cfg.maxLines},
|
||||
min_window_height = ${toString cfg.minWindowHeight},
|
||||
line_numbers = ${boolToString cfg.lineNumbers},
|
||||
multiline_threshold = ${toString cfg.multilineThreshold},
|
||||
trim_scope = '${cfg.trimScope}',
|
||||
mode = '${cfg.mode}',
|
||||
separator = ${nullString cfg.separator},
|
||||
max_lines = ${toString cfg.zindex},
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue