2020-08-27 16:10:01 +00:00
|
|
|
|
-- Imports
|
2020-05-11 18:17:58 +00:00
|
|
|
|
local libmodal = require('libmodal')
|
2020-08-27 16:10:01 +00:00
|
|
|
|
|
|
|
|
|
-- Register key commands and what they do.
|
2020-05-15 02:12:15 +00:00
|
|
|
|
local fooModeCombos = {
|
2020-05-11 18:17:58 +00:00
|
|
|
|
[''] = 'echom "You cant exit using escape."',
|
2020-05-15 02:12:15 +00:00
|
|
|
|
['q'] = 'let g:fooModeExit = 1'
|
2020-05-11 18:17:58 +00:00
|
|
|
|
}
|
2020-05-08 17:18:01 +00:00
|
|
|
|
|
2020-08-27 16:10:01 +00:00
|
|
|
|
-- Tell the mode not to exit automatically.
|
2020-05-15 02:12:15 +00:00
|
|
|
|
vim.api.nvim_set_var('fooModeExit', 0)
|
2020-08-27 16:10:01 +00:00
|
|
|
|
|
|
|
|
|
-- Enter the mode using the key combos created before.
|
2020-05-15 02:12:15 +00:00
|
|
|
|
libmodal.mode.enter('FOO', fooModeCombos, true)
|