NStefan002 / screenkey.nvim

Screencast your keys in Neovim
MIT License
320 stars 6 forks source link

feat: expose active state #48

Closed zackAJ closed 2 months ago

zackAJ commented 2 months ago

Hey, thank you for this great plugin.

Problem

I needed the ability to hide some stuff on my screen in case screenkey is active.

Solution

I exposed the active variable via a getter

Example

        local notify = require("notify")
        local toggleScreenKey = function()
            vim.cmd("Screenkey toggle")
            -- change notification position
            notify.setup({
                top_down = screenkey.is_active(),
            })
        end

        vim.keymap.set("n", "<leader>tk", toggleScreenKey, { desc = "[T]oggle [S]creen[K]ey" })
NStefan002 commented 2 months ago

Nice