feat(plugins/heirline): add component to display screenkey keys
This commit is contained in:
parent
281069d97e
commit
a36c9106f9
1 changed files with 16 additions and 0 deletions
|
|
@ -10,6 +10,8 @@
|
||||||
# https://github.com/AstroNvim/AstroNvim/blob/v4.7.7/lua/astronvim/plugins/configs/heirline.lua
|
# https://github.com/AstroNvim/AstroNvim/blob/v4.7.7/lua/astronvim/plugins/configs/heirline.lua
|
||||||
config = ''
|
config = ''
|
||||||
local status = require("astroui.status")
|
local status = require("astroui.status")
|
||||||
|
local screenkey = require("screenkey")
|
||||||
|
vim.g.screenkey_statusline_component = true
|
||||||
|
|
||||||
require("heirline").setup({
|
require("heirline").setup({
|
||||||
opts = {
|
opts = {
|
||||||
|
|
@ -32,6 +34,20 @@
|
||||||
status.component.lsp(),
|
status.component.lsp(),
|
||||||
status.component.virtual_env(),
|
status.component.virtual_env(),
|
||||||
status.component.treesitter(),
|
status.component.treesitter(),
|
||||||
|
{
|
||||||
|
provider = function()
|
||||||
|
local keys = screenkey.get_keys()
|
||||||
|
if keys == nil or keys == "" then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
return " " .. keys
|
||||||
|
end,
|
||||||
|
update = {
|
||||||
|
"User",
|
||||||
|
pattern = "Screenkey*",
|
||||||
|
callback = vim.schedule_wrap(function() vim.cmd("redrawstatus") end),
|
||||||
|
},
|
||||||
|
},
|
||||||
status.component.nav(),
|
status.component.nav(),
|
||||||
status.component.mode { surround = { separator = "right" } },
|
status.component.mode { surround = { separator = "right" } },
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue