nix-community.nixvim/plugins/by-name/autoclose/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

62 lines
1.8 KiB
Nix
Raw Normal View History

2024-02-03 05:33:10 -06:00
{
lib,
...
}:
let
inherit (lib.nixvim) defaultNullOpts mkNullOrOption;
inherit (lib) types;
2024-02-03 05:33:10 -06:00
in
lib.nixvim.plugins.mkNeovimPlugin {
name = "autoclose";
packPathName = "autoclose.nvim";
package = "autoclose-nvim";
2024-02-03 12:45:00 +01:00
maintainers = [ lib.maintainers.GaetanLepage ];
2024-02-03 12:45:00 +01:00
description = ''
Automatically close pairs in Neovim.
'';
2024-02-03 12:45:00 +01:00
settingsOptions = {
keys = mkNullOrOption (types.attrsOf types.anything) ''
Configures various options, such as shortcuts for pairs, what pair of characters to use in the shortcut, etc.
2024-02-03 12:45:00 +01:00
'';
2024-02-03 05:33:10 -06:00
options = {
disabled_filetypes = defaultNullOpts.mkListOf types.str [ "text" ] ''
2024-02-03 05:33:10 -06:00
The plugin will be disabled under the filetypes in this table.
'';
disable_when_touch = defaultNullOpts.mkBool false ''
Set this to true will disable the auto-close function when the cursor touches character that matches touch_regex.
2024-02-03 12:45:00 +01:00
'';
touch_regex = defaultNullOpts.mkStr "[%w(%[{]" ''
Regex to use in combination with `disable_when_touch`.
2024-02-03 12:45:00 +01:00
'';
pair_spaces = defaultNullOpts.mkBool false ''
2024-02-03 12:45:00 +01:00
Pair the spaces when cursor is inside a pair of keys.
'';
auto_indent = defaultNullOpts.mkBool true ''
2024-02-03 12:45:00 +01:00
Enable auto-indent feature.
'';
disable_command_mode = defaultNullOpts.mkBool false ''
2024-02-03 12:45:00 +01:00
Disable autoclose for command mode globally.
'';
2024-02-03 05:33:10 -06:00
};
};
settingsExample = {
settings = {
options = {
disabled_filetypes = [ "text" ];
disable_when_touch = false;
touch_regex = "[%w(%[{]";
pair_spaces = false;
auto_indent = true;
disable_command_mode = false;
};
};
2024-02-03 05:33:10 -06:00
};
# TODO: Deprecated in 2025-01-31
inherit (import ./deprecations.nix) deprecateExtraOptions optionsRenamedToSettings;
2024-02-03 05:33:10 -06:00
}