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
|
|
|
-- a function which will split the window both horizontally and vertically
|
2022-04-25 21:59:33 +00:00
|
|
|
local function split_twice()
|
2021-09-08 19:05:28 +00:00
|
|
|
vim.api.nvim_command 'split'
|
|
|
|
vim.api.nvim_command 'vsplit'
|
2020-09-10 02:35:52 +00:00
|
|
|
end
|
|
|
|
|
2022-04-26 15:33:37 +00:00
|
|
|
-- register keymaps for splitting windows and then closing windows
|
2022-04-25 21:59:33 +00:00
|
|
|
local fooModeKeymaps =
|
|
|
|
{
|
2021-07-07 18:25:14 +00:00
|
|
|
zf = 'split',
|
|
|
|
zfo = 'vsplit',
|
|
|
|
zfc = 'q',
|
2022-04-25 21:59:33 +00:00
|
|
|
zff = split_twice
|
2020-05-11 18:17:58 +00:00
|
|
|
}
|
2020-05-08 17:18:01 +00:00
|
|
|
|
2022-04-26 15:33:37 +00:00
|
|
|
-- enter the mode using the keymaps
|
2022-04-25 21:59:33 +00:00
|
|
|
libmodal.mode.enter('FOO', fooModeKeymaps)
|