A minimal Neovim plugin that detects excessive key spamming (jjjjjj
) and suggests more efficient alternatives.
j
, k
, h
, l
, w
use 10j
):SpamStats
to view usage statsneo-tree
, NvimTree
, etc.)vim.b.disable_spamguard = true
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.
:SpamStats
— Show usage stats: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.
MIT © Tim Seriakov