nix-community.nixvim/tests/test-sources/plugins/utils/comment.nix
2024-03-25 11:28:50 +01:00

61 lines
1.2 KiB
Nix

{
empty = {
plugins.comment.enable = true;
};
defaults = {
plugins.comment = {
enable = true;
settings = {
padding = true;
sticky = true;
ignore = null;
toggler = {
line = "gcc";
block = "gbc";
};
opleader = {
line = "gc";
block = "gb";
};
extra = {
above = "gcO";
below = "gco";
eol = "gcA";
};
mappings = {
basic = true;
extra = true;
};
pre_hook = null;
post_hook = null;
};
};
};
example = {
plugins = {
treesitter.enable = true;
ts-context-commentstring.enable = true;
comment = {
enable = true;
settings = {
ignore = "^const(.*)=(%s?)%((.*)%)(%s?)=>";
pre_hook = "require('ts_context_commentstring.integrations.comment_nvim').create_pre_hook()";
post_hook = ''
function(ctx)
if ctx.range.srow == ctx.range.erow then
-- do something with the current line
else
-- do something with lines range
end
end
'';
};
};
};
};
}