mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-28 19:40:06 +02:00
treewide: Reformat with nixfmt
This commit is contained in:
parent
c6281260dc
commit
62f32bfc71
459 changed files with 28139 additions and 26377 deletions
|
@ -5,71 +5,55 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; {
|
||||
options.plugins.ts-context-commentstring =
|
||||
helpers.neovim-plugin.extraOptionsOptions
|
||||
// {
|
||||
enable = mkEnableOption "nvim-ts-context-commentstring";
|
||||
with lib;
|
||||
{
|
||||
options.plugins.ts-context-commentstring = helpers.neovim-plugin.extraOptionsOptions // {
|
||||
enable = mkEnableOption "nvim-ts-context-commentstring";
|
||||
|
||||
package =
|
||||
helpers.mkPackageOption
|
||||
"ts-context-commentstring"
|
||||
pkgs.vimPlugins.nvim-ts-context-commentstring;
|
||||
package = helpers.mkPackageOption "ts-context-commentstring" pkgs.vimPlugins.nvim-ts-context-commentstring;
|
||||
|
||||
skipTsContextCommentStringModule = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether to skip backwards compatibility routines and speed up loading.
|
||||
'';
|
||||
example = false;
|
||||
};
|
||||
|
||||
disableAutoInitialization = helpers.defaultNullOpts.mkBool false ''
|
||||
Whether to disable auto-initialization.
|
||||
skipTsContextCommentStringModule = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether to skip backwards compatibility routines and speed up loading.
|
||||
'';
|
||||
|
||||
languages =
|
||||
helpers.mkNullOrOption
|
||||
(
|
||||
with types;
|
||||
attrsOf
|
||||
(
|
||||
either
|
||||
str
|
||||
(attrsOf str)
|
||||
)
|
||||
)
|
||||
''
|
||||
Allows you to add support for more languages.
|
||||
|
||||
See `:h ts-context-commentstring-commentstring-configuration` for more information.
|
||||
'';
|
||||
example = false;
|
||||
};
|
||||
|
||||
config = let
|
||||
cfg = config.plugins.ts-context-commentstring;
|
||||
in
|
||||
disableAutoInitialization = helpers.defaultNullOpts.mkBool false ''
|
||||
Whether to disable auto-initialization.
|
||||
'';
|
||||
|
||||
languages = helpers.mkNullOrOption (with types; attrsOf (either str (attrsOf str))) ''
|
||||
Allows you to add support for more languages.
|
||||
|
||||
See `:h ts-context-commentstring-commentstring-configuration` for more information.
|
||||
'';
|
||||
};
|
||||
|
||||
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];
|
||||
extraPlugins = [ cfg.package ];
|
||||
|
||||
globals = with cfg; {
|
||||
skip_ts_context_commentstring_module = skipTsContextCommentStringModule;
|
||||
loaded_ts_context_commentstring = disableAutoInitialization;
|
||||
};
|
||||
|
||||
extraConfigLua = let
|
||||
setupOptions = with cfg;
|
||||
{
|
||||
inherit languages;
|
||||
}
|
||||
// cfg.extraOptions;
|
||||
in ''
|
||||
require('ts_context_commentstring').setup(${helpers.toLuaObject setupOptions})
|
||||
'';
|
||||
extraConfigLua =
|
||||
let
|
||||
setupOptions = with cfg; { inherit languages; } // cfg.extraOptions;
|
||||
in
|
||||
''
|
||||
require('ts_context_commentstring').setup(${helpers.toLuaObject setupOptions})
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue