Skip to content

NStefan002/screenkey.nvim

Repository files navigation

Screenkey.nvim

Screenkey is a Neovim plugin that displays the keys you are typing in a floating window, just like screenkey does. It is useful for screencasts, presentations, and live coding sessions.

📺 Showcase

2024-04-16.22-42-26.mp4

⚡️ Requirements

  • Neovim nightly (0.10.0+, not older than April 1st, since Screenkey requires #28098)
  • a Nerd Font (optional, but recommended)

📋 Installation

lazy:

{
    "NStefan002/screenkey.nvim",
    cmd = "Screenkey",
    version = "*",
    config = true,
}

packer:

use({
    "NStefan002/screenkey.nvim",
    config = function()
        require("screenkey").setup()
    end,
})

rocks.nvim

:Rocks install screenkey.nvim

Default settings:
{
    -- see :h nvim_open_win
    win_opts = {
        relative = "editor",
        anchor = "SE",
        width = 40,
        height = 3,
        border = "single",
    },
    -- compress input when repeated <compress_after> times
    compress_after = 3,
    -- clear the input after <clear_after> seconds of inactivity
    clear_after = 3,
    -- temporarily disable screenkey (for example when inside of the terminal)
    disable = {
        filetypes = {}, -- for example: "toggleterm"
        -- :h 'buftype'
        buftypes = {}, -- for example: "terminal"
    },
}

❓ How to use

  • :Screenkey to toggle the screenkey
  • Don't worry about leaking your passwords when using sudo while streaming/recording because you forgot to turn your display-key application, Screenkey will only show pieces of information about your input in Neovim.

Note

If you're using a terminal inside of the Neovim, and you want screenkey to automatically stop displaying your keys when you're inside of the terminal, see disable option in the plugin configuration.

👀 Similar projects and some differences

  • keys.nvim:
    • As of the last update of this README, keys.nvim cannot process the literal keys you type - for example if you have <c-d> mapped to <c-d>zz, when you press <c-d> keys.nvim will show ^d z z instead of ^d.
    • Screenkey has compress_after option that enables it to compress your input - for example jjjjjj will be displayed as j..x6, which is usually way easier to read and will save up a lot of space.