-
Notifications
You must be signed in to change notification settings - Fork 2
file_info
Zeioth edited this page Apr 3, 2024
·
15 revisions
You can add this component to the statusline section of heirline opts.
require("heirline-components.all").component.file_info()
You can see how this component look on the left of the next image: It will show a icon + the filetype your are currently editing.
These are the available providers for this component and its options.
file_icon = { -- if set, displays a icon depending the current filetype.
hl = hl.file_icon "statusline",
padding = { left = 1, right = 1 },
condition = condition.is_file
},
filename = false, -- if set, displays the filename.
filetype = {}, -- if set, displays the filetype.
file_modified = false, -- if set, displays a white dot if the file has been modified.
file_read_only = { -- if set, displays a lock icon if the file is read only.
padding = { left = 1, right = 1 },
condition = condition.is_file
},
surround = {
separator = "left",
color = "file_info_bg",
condition = condition.has_filetype,
},
hl = hl.get_attributes "file_info",
You can explicitely pass providers to the component to modify the information it displays.
require("heirline-components.all").component.file_info({ filetype = false, filename = {}, file_modified = false }) -- icon+filename+extension
require("heirline-components.all").component.file_info({ file_icon = {}, filetype = false, filename = false, file_modified = false }) -- icon only
icon+filename+extension
icon only