2021-07-07 18:25:14 +00:00
|
|
|
|
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
|
2022-04-25 21:59:33 +00:00
|
|
|
|
local fooModeKeymaps =
|
|
|
|
|
{
|
2020-05-11 18:17:58 +00:00
|
|
|
|
[''] = 'echom "You cant exit using escape."',
|
2021-07-07 18:25:14 +00:00
|
|
|
|
q = 'let g:fooModeExit = 1'
|
2020-05-11 18:17:58 +00:00
|
|
|
|
}
|
2020-05-08 17:18:01 +00:00
|
|
|
|
|
2022-04-26 15:33:37 +00:00
|
|
|
|
-- tell the mode not to exit automatically
|
2021-07-07 18:25:14 +00:00
|
|
|
|
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
|
2022-04-25 21:59:33 +00:00
|
|
|
|
libmodal.mode.enter('FOO', fooModeKeymaps, true)
|