nvim-libmodal/examples/lua/submodes.lua

21 lines
398 B
Lua
Raw Normal View History

local libmodal = require('libmodal')
local barModeRecurse = 0
function barMode()
2020-05-13 22:22:25 +00:00
local userInput = string.char(vim.api.nvim_get_var(
'bar' .. tostring(barModeRecurse) .. 'ModeInput'
))
2020-05-13 22:22:25 +00:00
if userInput == 'z' then
barModeRecurse = barModeRecurse + 1
enter()
barModeRecurse = barModeRecurse - 1
end
end
function enter()
libmodal.mode.enter('BAR' .. barModeRecurse, barMode)
end
enter()