keys.nvim
April 17, 2024 ยท View on GitHub
A neovim plugin that shows keystrokes.
Kind of like screen keys but inside neovim.
WIP, contains bugs.
Tip
A better implementation of this plugin can be found at screenkey.nvim by @NStefan002

Installation
use { 'tamton-aquib/keys.nvim' }
Use
cmd="KeysToggle"for lazy-loading.
Configuration
- Default setup function:
require("keys").setup {
enable_on_startup = false,
win_opts = {
width = 25
-- etc
},
-- TODO: more options later
}
Usage
KeysTogglecommand.require("keys").toggle()
Statusline component
This plugin exposes current_keys() function.
To use it in statusline, set the provider as:
require("keys").current_keys(true)
-- `true` implies return it as a string rather than a table
โ Make sure to set
enable_on_startup = trueinside setup()
TODO:
- Crtl and other modifier keys (maybe?).
- Backspace and some other basic ones.
- Cleanup.
- fix on_key() clear_namespace bug.
Notes to myself
- autocmd ModeChanged
- getchar() or getcharmod()