docs(examples): add `fn` example

pull/36/head
Iron-E 6 months ago
parent 12023174a6
commit 67390e8393
No known key found for this signature in database
GPG Key ID: 569E791B76A42A1A

@ -22,7 +22,7 @@ local fooModeKeymaps =
y = function(self) y = function(self)
self:switch('Bar', barModeKeymaps) -- enters Bar and then exits Foo when it is done self:switch('Bar', barModeKeymaps) -- enters Bar and then exits Foo when it is done
end, end,
z = libmodal.mode.switch('Bar', barModeKeymaps), -- the same as above, but more convenience z = libmodal.mode.map.switch('Bar', barModeKeymaps), -- the same as above, but more convenience
} }
-- tell the mode not to exit automatically -- tell the mode not to exit automatically

@ -24,7 +24,9 @@ local fooModeKeymaps =
o = 'norm o', o = 'norm o',
p = 'bp', p = 'bp',
zf = 'split', x = libmodal.mode.map.fn(vim.notify, 'hello'),
zf = libmodal.mode.map.fn(vim.cmd.split),
zfc = 'q', zfc = 'q',
zff = split_twice, zff = split_twice,
zfo = 'vsplit', zfo = 'vsplit',

Loading…
Cancel
Save