spamguard.nvim ๐ก๏ธ
May 5, 2025 ยท View on GitHub
A minimal Neovim plugin that detects excessive key spamming (jjjjjj) and suggests more efficient alternatives.
๐ฟ๏ธ Demo (neovide)

โจ Features
- Detects spam on keys like
j,k,h,l,w - Displays suggestions for more effective motion usage (e.g.
use 10j) - Tracks daily and weekly key usage
- Command
:SpamStatsto view usage stats - Fully configurable thresholds and suggestions ๐
- Ignores common explorer/file manager filetypes (
neo-tree,NvimTree, etc.) - Can be disabled per-buffer with
vim.b.disable_spamguard = true
๐ Installation
Using lazy.nvim:
return {
"timseriakov/spamguard.nvim",
event = "VeryLazy",
config = function()
local spamguard = require("spamguard")
spamguard.setup({
keys = {
j = { threshold = 9, suggestion = "use s / f instead of spamming jjjj ๐" },
k = { threshold = 9, suggestion = "try { of ( instead of spamming kkkk ๐" },
h = { threshold = 9, suggestion = "use b / 0 / ^ instead of spamming hhhh ๐" },
l = { threshold = 9, suggestion = "try w / e / f โ it's faster! ๐" },
w = { threshold = 8, suggestion = "use s / f โ more precise and quicker! ๐" },
},
})
vim.schedule(function()
spamguard.enable()
end)
end,
}
If a key is not listed in your config, it will fall back to the default behavior.
๐ Commands
:SpamStatsโ Show usage stats:- ๐ For today
- ๐๏ธ For the last 7 days
๐ง Disabling for specific buffers
You can disable spamguard in a specific buffer like this:
vim.b.disable_spamguard = true
This is useful for excluding special-purpose buffers or floating windows where tracking is not desired.
๐ License
MIT ยฉ Tim Seriakov