nvim-libmodal/examples/lua/keymaps.lua

20 lines
444 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
-- a function which will split the window both horizontally and vertically
local function split_twice()
vim.api.nvim_command 'split'
vim.api.nvim_command 'vsplit'
end
2022-04-26 15:33:37 +00:00
-- register keymaps for splitting windows and then closing windows
local fooModeKeymaps =
{
zf = 'split',
zfo = 'vsplit',
zfc = 'q',
zff = split_twice
}
2022-04-26 15:33:37 +00:00
-- enter the mode using the keymaps
libmodal.mode.enter('FOO', fooModeKeymaps)