nvim-libmodal/examples/lua/keymaps-supress-exit.lua

15 lines
354 B
Lua
Raw Normal View History

local libmodal = require 'libmodal'
2020-08-27 16:10:01 +00:00
2022-04-26 15:33:37 +00:00
-- register key commands and what they do
local fooModeKeymaps =
{
[''] = 'echom "You cant exit using escape."',
q = 'let g:fooModeExit = 1'
}
2022-04-26 15:33:37 +00:00
-- tell the mode not to exit automatically
vim.g.fooModeExit = false
2020-08-27 16:10:01 +00:00
2022-04-26 15:33:37 +00:00
-- enter the mode using the keymaps created before
libmodal.mode.enter('FOO', fooModeKeymaps, true)