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 = 1;
  auto_start = 1;
  browser = "firefox";
  echo_preview_url = 1;
  highlight_css = {
    __raw = "vim.fn.expand('~/highlight.css')";
  };
  markdown_css = "/Users/username/markdown.css";
  page_title = "「\${name}」";
  port = "8080";
  preview_options = {
    disable_filename = 1;
    disable_sync_scroll = 1;
    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.

Type: null or (one of 0, 1) or raw lua code

Default: null

Plugin default: 1

Declared by:

plugins.markdown-preview.settings.auto_start

Open the preview window after entering the markdown buffer.

Type: null or (one of 0, 1) or raw lua code

Default: null

Plugin default: 0

Declared by:

plugins.markdown-preview.settings.browser

The browser to open the preview page.

Type: null or string or raw lua code

Default: null

Plugin default: ""

Declared by:

plugins.markdown-preview.settings.browserfunc

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

Type: null or string or raw lua code

Default: null

Plugin default: ""

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 = 0 if you have enable this option.

Type: null or (one of 0, 1) or raw lua code

Default: null

Plugin default: 0

Declared by:

plugins.markdown-preview.settings.combine_preview_auto_refresh

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

Type: null or (one of 0, 1) or raw lua code

Default: null

Plugin default: 1

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

Type: null or (one of 0, 1) or raw lua code

Default: null

Plugin default: 0

Declared by:

plugins.markdown-preview.settings.echo_preview_url

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

Type: null or (one of 0, 1) or raw lua code

Default: null

Plugin default: 0

Declared by:

plugins.markdown-preview.settings.filetypes

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

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

Default: null

Plugin default:

[
  "markdown"
]

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')";}.

Type: null or string or raw lua code

Default: null

Plugin default: ""

Declared by:

plugins.markdown-preview.settings.images_path

Use a custom location for images.

Type: null or string or raw lua code

Default: null

Plugin default: ""

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')";}.

Type: null or string or raw lua code

Default: null

Plugin default: ""

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.

Type: null or string or raw lua code

Default: null

Plugin default: ""

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

Type: null or (one of 0, 1) or raw lua code

Default: null

Plugin default: 0

Declared by:

plugins.markdown-preview.settings.page_title

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

Type: null or string or raw lua code

Default: null

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

Declared by:

plugins.markdown-preview.settings.port

Custom port to start server or empty for random.

Type: null or string or raw lua code

Default: null

Plugin default: ""

Declared by:

plugins.markdown-preview.settings.refresh_slow

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

Type: null or (one of 0, 1) or raw lua code

Default: null

Plugin default: 0

Declared by:

plugins.markdown-preview.settings.theme

Default theme (dark or light).

Type: null or one of “dark”, “light” or raw lua code

Default: null

Plugin default: chosen based on system preferences

Declared by: