From a36c9106f927302ce2ba5d656b9f89e35fd2d4c8 Mon Sep 17 00:00:00 2001 From: Nicolas Goudry Date: Sun, 16 Jun 2024 00:12:21 +0200 Subject: [PATCH] feat(plugins/heirline): add component to display screenkey keys --- plugins/heirline.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/plugins/heirline.nix b/plugins/heirline.nix index 3b57cdd..663c71c 100644 --- a/plugins/heirline.nix +++ b/plugins/heirline.nix @@ -10,6 +10,8 @@ # https://github.com/AstroNvim/AstroNvim/blob/v4.7.7/lua/astronvim/plugins/configs/heirline.lua config = '' local status = require("astroui.status") + local screenkey = require("screenkey") + vim.g.screenkey_statusline_component = true require("heirline").setup({ opts = { @@ -32,6 +34,20 @@ status.component.lsp(), status.component.virtual_env(), 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.mode { surround = { separator = "right" } }, },