plugins.markdown-preview.settings

The configuration options for markdown-preview without the mkdp_ prefix.

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

  • foo_bar = 1 -> :setglobal mkdp_foo_bar=1
  • hello = "world" -> :setglobal mkdp_hello="world"
  • some_toggle = true -> :setglobal mkdp_some_toggle
  • other_toggle = false -> :setglobal nomkdp_other_toggle

Type: attribute set of anything

Default: { }

Example:

{
  auto_close = true;
  auto_start = true;
  browser = "firefox";
  echo_preview_url = true;
  highlight_css = {
    __raw = "vim.fn.expand('~/highlight.css')";
  };
  markdown_css = "/Users/username/markdown.css";
  page_title = "「\${name}」";
  port = "8080";
  preview_options = {
    disable_filename = true;
    disable_sync_scroll = true;
    sync_scroll_type = "middle";
  };
  theme = "dark";
}

Declared by:

plugins.markdown-preview.settings.auto_close

Auto close current preview window when change from markdown buffer to another buffer.

Plugin default: true

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.markdown-preview.settings.auto_start

Open the preview window after entering the markdown buffer.

Plugin default: false

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.markdown-preview.settings.browser

The browser to open the preview page.

Plugin default: ""

Type: null or string or raw lua code

Default: null

Declared by:

plugins.markdown-preview.settings.browser_func

A custom vim function name to open preview page. This function will receive url as param.

Plugin default: ""

Type: null or string or raw lua code

Default: null

Declared by:

plugins.markdown-preview.settings.combine_preview

Combine preview window. If enable it will reuse previous opened preview window when you preview markdown file. Ensure to set auto_close = false if you have enable this option.

Plugin default: false

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.markdown-preview.settings.combine_preview_auto_refresh

Auto refetch combine preview contents when change markdown buffer only when combine_preview is true.

Plugin default: true

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.markdown-preview.settings.command_for_global

Enable markdown preview for all files (by default, the plugin is only enabled for markdown files).

Plugin default: false

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.markdown-preview.settings.echo_preview_url

Echo preview page url in command line when opening the preview page.

Plugin default: false

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.markdown-preview.settings.filetypes

Recognized filetypes. These filetypes will have MarkdownPreview... commands.

Plugin default: ["markdown"]

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

Default: null

Declared by:

plugins.markdown-preview.settings.highlight_css

Custom highlight style. Must be an absolute path like “/Users/username/highlight.css” or {__raw = "vim.fn.expand('~/highlight.css')";}.

Plugin default: ""

Type: null or string or raw lua code

Default: null

Declared by:

plugins.markdown-preview.settings.images_path

Use a custom location for images.

Plugin default: ""

Type: null or string or raw lua code

Default: null

Declared by:

plugins.markdown-preview.settings.markdown_css

Custom markdown style. Must be an absolute path like "/Users/username/markdown.css" or {__raw = "vim.fn.expand('~/markdown.css')";}.

Plugin default: ""

Type: null or string or raw lua code

Default: null

Declared by:

plugins.markdown-preview.settings.open_ip

Custom IP used to open the preview page. This can be useful when you work in remote vim and preview on local browser. For more detail see: https://github.com/iamcco/markdown-preview.nvim/pull/9.

Plugin default: ""

Type: null or string or raw lua code

Default: null

Declared by:

plugins.markdown-preview.settings.open_to_the_world

Make the preview server available to others in your network. By default, the server listens on localhost (127.0.0.1).

Plugin default: false

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.markdown-preview.settings.page_title

Preview page title. $${name} will be replaced with the file name.

Plugin default: "「\${name}」"

Type: null or string or raw lua code

Default: null

Declared by:

plugins.markdown-preview.settings.port

Custom port to start server or empty for random.

Plugin default: ""

Type: null or string or raw lua code

Default: null

Declared by:

plugins.markdown-preview.settings.refresh_slow

Refresh markdown when save the buffer or leave from insert mode, default false is auto refresh markdown as you edit or move the cursor.

Plugin default: false

Type: null or boolean or raw lua code

Default: null

Declared by:

plugins.markdown-preview.settings.theme

Default theme (dark or light). By default the theme is define according to the preferences of the system.

Type: null or one of “dark”, “light”

Default: null

Declared by: