diff options
| author | jdhao <jdhao@hotmail.com> | 2023-07-28 22:27:54 +0200 |
|---|---|---|
| committer | jdhao <jdhao@hotmail.com> | 2023-07-28 22:28:36 +0200 |
| commit | e53ee104ec251b11b84045dec7782b9b7a03479f (patch) | |
| tree | 5072e32bdb796384a1233aecbef93aa75aa69408 /init.lua | |
| parent | 671c78df9bc005321d77405dec004d1317e43e0a (diff) | |
feat: move lua conf under lua directory
Diffstat (limited to 'init.lua')
| -rw-r--r-- | init.lua | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -36,8 +36,13 @@ local core_conf_files = { } -- source all the core config files -for _, name in ipairs(core_conf_files) do - local path = string.format("%s/core/%s", vim.fn.stdpath("config"), name) - local source_cmd = "source " .. path - vim.cmd(source_cmd) +for _, file_name in ipairs(core_conf_files) do + if vim.endswith(file_name, 'vim') then + local path = string.format("%s/core/%s", vim.fn.stdpath("config"), file_name) + local source_cmd = "source " .. path + vim.cmd(source_cmd) + else + local module_name, _ = string.gsub(file_name, "%.lua", "") + require(module_name) + end end |
