mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
plugins/easyescape: switch to mkVimPlugin and add options
This commit is contained in:
parent
a658e81d71
commit
cb61e12bba
2 changed files with 58 additions and 15 deletions
|
@ -1,26 +1,44 @@
|
|||
{
|
||||
lib,
|
||||
helpers,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.plugins.easyescape;
|
||||
inherit (lib.nixvim) defaultNullOpts;
|
||||
inherit (lib) types;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
plugins.easyescape = {
|
||||
enable = mkEnableOption "easyescape";
|
||||
lib.nixvim.vim-plugin.mkVimPlugin {
|
||||
name = "easyescape";
|
||||
packPathName = "vim-easyescape";
|
||||
package = "vim-easyescape";
|
||||
globalPrefix = "easyescape_";
|
||||
|
||||
package = lib.mkPackageOption pkgs "easyescape" {
|
||||
default = [
|
||||
"vimPlugins"
|
||||
"vim-easyescape"
|
||||
];
|
||||
maintainers = [ lib.maintainers.GaetanLepage ];
|
||||
|
||||
settingsOptions = {
|
||||
chars = defaultNullOpts.mkAttrsOf' {
|
||||
type = types.ints.unsigned;
|
||||
pluginDefault = {
|
||||
j = 1;
|
||||
k = 1;
|
||||
};
|
||||
example = {
|
||||
j = 2;
|
||||
};
|
||||
description = ''
|
||||
Which keys can be used to escape insert mode and how many times they need to be pressed.
|
||||
'';
|
||||
};
|
||||
|
||||
timeout = defaultNullOpts.mkUnsignedInt 100 ''
|
||||
The unit of timeout is in ms.
|
||||
|
||||
A very small timeout makes an input of real `jk` or `kj` possible (Python3 is required for
|
||||
this feature)!
|
||||
'';
|
||||
};
|
||||
|
||||
settingsExample = {
|
||||
chars.j = 2;
|
||||
timeout = 2000;
|
||||
};
|
||||
config = mkIf cfg.enable { extraPlugins = [ cfg.package ]; };
|
||||
}
|
||||
|
|
|
@ -2,4 +2,29 @@
|
|||
empty = {
|
||||
plugins.easyescape.enable = true;
|
||||
};
|
||||
|
||||
defaults = {
|
||||
plugins.easyescape = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
chars = {
|
||||
j = 1;
|
||||
k = 1;
|
||||
};
|
||||
timeout = 100;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
example = {
|
||||
plugins.easyescape = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
chars.j = 2;
|
||||
timeout = 2000;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue