Add mechanical keyboard sound effects to Neovim!
- Neovim >= 0.10.0 (
vim.system()is required) - For legacy per-file
.wavprofiles, one of:afplay(macOS)aplay(Linux)- PowerShell (Windows)
- For bundled single-file
.oggprofiles, either:ffplaympv- or
ffmpegplus the OS audio backend above
Warning
There is a noticable delay when using wireless headphones/earbuds. Use wired earbuds for the best experience.
Use your favorite plugin manager!
{
"smit4k/clack.nvim",
opts = {
profile = "nk-cream",
volume = 0.8,
enabled = true,
on_enter = true,
on_space = true,
on_save = true,
on_non_insert = false,
},
}Available profiles are detected from sounds/<folder> and use the folder name as the profile id. Current bundled folders include:
cherrymx-blue-pbtcherrymx-blue-abscherrymx-red-pbtcherrymx-red-abscherrymx-brown-pbtcherrymx-brown-abscherrymx-black-pbtcherrymx-black-abstopre-purple-hybrid-pbteg-crystal-purpleeg-oreoholy-pandasmxblue-travelmxblack-travelmxbrown-travelcream-travelturquoisenk-cream
Commands:
:ClackEnable:ClackDisable:ClackToggle:ClackProfile:checkhealth clack
Set on_non_insert = true if you also want sounds for motions, counts, and other non-insert keystrokes.
Run :checkhealth clack if playback is unavailable or a profile does not seem to load.
Sounds are resolved relative to the plugin install directory. clack.nvim now supports both the original pool layout and config.json packs that slice a single .ogg file into per-key clips.
Pool layout:
sounds/
blue/
key_1.wav key_2.wav key_3.wav key_4.wav
enter_1.wav enter_2.wav enter_3.wav enter_4.wav
space_1.wav space_2.wav space_3.wav space_4.wav
save_1.wav save_2.wav save_3.wav save_4.wav
red/
topre/
buckling_spring/
Single-file layout:
sounds/
cherrymx-blue-pbt/
config.json
sound.ogg
For single-file packs, the plugin reads the defines map from config.json, keeps a small variation pool for generic typing, and pre-extracts those slices to cached .wav files in the temp directory when possible. If ffmpeg is unavailable, ffplay or mpv can play slices directly. Because Neovim only exposes inserted characters rather than raw keyboard scan codes, save sounds reuse the generic key pool and release-only slices are ignored.