diff options
author | Gregory Anders <8965202+gpanders@users.noreply.github.com> | 2023-11-08 09:33:37 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-08 09:33:37 -0600 |
commit | 08847a9ea15a50aba041ee621d71b9884f5fea97 (patch) | |
tree | e6f49ffb4ae072186126968f85d99cd18e9a9e98 /src/nvim/lua/executor.c | |
parent | 1b0fd377aba3b4d076e4dbfb5adb96866a4982d1 (diff) | |
download | rneovim-08847a9ea15a50aba041ee621d71b9884f5fea97.tar.gz rneovim-08847a9ea15a50aba041ee621d71b9884f5fea97.tar.bz2 rneovim-08847a9ea15a50aba041ee621d71b9884f5fea97.zip |
refactor: move defaults into separate module (#25929)
Move default mappings and autocommands into a separate module and add
comments and docstrings to document each of the defaults.
Diffstat (limited to 'src/nvim/lua/executor.c')
-rw-r--r-- | src/nvim/lua/executor.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c index b389f33d8d..36cb8a6756 100644 --- a/src/nvim/lua/executor.c +++ b/src/nvim/lua/executor.c @@ -2291,3 +2291,17 @@ plain: kv_printf(str, "<Lua %d>", ref); return str.items; } + +/// Execute the vim._defaults module to set up default mappings and autocommands +void nlua_init_defaults(void) +{ + lua_State *const L = global_lstate; + assert(L); + + lua_getglobal(L, "require"); + lua_pushstring(L, "vim._defaults"); + if (nlua_pcall(L, 1, 0)) { + os_errmsg(lua_tostring(L, -1)); + os_errmsg("\n"); + } +} |