mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
plugins/lexima: init
This commit is contained in:
parent
1a5f1b4393
commit
2f5374c3dc
3 changed files with 104 additions and 0 deletions
17
plugins/by-name/lexima/default.nix
Normal file
17
plugins/by-name/lexima/default.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{ lib, ... }:
|
||||||
|
lib.nixvim.plugins.mkVimPlugin {
|
||||||
|
name = "lexima";
|
||||||
|
packPathName = "lexima.vim";
|
||||||
|
package = "lexima-vim";
|
||||||
|
globalPrefix = "lexima_";
|
||||||
|
|
||||||
|
maintainers = [ lib.maintainers.GaetanLepage ];
|
||||||
|
|
||||||
|
settingsOptions = import ./settings-options.nix lib;
|
||||||
|
|
||||||
|
settingsExample = {
|
||||||
|
map_escape = "";
|
||||||
|
enable_space_rules = 0;
|
||||||
|
enable_endwise_rules = 0;
|
||||||
|
};
|
||||||
|
}
|
51
plugins/by-name/lexima/settings-options.nix
Normal file
51
plugins/by-name/lexima/settings-options.nix
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
lib:
|
||||||
|
let
|
||||||
|
inherit (lib.nixvim) defaultNullOpts;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
no_default_rules = defaultNullOpts.mkFlagInt 0 ''
|
||||||
|
Whether to disable the default rules.
|
||||||
|
|
||||||
|
You can explicitly set default rules by calling `|lexima#set_default_rules()|`.
|
||||||
|
'';
|
||||||
|
|
||||||
|
map_escape = defaultNullOpts.mkStr "<Esc>" ''
|
||||||
|
lexima.vim defines a insert mode mapping to `<Esc>` by default.
|
||||||
|
|
||||||
|
If you don't want to map `<Esc>`, set this variable to another left-hand-side, or `""` to not
|
||||||
|
create a default mapping to `|lexima#insmode#escape()|`.
|
||||||
|
'';
|
||||||
|
|
||||||
|
enable_basic_rules = defaultNullOpts.mkFlagInt 1 ''
|
||||||
|
Whether to enable `|lexima-basic-rules|` by default.
|
||||||
|
'';
|
||||||
|
|
||||||
|
enable_newline_rules = defaultNullOpts.mkFlagInt 1 ''
|
||||||
|
Whether to enable `|lexima-newline-rules|` by default.
|
||||||
|
'';
|
||||||
|
|
||||||
|
enable_space_rules = defaultNullOpts.mkFlagInt 1 ''
|
||||||
|
Whether to enable `|lexima-space-rules|` by default.
|
||||||
|
'';
|
||||||
|
|
||||||
|
enable_endwise_rules = defaultNullOpts.mkFlagInt 1 ''
|
||||||
|
Whether to enable `|lexima-endwise-rules|` by default.
|
||||||
|
'';
|
||||||
|
|
||||||
|
accept_pum_with_enter = defaultNullOpts.mkFlagInt 1 ''
|
||||||
|
Whether `<cr>` can be used to accept completions when the `|popup-menu|` is visible.
|
||||||
|
'';
|
||||||
|
|
||||||
|
ctrlh_as_backspace = defaultNullOpts.mkFlagInt 0 ''
|
||||||
|
Whether `<C-h>` should be usable in the same manner as `<BS>`.
|
||||||
|
'';
|
||||||
|
|
||||||
|
disable_on_nofile = defaultNullOpts.mkFlagInt 0 ''
|
||||||
|
Whether to disable all lexima rules on `buftype=nofile`.
|
||||||
|
'';
|
||||||
|
|
||||||
|
disable_abbrev_trigger = defaultNullOpts.mkFlagInt 0 ''
|
||||||
|
By default, lexima inputs `<C-]>` to expand an abbreviation.
|
||||||
|
Set this option to `1` to disable this behavior.
|
||||||
|
'';
|
||||||
|
}
|
36
tests/test-sources/plugins/by-name/lexima/default.nix
Normal file
36
tests/test-sources/plugins/by-name/lexima/default.nix
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
{
|
||||||
|
empty = {
|
||||||
|
plugins.lexima.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
defaults = {
|
||||||
|
plugins.lexima = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
no_default_rules = 0;
|
||||||
|
map_escape = "<Esc>";
|
||||||
|
enable_basic_rules = 1;
|
||||||
|
enable_newline_rules = 1;
|
||||||
|
enable_space_rules = 1;
|
||||||
|
enable_endwise_rules = 1;
|
||||||
|
accept_pum_with_enter = 1;
|
||||||
|
ctrlh_as_backspace = 0;
|
||||||
|
disable_on_nofile = 0;
|
||||||
|
disable_abbrev_trigger = 0;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
example = {
|
||||||
|
plugins.lexima = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
map_escape = "";
|
||||||
|
enable_space_rules = 0;
|
||||||
|
enable_endwise_rules = 0;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue