mirror of
https://github.com/nix-community/nixvim.git
synced 2025-11-08 19:46:06 +01:00
plugins/molten: cleanup, remove settings declarations
Signed-off-by: saygo-png <saygo.mail@proton.me>
This commit is contained in:
parent
249491293d
commit
345eab65b3
1 changed files with 6 additions and 162 deletions
|
|
@ -1,171 +1,15 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
helpers,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib;
|
lib.nixvim.plugins.mkVimPlugin {
|
||||||
with lib.nixvim.plugins;
|
|
||||||
mkVimPlugin {
|
|
||||||
name = "molten";
|
name = "molten";
|
||||||
package = "molten-nvim";
|
package = "molten-nvim";
|
||||||
globalPrefix = "molten_";
|
globalPrefix = "molten_";
|
||||||
description = "A neovim plugin for interactively running code with the jupyter kernel. Fork of magma-nvim with improvements in image rendering, performance, and more.";
|
description = "A neovim plugin for interactively running code with the jupyter kernel. Fork of magma-nvim with improvements in image rendering, performance, and more.";
|
||||||
|
|
||||||
maintainers = [ maintainers.GaetanLepage ];
|
maintainers = [ lib.maintainers.GaetanLepage ];
|
||||||
|
|
||||||
settingsOptions = {
|
|
||||||
auto_image_popup = helpers.defaultNullOpts.mkBool false ''
|
|
||||||
When true, cells that produce an image output will open the image output automatically with
|
|
||||||
python's `Image.show()`.
|
|
||||||
'';
|
|
||||||
|
|
||||||
auto_init_behavior = helpers.defaultNullOpts.mkStr "init" ''
|
|
||||||
When set to "raise" commands which would otherwise ask for a kernel when they're run without
|
|
||||||
a running kernel will instead raise an exception.
|
|
||||||
Useful for other plugins that want to use `pcall` and do their own error handling.
|
|
||||||
'';
|
|
||||||
|
|
||||||
auto_open_html_in_browser = helpers.defaultNullOpts.mkBool false ''
|
|
||||||
Automatically open HTML outputs in a browser. related: `open_cmd`.
|
|
||||||
'';
|
|
||||||
|
|
||||||
auto_open_output = helpers.defaultNullOpts.mkBool true ''
|
|
||||||
Automatically open the floating output window when your cursor moves into a cell.
|
|
||||||
'';
|
|
||||||
|
|
||||||
cover_empty_lines = helpers.defaultNullOpts.mkBool false ''
|
|
||||||
The output window and virtual text will be shown just below the last line of code in the
|
|
||||||
cell.
|
|
||||||
'';
|
|
||||||
|
|
||||||
cover_lines_starting_with = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
|
||||||
When `cover_empty_lines` is `true`, also covers lines starting with these strings.
|
|
||||||
'';
|
|
||||||
|
|
||||||
copy_output = helpers.defaultNullOpts.mkBool false ''
|
|
||||||
Copy evaluation output to clipboard automatically (requires `pyperclip`).
|
|
||||||
'';
|
|
||||||
|
|
||||||
enter_output_behavior = helpers.defaultNullOpts.mkEnumFirstDefault [
|
|
||||||
"open_then_enter"
|
|
||||||
"open_and_enter"
|
|
||||||
"no_open"
|
|
||||||
] "The behavior of [MoltenEnterOutput](https://github.com/benlubas/molten-nvim#moltenenteroutput).";
|
|
||||||
|
|
||||||
image_provider =
|
|
||||||
helpers.defaultNullOpts.mkEnumFirstDefault
|
|
||||||
[
|
|
||||||
"none"
|
|
||||||
"image.nvim"
|
|
||||||
"wezterm"
|
|
||||||
]
|
|
||||||
''
|
|
||||||
How images are displayed.
|
|
||||||
'';
|
|
||||||
|
|
||||||
open_cmd = helpers.mkNullOrOption types.str ''
|
|
||||||
Defaults to `xdg-open` on Linux, `open` on Darwin, and `start` on Windows.
|
|
||||||
But you can override it to whatever you want.
|
|
||||||
The command is called like: `subprocess.run([open_cmd, filepath])`
|
|
||||||
'';
|
|
||||||
|
|
||||||
output_crop_border = helpers.defaultNullOpts.mkBool true ''
|
|
||||||
'crops' the bottom border of the output window when it would otherwise just sit at the
|
|
||||||
bottom of the screen.
|
|
||||||
'';
|
|
||||||
|
|
||||||
output_show_more = helpers.defaultNullOpts.mkBool false ''
|
|
||||||
When the window can't display the entire contents of the output buffer, shows the number of
|
|
||||||
extra lines in the window footer (requires nvim 10.0+ and a window border).
|
|
||||||
'';
|
|
||||||
|
|
||||||
output_virt_lines = helpers.defaultNullOpts.mkBool false ''
|
|
||||||
Pad the main buffer with virtual lines so the floating window doesn't cover anything while
|
|
||||||
it's open.
|
|
||||||
'';
|
|
||||||
|
|
||||||
output_win_border = helpers.defaultNullOpts.mkBorder [
|
|
||||||
""
|
|
||||||
"━"
|
|
||||||
""
|
|
||||||
""
|
|
||||||
] "output window" "";
|
|
||||||
|
|
||||||
output_win_cover_gutter = helpers.defaultNullOpts.mkBool true ''
|
|
||||||
Should the output window cover the gutter (numbers and sign col), or not.
|
|
||||||
If you change this, you probably also want to change `output_win_style`.
|
|
||||||
'';
|
|
||||||
|
|
||||||
output_win_hide_on_leave = helpers.defaultNullOpts.mkBool true ''
|
|
||||||
After leaving the output window (via `:q` or switching windows), do not attempt to redraw
|
|
||||||
the output window.
|
|
||||||
'';
|
|
||||||
|
|
||||||
output_win_max_height = helpers.defaultNullOpts.mkUnsignedInt 999999 ''
|
|
||||||
Max height of the output window.
|
|
||||||
'';
|
|
||||||
|
|
||||||
output_win_max_width = helpers.defaultNullOpts.mkUnsignedInt 999999 ''
|
|
||||||
Max width of the output window.
|
|
||||||
'';
|
|
||||||
|
|
||||||
output_win_style =
|
|
||||||
helpers.defaultNullOpts.mkEnumFirstDefault
|
|
||||||
[
|
|
||||||
false
|
|
||||||
"minimal"
|
|
||||||
]
|
|
||||||
''
|
|
||||||
Value passed to the style option in `:h nvim_open_win()`.
|
|
||||||
'';
|
|
||||||
|
|
||||||
save_path = helpers.defaultNullOpts.mkStr {
|
|
||||||
__raw = "vim.fn.stdpath('data')..'/molten'";
|
|
||||||
} "Where to save/load data with `:MoltenSave` and `:MoltenLoad`.";
|
|
||||||
|
|
||||||
tick_rate = helpers.defaultNullOpts.mkUnsignedInt 500 ''
|
|
||||||
How often (in ms) we poll the kernel for updates.
|
|
||||||
Determines how quickly the ui will update, if you want a snappier experience, you can set
|
|
||||||
this to 150 or 200.
|
|
||||||
'';
|
|
||||||
|
|
||||||
use_border_highlights = helpers.defaultNullOpts.mkBool false ''
|
|
||||||
When true, uses different highlights for output border depending on the state of the cell
|
|
||||||
(running, done, error).
|
|
||||||
'';
|
|
||||||
|
|
||||||
limit_output_chars = helpers.defaultNullOpts.mkUnsignedInt 1000000 ''
|
|
||||||
Limit on the number of chars in an output.
|
|
||||||
If you're lagging your editor with too much output text, decrease it.
|
|
||||||
'';
|
|
||||||
|
|
||||||
virt_lines_off_by_1 = helpers.defaultNullOpts.mkBool false ''
|
|
||||||
Allows the output window to cover exactly one line of the regular buffer when
|
|
||||||
`output_virt_lines` is `true`, also effects where `virt_text_output` is displayed.
|
|
||||||
(useful for running code in a markdown file where that covered line will just be ```).
|
|
||||||
'';
|
|
||||||
|
|
||||||
virt_text_output = helpers.defaultNullOpts.mkBool false ''
|
|
||||||
When true, show output as virtual text below the cell, virtual text stays after leaving the
|
|
||||||
cell.
|
|
||||||
When true, output window doesn't open automatically on run.
|
|
||||||
Effected by `virt_lines_off_by_1`.
|
|
||||||
'';
|
|
||||||
|
|
||||||
virt_text_max_lines = helpers.defaultNullOpts.mkUnsignedInt 12 ''
|
|
||||||
Max height of the virtual text.
|
|
||||||
'';
|
|
||||||
|
|
||||||
wrap_output = helpers.defaultNullOpts.mkBool false ''
|
|
||||||
Wrap output text.
|
|
||||||
'';
|
|
||||||
|
|
||||||
show_mimetype_debug = helpers.defaultNullOpts.mkBool false ''
|
|
||||||
Before any non-iostream output chunk, the mime-type for that output chunk is shown.
|
|
||||||
Meant for debugging/plugin development.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
settingsExample = {
|
settingsExample = {
|
||||||
auto_open_output = true;
|
auto_open_output = true;
|
||||||
|
|
@ -192,8 +36,8 @@ mkVimPlugin {
|
||||||
};
|
};
|
||||||
|
|
||||||
extraOptions = {
|
extraOptions = {
|
||||||
python3Dependencies = mkOption {
|
python3Dependencies = lib.mkOption {
|
||||||
type = with types; functionTo (listOf package);
|
type = with lib.types; functionTo (listOf package);
|
||||||
default =
|
default =
|
||||||
p: with p; [
|
p: with p; [
|
||||||
pynvim
|
pynvim
|
||||||
|
|
@ -203,7 +47,7 @@ mkVimPlugin {
|
||||||
nbformat
|
nbformat
|
||||||
ipykernel
|
ipykernel
|
||||||
];
|
];
|
||||||
defaultText = literalExpression ''
|
defaultText = lib.literalExpression ''
|
||||||
p: with p; [
|
p: with p; [
|
||||||
pynvim
|
pynvim
|
||||||
jupyter-client
|
jupyter-client
|
||||||
|
|
@ -221,7 +65,7 @@ mkVimPlugin {
|
||||||
extraPython3Packages = cfg.python3Dependencies;
|
extraPython3Packages = cfg.python3Dependencies;
|
||||||
|
|
||||||
warnings = lib.nixvim.mkWarnings "plugins.molten" {
|
warnings = lib.nixvim.mkWarnings "plugins.molten" {
|
||||||
when = cfg.settings.image_provider == "wezterm" && !config.plugins.wezterm.enable;
|
when = (cfg.settings.image_provider or null) == "wezterm" && !config.plugins.wezterm.enable;
|
||||||
|
|
||||||
message = ''
|
message = ''
|
||||||
The `wezterm` plugin is not enabled, so the `molten` plugin's `image_provider` setting will have no effect.
|
The `wezterm` plugin is not enabled, so the `molten` plugin's `image_provider` setting will have no effect.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue