mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-24 01:38:40 +02:00
plugins/ts-context-commentstring: init + test
This commit is contained in:
parent
eb6b49b396
commit
8f00594b25
3 changed files with 48 additions and 0 deletions
|
@ -44,6 +44,7 @@
|
||||||
./languages/treesitter/treesitter-rainbow.nix
|
./languages/treesitter/treesitter-rainbow.nix
|
||||||
./languages/treesitter/treesitter-refactor.nix
|
./languages/treesitter/treesitter-refactor.nix
|
||||||
./languages/treesitter/ts-autotag.nix
|
./languages/treesitter/ts-autotag.nix
|
||||||
|
./languages/treesitter/ts-context-commentstring.nix
|
||||||
./languages/typst/typst-vim.nix
|
./languages/typst/typst-vim.nix
|
||||||
./languages/vim-slime.nix
|
./languages/vim-slime.nix
|
||||||
./languages/vimtex.nix
|
./languages/vimtex.nix
|
||||||
|
|
37
plugins/languages/treesitter/ts-context-commentstring.nix
Normal file
37
plugins/languages/treesitter/ts-context-commentstring.nix
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
helpers = import ../../helpers.nix {inherit lib;};
|
||||||
|
in {
|
||||||
|
options.plugins.ts-context-commentstring =
|
||||||
|
helpers.extraOptionsOptions
|
||||||
|
// {
|
||||||
|
enable = mkEnableOption "nvim-ts-context-commentstring";
|
||||||
|
|
||||||
|
package =
|
||||||
|
helpers.mkPackageOption
|
||||||
|
"ts-context-commentstring"
|
||||||
|
pkgs.vimPlugins.nvim-ts-context-commentstring;
|
||||||
|
};
|
||||||
|
|
||||||
|
config = let
|
||||||
|
cfg = config.plugins.ts-context-commentstring;
|
||||||
|
in
|
||||||
|
mkIf cfg.enable {
|
||||||
|
warnings = mkIf (!config.plugins.treesitter.enable) [
|
||||||
|
"Nixvim: ts-context-commentstring needs treesitter to function as intended"
|
||||||
|
];
|
||||||
|
|
||||||
|
extraPlugins = [cfg.package];
|
||||||
|
|
||||||
|
plugins.treesitter.moduleConfig.context_commentstring =
|
||||||
|
{
|
||||||
|
enable = true;
|
||||||
|
}
|
||||||
|
// cfg.extraOptions;
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
empty = {
|
||||||
|
plugins = {
|
||||||
|
treesitter.enable = true;
|
||||||
|
ts-context-commentstring.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# This plugin has no option
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue