-
Notifications
You must be signed in to change notification settings - Fork 6
treesitter
Zeioth edited this page Feb 23, 2024
·
7 revisions
You can add this component to the statusline section of heirline opts.
require("heirline-components.all").component.treesitter()
It displays a indicator when treesitter is available.
These are the available providers for this component and its options.
str = { str = "TS", icon = { kind = "ActiveTS", padding = { right = 1 } } }, -- String and icon to display.
surround = {
separator = "right", -- where to add the separator.
color = "treesitter_bg", -- you can set a custom background color, for eample "#444444".
condition = require("heirline-components.all").condition.treesitter_available -- a function that determines when to display the git branch indicator.
},
hl = hl.get_attributes "diagnostics", -- you can specify your own hilight group here.
on_click = { name = "<your_event_name", callback = function() end }, -- what happens when you click the component.
update = { "OptionSet", pattern = "syntax" }, -- events that make the component refresh.
init = init.update_events { "BufEnter" }
For example you could change the text displayed when treesitter is enabled
component.treesitter(str = { str = { str = "Treesitter ON" } })