plugins.molten.settings

The configuration options for molten without the molten_ prefix.

For example, the following settings are equivialent to these :setglobal commands:

  • foo_bar = 1 -> :setglobal molten_foo_bar=1
  • hello = "world" -> :setglobal molten_hello="world"
  • some_toggle = true -> :setglobal molten_some_toggle
  • other_toggle = false -> :setglobal nomolten_other_toggle

Type: attribute set of anything

Default: { }

Example:

{
  auto_open_output = true;
  copy_output = false;
  enter_output_behavior = "open_then_enter";
  image_provider = "none";
  output_crop_border = true;
  output_show_more = false;
  output_virt_lines = false;
  output_win_border = [
    ""
    "━"
    ""
    ""
  ];
  output_win_cover_gutter = true;
  output_win_hide_on_leave = true;
  output_win_style = false;
  save_path = {
    __raw = "vim.fn.stdpath('data')..'/molten'";
  };
  show_mimetype_debug = false;
  use_border_highlights = false;
  virt_lines_off_by1 = false;
  wrap_output = false;
}

Declared by:

plugins.molten.settings.auto_image_popup

When true, cells that produce an image output will open the image output automatically with python’s Image.show().

Plugin default: false

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.molten.settings.auto_init_behavior

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.

Plugin default: "init"

Type: null or string or raw lua code

Default: null

Declared by:

plugins.molten.settings.auto_open_html_in_browser

Automatically open HTML outputs in a browser. related: open_cmd.

Plugin default: false

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.molten.settings.auto_open_output

Automatically open the floating output window when your cursor moves into a cell.

Plugin default: true

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.molten.settings.copy_output

Copy evaluation output to clipboard automatically (requires pyperclip).

Plugin default: false

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.molten.settings.cover_empty_lines

The output window and virtual text will be shown just below the last line of code in the cell.

Plugin default: false

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.molten.settings.cover_lines_starting_with

When cover_empty_lines is true, also covers lines starting with these strings.

Plugin default: []

Type: null or (list of (string or raw lua code))

Default: null

Declared by:

plugins.molten.settings.enter_output_behavior

The behavior of MoltenEnterOutput.

Plugin default: "open_then_enter"

Type: null or one of “open_then_enter”, “open_and_enter”, “no_open” or raw lua code

Default: null

Declared by:

plugins.molten.settings.image_provider

How images are displayed.

Plugin default: "none"

Type: null or one of “none”, “image.nvim” or raw lua code

Default: null

Declared by:

plugins.molten.settings.limit_output_chars

Limit on the number of chars in an output. If you’re lagging your editor with too much output text, decrease it.

Plugin default: 1000000

Type: null or unsigned integer, meaning >=0, or raw lua code

Default: null

Declared by:

plugins.molten.settings.open_cmd

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])

Type: null or string

Default: null

Declared by:

plugins.molten.settings.output_crop_border

‘crops’ the bottom border of the output window when it would otherwise just sit at the bottom of the screen.

Plugin default: true

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.molten.settings.output_show_more

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).

Plugin default: false

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.molten.settings.output_virt_lines

Pad the main buffer with virtual lines so the floating window doesn’t cover anything while it’s open.

Plugin default: false

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.molten.settings.output_win_border

Defines the border to use for output window. Accepts same border values as nvim_open_win(). See :help nvim_open_win() for more info.

Plugin default: ["" "━" "" ""]

Type: null or string or list of string or list of list of string or raw lua code

Default: null

Declared by:

plugins.molten.settings.output_win_cover_gutter

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.

Plugin default: true

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.molten.settings.output_win_hide_on_leave

After leaving the output window (via :q or switching windows), do not attempt to redraw the output window.

Plugin default: true

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.molten.settings.output_win_max_height

Max height of the output window.

Plugin default: 999999

Type: null or unsigned integer, meaning >=0, or raw lua code

Default: null

Declared by:

plugins.molten.settings.output_win_max_width

Max width of the output window.

Plugin default: 999999

Type: null or unsigned integer, meaning >=0, or raw lua code

Default: null

Declared by:

plugins.molten.settings.output_win_style

Value passed to the style option in :h nvim_open_win().

Plugin default: false

Type: null or one of false, “minimal” or raw lua code

Default: null

Declared by:

plugins.molten.settings.save_path

Where to save/load data with :MoltenSave and :MoltenLoad.

Plugin default: "{__raw = \"vim.fn.stdpath('data')..'/molten'\";}"

Type: null or string or raw lua code

Default: null

Declared by:

plugins.molten.settings.show_mimetype_debug

Before any non-iostream output chunk, the mime-type for that output chunk is shown. Meant for debugging/plugin development.

Plugin default: false

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.molten.settings.tick_rate

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.

Plugin default: 500

Type: null or unsigned integer, meaning >=0, or raw lua code

Default: null

Declared by:

plugins.molten.settings.use_border_highlights

When true, uses different highlights for output border depending on the state of the cell (running, done, error).

Plugin default: false

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.molten.settings.virt_lines_off_by_1

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 ```).

Plugin default: false

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.molten.settings.virt_text_max_lines

Max height of the virtual text.

Plugin default: 12

Type: null or unsigned integer, meaning >=0, or raw lua code

Default: null

Declared by:

plugins.molten.settings.virt_text_output

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.

Plugin default: false

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.molten.settings.wrap_output

Wrap output text.

Plugin default: false

Type: null or boolean or raw lua code

Default: null

Declared by: