goolord / alpha-nvim

a lua powered greeter like vim-startify / dashboard-nvim
MIT License
1.82k stars 109 forks source link

Use the Lua API for keymaps if available #125

Closed RobertAudi closed 2 years ago

RobertAudi commented 2 years ago

This allows to use a function as the right hand side of the keymap

goolord commented 2 years ago

https://neovim.io/doc/user/api.html#nvim_set_keymap()

{opts} Optional parameters map: keys are |:map-arguments|, values are booleans (default false). Accepts all |:map-arguments| as keys excluding || but including |noremap| and "desc". Unknown key is an error. "desc" can be used to give a description to the mapping. When called from Lua, also accepts a "callback" key that takes a Lua function to call when the mapping is executed.