-
-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
plugins/easyescape: switch to mkVimPlugin and add options
- Loading branch information
1 parent
a658e81
commit cb61e12
Showing
2 changed files
with
58 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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_"; | ||
|
||
maintainers = [ lib.maintainers.GaetanLepage ]; | ||
|
||
package = lib.mkPackageOption pkgs "easyescape" { | ||
default = [ | ||
"vimPlugins" | ||
"vim-easyescape" | ||
]; | ||
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 ]; }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters