-
Notifications
You must be signed in to change notification settings - Fork 4
Configuration
This page provides instructions on how to configure the Markdown Headers plugin according to your preferences. You can customize various settings to tailor the plugin to your specific needs.
While the examples below are in lua, you can adapt them for .vim files by
wrapping them in a lua heredoc. However, it's not recommended due to
significant slowdowns in Neovim's load time.
lua << END
require('md-headers').setup()
ENDConfigure the plugin in your init.lua file, as demonstrated in the example
below. The default configuration is shown, and you can customize it by
modifying the values of different settings.
{
width = 60,
height = 10,
borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" },
popup_auto_close = true, -- or false
win_options = {
number = false,
relativenumber = false,
cursorline = true,
},
highlight_groups = {
title = {
fg = nil,
bg = nil,
},
border = {
fg = nil,
bg = nil,
},
text = {
fg = nil,
bg = nil,
},
},
}If you don't configure Markdown Headers or leave certain settings unconfigured, the plugin will use its default settings. These settings can be found above.
You can customize the following settings:
You can customize the width of the Markdown Headers popup window using the
width setting.
- Format: Numeric
- Example: Setting the width to '100' makes the popup window 100 columns wide.
Adjust the height of the Markdown Headers popup window with the height setting.
- Format: Numeric
- Example: Setting the height to '40' results in a popup window that is 40 lines high.
Customize the characters used to draw the border around the popup window using
the borderchars setting.
- Format: Array of eight strings
-
Example: Setting borderchars to
{ '', '', '', '', '', '', '', '' }results in a borderless popup window.
Specify whether the popup window should automatically close after selecting a
heading using the popup_auto_close setting.
- Format: Boolean (true or false)
-
Example: Setting
popup_auto_closeto false will NOT automatically close the popup window after selecting a heading.
The following options can be set for the popup window using the win_options
these settings will override your global settings for the popup window.
- Format: Boolean (true or false)
-
Example: Setting
numberto true will display line numbers in the popup window.
- Format: Boolean (true or false)
-
Example: Setting
relativenumberto true will display relative line numbers in the popup window (even whennumberis set to false).
- Format: Boolean (true or false)
-
Example: Setting
cursorlineto true will highlight the line under the cursor in the popup window.
People with a keen eye for aesthetics can customize the colors of the popup. Markdown Headers uses 4 highlight groups:
-
MarkdownHeadersTitle: The title of the popup window. -
MarkdownHeadersBorder: The border of the popup window. -
MarkdownHeadersWindow: The text inside the popup window.
The following settings can be customized:
-
Format: Table with
fgandbgkeys- fg: Hex color code for the text color
- bg: Hex color code for the background color
-
Example:
{ fg = '#FF0000', bg = '#0000FF' }
-
Format: Table with
fgandbgkeys- fg: Hex color code for the text color
- bg: Hex color code for the background color
-
Example:
{ fg = '#FF0000', bg = '#0000FF' }
-
Format: Table with
fgandbgkeys- fg: Hex color code for the text color
- bg: Hex color code for the background color
-
Example:
{ fg = '#FF0000', bg = '#0000FF' }
To verify your configuration for Markdown Headers, run a health check using
:checkhealth md-headers.
Didn't find what you were looking for, feel free to create a issue.