You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nvim-libmodal/examples/lua/key-combos-manually.lua

34 lines
613 B
Lua

local api = vim.api
local libmodal = require('libmodal')
local _inputHistory = {}
function _inputHistory:clear(indexToCheck)
if #self >= indexToCheck then
for i, _ in ipairs(self) do
self[i] = nil
end
end
end
4 years ago
function fooMode()
inputHistory[#inputHistory + 1] = string.char(
4 years ago
api.nvim_get_var('fooModeInput')
)
local index = 1
if inputHistory[1] == 'z' then
if inputHistory[2] == 'f' then
if inputHistory[3] == 'o' then
api.nvim_command("echom 'It works!'")
else index = 3
end
else index = 2
end
end
_inputHistory:clear(index)
end
4 years ago
libmodal.mode.enter('FOO', fooMode)