-
Notifications
You must be signed in to change notification settings - Fork 52
Headings
This plugin provides custom headings whuch can be configured through this option.
Important
Do not use italics
, bold
texts or inline codes
in your headings.
The plugin will render the text with the symbols as they are not yet supported.
Configuration for the heading
is separated into 2 parts, global
& level specific
.
Global configuration options are used to change how all the headings behave.
heading = {
enable = true,
shift_width = 4,
heading_1 = {},
heading_2 = {},
heading_3 = {},
heading_4 = {},
heading_5 = {},
heading_6 = {}
}
A boolean value, used to enable or disable custom headings.
A number value, the number of times shift_char
will be repeated.
When nil, vim.o.shiftwidth
is used.
Configuration table for various level specific
options.
Each heading level has the following configuration table. They can be used to customise individual headings.
heading_1 = {
style = "label",
hl = "rainbow1",
corner_left = "", corner_left_hl = nil,
corner_right = "", corner_right_hl = nil,
padding_left = "", padding_left_hl = nil,
padding_right = "", padding_right_hl = nil,
icon = "", icon_hl = nil,
text = "", text_hl = nil,
sign = nil, sign_hl = nil
}
A string value, the style of the heading. Currently supported values are.
- simple, Simple line highlighting
- label, Custom labels that can be configured like statusline components.
- icon, Icons for the heading text
Important
The properties given below will behave differently based on the used style
.
The simple
style only adds a simple background to the line.
heading_1 = {
style = "simple",
hl = "rainbow1"
}
Highlight group used to Highlight the line itself.
The label
style makes the headings look like lables(like in glow
). They are customised similar to statusline-items
.
heading_2 = {
style = "icon",
position = "inline",
hl = nil,
line_hl = "Markview_orange",
shift_char = " ", shift_hl = nil,
corner_left = nil, corner_left_hl = nil,
corner_right = nil, corner_right_hl = nil,
padding_left = " ", padding_left_hl = nil,
padding_right = " ", padding_right_hl = nil,
icon = "2. " icon_hl = "rainbow2",
text = nil, text_hl = "rainbow2",
sign = "> ", sign_hl = "rainbow2"
}
virt_text_pos
for the label. See :h nvim_buf_set_extmark()
for the possible values.
The default highlight group to be used in the various highlight group properties(the ones with _hl
in their name).
The character to indicate heading level. It is repeated by heading_level * shift_width
.
The highlight group for shift_char
. When nil the value of hl
is used.
The left corner of the label.
Highlight group for the left corner. When nil the value of hl
is used.
The right corner of the label.
Highlight group for the right corner. When nil the value of hl
is used.
The left padding of the label. Added after the left_corner
.
Highlight group for the left padding. When nil the value of hl
is used.
The right padding of the label. Added before the right_corner
.
Highlight group for the right padding. When nil the value of hl
is used.
A custom icon for the heading. It is added after the left padding.
There won't be any spaces added between the icon & the heading's text. So, you should add the spaces to the icon itself.
Highlight group for the icon. When nil the value of hl
is used.
A custom text for the label. This will replace the heading's title.
Highlight group for the headings text. When nil the value of hl
is used.
A custom sign for the heading.
Highlight group for the sign. When nil the value of hl
is used.
The icon
style supports simple icon, line_hl and signs.
heading_3 = {
style = "icon",
position = "inline",
hl = "rainbow3",
shift_char = " ", shift_hl = nil,
icon = "3. ", icon_hl = nil,
text = nil, text_hl = nil,
sign = "» ", sign_hl = nil,
}
The options are already explained in
label
andsimple
.