Open luisjakon opened 3 months ago
Using this to create a basic heirline statusline config to use with Lazy...
local M = {}
function M.opts()
local lib = require("heirline-components.all")
return {
opts = {
disable_winbar_cb = function(args) -- We do this to avoid showing it on the greeter.
local is_disabled = not require("heirline-components.buffer").is_valid(args.buf)
or lib.condition.buffer_matches({
buftype = { "terminal", "prompt", "nofile", "help", "quickfix" },
filetype = { "NvimTree", "neo%-tree", "dashboard", "Outline", "aerial" },
}, args.buf)
return is_disabled
end,
},
tabline = { -- UI upper bar
lib.component.tabline_conditional_padding(),
lib.component.tabline_buffers(),
lib.component.fill({ hl = { bg = "tabline_bg" } }),
lib.component.tabline_tabpages(),
},
winbar = { -- UI breadcrumbs bar
init = function(self)
self.bufnr = vim.api.nvim_get_current_buf()
end,
fallthrough = false,
-- Winbar for terminal, neotree, and aerial.
{
condition = function()
return not lib.condition.is_active()
end,
{
lib.component.neotree(),
lib.component.compiler_play(),
lib.component.fill(),
lib.component.compiler_build_type(),
lib.component.compiler_redo(),
lib.component.aerial(),
},
},
-- Regular winbar
{
lib.component.neotree(),
lib.component.compiler_play(),
lib.component.fill(),
lib.component.breadcrumbs(),
lib.component.fill(),
lib.component.compiler_redo(),
lib.component.aerial(),
},
},
statuscolumn = { -- UI left column
init = function(self)
self.bufnr = vim.api.nvim_get_current_buf()
end,
lib.component.signcolumn(),
lib.component.numbercolumn(),
lib.component.foldcolumn(),
} or nil,
statusline = { -- UI statusbar
hl = { fg = "fg", bg = "bg" },
lib.component.mode(),
lib.component.git_branch(),
lib.component.git_diff(),
lib.component.diagnostics(),
lib.component.fill(),
lib.component.cmd_info(),
lib.component.fill(),
lib.component.lsp(),
lib.component.compiler_state(),
lib.component.virtual_env(),
lib.component.treesitter(),
lib.component.file_info(),
lib.component.nav(),
lib.component.mode({ surround = { separator = "right" } }),
},
}
end
function M.config(_, opts)
local heirline = require("heirline")
local heirline_components = require("heirline-components.all")
-- Setup
heirline_components.init.subscribe_to_events()
heirline.load_colors(heirline_components.hl.get_colors())
heirline.setup(opts)
end
return M
Yeah, right now the vim->tmux bridge does not implement translation of click events.
The tmux mouse support is also not really the greatest (read MOUSE SUPPORT
in man tmux(1)
), meaning this one is a tough one to implement. It requires the translation from tmux mouse_x
, mouse_y
location back to the statusline components and on top of that some architectural changes to communicate back to vim (previously every feature only required unidirectional communication).
Describe the bug
When installing vim-tpipeline alongside
Zeioth/heirline-components.nvim
you can no longer click on the the clickable components such as git_branch, git_diff, diagnostics, lsp, etc. for quick access to info and actions.To reproduce
vimpostor/vim-tpipeline
zeioth/heirline-components.nvim
on_click
Expected behavior
Statusline components should behave normally with clickable sections
Terminal emulator
Kitty
Debug output