nix-community.nixvim/plugins/by-name/vim-slime/default.nix

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

106 lines
2.6 KiB
Nix
Raw Permalink Normal View History

2023-05-30 17:20:08 +02:00
{
lib,
helpers,
2023-05-30 17:20:08 +02:00
...
}:
with lib;
2024-12-22 09:58:27 +00:00
with lib.nixvim.plugins;
mkVimPlugin {
name = "vim-slime";
globalPrefix = "slime_";
maintainers = [ maintainers.GaetanLepage ];
# TODO introduced 2024-03-02: remove 2024-05-02
deprecateExtraConfig = true;
optionsRenamedToSettings = [
"target"
"vimterminalCmd"
"noMappings"
"pasteFile"
"preserveCurpos"
"defaultConfig"
"dontAskDefault"
"bracketedPaste"
];
settingsOptions = {
target = helpers.defaultNullOpts.mkEnum [
"dtach"
"kitty"
"neovim"
"screen"
"tmux"
"vimterminal"
"wezterm"
"whimrepl"
"x11"
"zellij"
] "screen" "Which backend vim-slime should use.";
vimterminal_cmd = helpers.mkNullOrStr ''
The vim terminal command to execute.
'';
2024-09-08 13:52:18 +01:00
no_mappings = helpers.defaultNullOpts.mkFlagInt 0 ''
Whether to disable the default mappings.
'';
paste_file = helpers.defaultNullOpts.mkStr "$HOME/.slime_paste" ''
Required to transfer data from vim to GNU screen or tmux.
Setting this explicitly can work around some occasional portability issues.
whimrepl does not require or support this setting.
'';
2024-09-08 13:52:18 +01:00
preserve_curpos = helpers.defaultNullOpts.mkFlagInt 1 ''
Whether to preserve cursor position when sending a line or paragraph.
'';
2024-09-27 08:07:20 +01:00
default_config = helpers.mkNullOrOption (with lib.types; attrsOf (either str rawLua)) ''
Pre-filled prompt answer.
Examples:
- `tmux`:
```nix
{
socket_name = "default";
target_pane = "{last}";
}
```
- `zellij`:
```nix
{
session_id = "current";
relative_pane = "right";
}
```
'';
2024-09-08 13:52:18 +01:00
dont_ask_default = helpers.defaultNullOpts.mkFlagInt 0 ''
Whether to bypass the prompt and use the specified default configuration options.
'';
2024-09-08 13:52:18 +01:00
bracketed_paste = helpers.defaultNullOpts.mkFlagInt 0 ''
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.
In this case it can be useful to rely on bracketed-paste
(https://cirw.in/blog/bracketed-paste).
Luckily, tmux knows how to handle that. See tmux's manual.
'';
};
settingsExample = {
target = "screen";
vimterminal_cmd = null;
2024-09-08 13:52:18 +01:00
no_mappings = 0;
paste_file = "$HOME/.slime_paste";
2024-09-08 13:52:18 +01:00
preserve_curpos = 1;
default_config = {
socket_name = "default";
target_pane = "{last}";
};
2024-09-08 13:52:18 +01:00
dont_ask_default = 0;
bracketed_paste = 0;
2024-05-05 19:39:35 +02:00
};
}