Keystroke plugin for NeoVim
for packer
packer.use({
"jerrywang1981/keystroke.nvim",
config = [[
require"keystroke".setup({
handlers = {
-- insert mode
["i"] = {
-- or a table with callback/options key
-- it will call the function with key as first and options as second parameter
-- callback(key, options)
{
callback = require"keystroke.sound".play_sound,
options = {
-- the sound style, valid value: default/bubble/mario/sword/typewriter
style = "default",
}
},
},
}
})
]]
})
for lazy.nvim
return {
"jerrywang1981/keystroke.nvim",
-- enabled=false,
cmd = "KeyStrokeEnable",
config = function()
require("keystroke").setup({
handlers = {
["i"] = {
sound = {
callback = require("keystroke.sound").play_sound,
options = {
style = "typewriter",
-- style = "mario",
},
},
},
["*"] = {},
},
})
end,
}
packer.use({
"jerrywang1981/keystroke.nvim",
config = [[
require"keystroke".setup({
handlers = {
-- insert mode
["i"] = {
-- this is an example or demo, when you input keyword
-- jerry
-- or 1958/06/30
-- it will
-- pop up messages
require"keystroke.keyword".keyword_message,
},
}
})
]]
})
packer.use({
"jerrywang1981/keystroke.nvim",
config = [[
require"keystroke".setup({
handlers = {
-- insert mode
["*"] = {
echopad = {
callback = require"keystroke.echopad".send,
options = {
key_table = {
[32] = "<sp>",
}
}
}
},
}
})
]]
})
packer.use({
"jerrywang1981/keystroke.nvim",
config = [[
require"keystroke".setup({
-- auto start/enable or not, if not, you need to :KeyStrokeEnable to get it work
auto_start = true,
-- handlers for different modes, function with one string parameter
handlers = {
-- insert mode
["i"] = {
-- can be function
require"keystroke.sound".play_sound,
-- or a table with a key and callback/options/enable table as value
-- it will call the function with key as first and options as second parameter
-- callback(key, options)
sound = {
enable = true, -- enable handler or not
callback = require"keystroke.sound".play_sound,
options = {
-- the sound style, valid value: default/bubble/mario/sword/typewriter
style = "default",
}
},
-- this is an example or demo, when you input keyword jerry or 1958/06/30 , it will
-- pop up messages
require"keystroke.keyword".keyword_message,
},
-- normal mode
["n"] = {
},
-- all modes
["*"] = {}
}
})
]]
})
:KeyStrokeEnable
:KeyStrokeDisable
:KeyStrokeToggle
KeyStroke enable sound
KeyStroke disable sound
KeyStroke toggle sound
to get more help
:help keystroke.txt
MIT License