-
-
Notifications
You must be signed in to change notification settings - Fork 213
/
vim-slime.nix
108 lines (96 loc) · 2.72 KB
/
vim-slime.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
{
lib,
config,
helpers,
pkgs,
...
}:
with lib;
with helpers.vim-plugin;
mkVimPlugin config {
name = "vim-slime";
defaultPackage = pkgs.vimPlugins.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.
'';
no_mappings = helpers.defaultNullOpts.mkBool false ''
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.
'';
preserve_curpos = helpers.defaultNullOpts.mkBool true ''
Whether to preserve cursor position when sending a line or paragraph.
'';
default_config = helpers.mkNullOrOption (with helpers.nixvimTypes; 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";
}
```
'';
dont_ask_default = helpers.defaultNullOpts.mkBool false ''
Whether to bypass the prompt and use the specified default configuration options.
'';
bracketed_paste = helpers.defaultNullOpts.mkBool false ''
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;
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;
};
}