mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-23 17:28:39 +02:00
plugins/vim-slime: switch to settings option
This commit is contained in:
parent
740b59c1f1
commit
7e33553fc3
2 changed files with 79 additions and 86 deletions
|
@ -11,11 +11,24 @@ with helpers.vim-plugin;
|
||||||
name = "vim-slime";
|
name = "vim-slime";
|
||||||
defaultPackage = pkgs.vimPlugins.vim-slime;
|
defaultPackage = pkgs.vimPlugins.vim-slime;
|
||||||
globalPrefix = "slime_";
|
globalPrefix = "slime_";
|
||||||
deprecateExtraConfig = true;
|
|
||||||
|
|
||||||
options = {
|
# TODO introduced 2024-03-02: remove 2024-05-02
|
||||||
target = mkDefaultOpt {
|
deprecateExtraConfig = true;
|
||||||
type = types.enum [
|
optionsRenamedToSettings = [
|
||||||
|
"target"
|
||||||
|
"vimterminalCmd"
|
||||||
|
"noMappings"
|
||||||
|
"pasteFile"
|
||||||
|
"preserveCurpos"
|
||||||
|
"defaultConfig"
|
||||||
|
"dontAskDefault"
|
||||||
|
"bracketedPaste"
|
||||||
|
];
|
||||||
|
|
||||||
|
settingsOptions = {
|
||||||
|
target =
|
||||||
|
helpers.defaultNullOpts.mkEnum
|
||||||
|
[
|
||||||
"dtach"
|
"dtach"
|
||||||
"kitty"
|
"kitty"
|
||||||
"neovim"
|
"neovim"
|
||||||
|
@ -26,61 +39,38 @@ with helpers.vim-plugin;
|
||||||
"whimrepl"
|
"whimrepl"
|
||||||
"x11"
|
"x11"
|
||||||
"zellij"
|
"zellij"
|
||||||
];
|
]
|
||||||
description = ''
|
"screen"
|
||||||
Which backend vim-slime should use.
|
"Which backend vim-slime should use.";
|
||||||
|
|
||||||
Default: "screen"
|
vimterminal_cmd = helpers.mkNullOrStr ''
|
||||||
|
The vim terminal command to execute.
|
||||||
'';
|
'';
|
||||||
example = "dtach";
|
|
||||||
};
|
|
||||||
|
|
||||||
vimterminalCmd = mkDefaultOpt {
|
no_mappings = helpers.defaultNullOpts.mkBool false ''
|
||||||
global = "vimterminal_cmd";
|
|
||||||
type = types.str;
|
|
||||||
description = "The vim terminal command to execute.";
|
|
||||||
};
|
|
||||||
|
|
||||||
noMappings = mkDefaultOpt {
|
|
||||||
global = "no_mappings";
|
|
||||||
type = types.bool;
|
|
||||||
description = ''
|
|
||||||
Whether to disable the default mappings.
|
Whether to disable the default mappings.
|
||||||
|
|
||||||
Default: `false`
|
|
||||||
'';
|
'';
|
||||||
};
|
|
||||||
|
|
||||||
pasteFile = mkDefaultOpt {
|
paste_file = helpers.defaultNullOpts.mkStr "$HOME/.slime_paste" ''
|
||||||
global = "paste_file";
|
|
||||||
type = types.str;
|
|
||||||
description = ''
|
|
||||||
Required to transfer data from vim to GNU screen or tmux.
|
Required to transfer data from vim to GNU screen or tmux.
|
||||||
Setting this explicitly can work around some occasional portability issues.
|
Setting this explicitly can work around some occasional portability issues.
|
||||||
whimrepl does not require or support this setting.
|
whimrepl does not require or support this setting.
|
||||||
|
|
||||||
Default: "$HOME/.slime_paste"
|
|
||||||
'';
|
'';
|
||||||
};
|
|
||||||
|
|
||||||
preserveCurpos = mkDefaultOpt {
|
preserve_curpos = helpers.defaultNullOpts.mkBool true ''
|
||||||
global = "preserve_curpos";
|
|
||||||
type = types.bool;
|
|
||||||
description = ''
|
|
||||||
Whether to preserve cursor position when sending a line or paragraph.
|
Whether to preserve cursor position when sending a line or paragraph.
|
||||||
|
|
||||||
Default: `true`
|
|
||||||
'';
|
'';
|
||||||
};
|
|
||||||
|
|
||||||
defaultConfig = mkDefaultOpt {
|
default_config =
|
||||||
global = "default_config";
|
helpers.mkNullOrOption
|
||||||
type = with helpers.nixvimTypes; attrsOf (either str rawLua);
|
(
|
||||||
description = ''
|
with helpers.nixvimTypes;
|
||||||
|
attrsOf
|
||||||
|
(either str rawLua)
|
||||||
|
)
|
||||||
|
''
|
||||||
Pre-filled prompt answer.
|
Pre-filled prompt answer.
|
||||||
|
|
||||||
Default: `null`
|
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
- `tmux`:
|
- `tmux`:
|
||||||
```nix
|
```nix
|
||||||
|
@ -97,30 +87,31 @@ with helpers.vim-plugin;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
'';
|
'';
|
||||||
};
|
|
||||||
|
|
||||||
dontAskDefault = mkDefaultOpt {
|
dont_ask_default = helpers.defaultNullOpts.mkBool false ''
|
||||||
global = "dont_ask_default";
|
|
||||||
type = types.bool;
|
|
||||||
description = ''
|
|
||||||
Whether to bypass the prompt and use the specified default configuration options.
|
Whether to bypass the prompt and use the specified default configuration options.
|
||||||
|
|
||||||
Default: `false`
|
|
||||||
'';
|
'';
|
||||||
};
|
|
||||||
|
|
||||||
bracketedPaste = mkDefaultOpt {
|
bracketed_paste = helpers.defaultNullOpts.mkBool false ''
|
||||||
global = "bracketed_paste";
|
|
||||||
type = with types; nullOr bool;
|
|
||||||
description = ''
|
|
||||||
Sometimes REPL are too smart for their own good, e.g. autocompleting a bracket that should
|
Sometimes REPL are too smart for their own good, e.g. autocompleting a bracket that should
|
||||||
not be autocompleted when pasting code from a file.
|
not be autocompleted when pasting code from a file.
|
||||||
In this case it can be useful to rely on bracketed-paste
|
In this case it can be useful to rely on bracketed-paste
|
||||||
(https://cirw.in/blog/bracketed-paste).
|
(https://cirw.in/blog/bracketed-paste).
|
||||||
Luckily, tmux knows how to handle that. See tmux's manual.
|
Luckily, tmux knows how to handle that. See tmux's manual.
|
||||||
|
|
||||||
Default: `false`
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
settingsExample = {
|
||||||
|
target = "screen";
|
||||||
|
vimterminal_cmd = null;
|
||||||
|
no_mappings = false;
|
||||||
|
paste_file = "$HOME/.slime_paste";
|
||||||
|
preserve_curpos = true;
|
||||||
|
default_config = {
|
||||||
|
socket_name = "default";
|
||||||
|
target_pane = "{last}";
|
||||||
|
};
|
||||||
|
dont_ask_default = false;
|
||||||
|
bracketed_paste = false;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,17 +7,19 @@
|
||||||
plugins.vim-slime = {
|
plugins.vim-slime = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
target = "screen";
|
target = "screen";
|
||||||
vimterminalCmd = null;
|
vimterminal_cmd = null;
|
||||||
noMappings = false;
|
no_mappings = false;
|
||||||
pasteFile = "$HOME/.slime_paste";
|
paste_file = "$HOME/.slime_paste";
|
||||||
preserveCurpos = true;
|
preserve_curpos = true;
|
||||||
defaultConfig = {
|
default_config = {
|
||||||
socket_name = "default";
|
socket_name = "default";
|
||||||
target_pane = "{last}";
|
target_pane = "{last}";
|
||||||
};
|
};
|
||||||
dontAskDefault = false;
|
dont_ask_default = false;
|
||||||
bracketedPaste = false;
|
bracketed_paste = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue