Configure synchronization of files and directories through a plugin.
lazy loading everything now
2 files changed, +7 -2
+4-1lua/syncmap/init.lua
| @@ -18,7 +18,10 @@ function M.setup(opts) | ||
| 18 | 18 | M.log.opts = M.opts |
| 19 | 19 | M.commands.opts = M.opts |
| 20 | 20 | M.commands.setup() |
| 21 | - M.state.sync() | |
| 21 | + vim.api.nvim_create_autocmd("User", { | |
| 22 | + pattern = "VeryLazy", | |
| 23 | + callback = M.state.sync, | |
| 24 | + }) | |
| 22 | 25 | end |
| 23 | 26 | |
| 24 | 27 | return M |
+3-1lua/syncmap/log.lua
| @@ -19,7 +19,9 @@ M.log_table = { | ||
| 19 | 19 | ---@param level vim.log.levels |
| 20 | 20 | function M.log(msg, level) |
| 21 | 21 | if level >= M.log_table[M.opts.log_level] then |
| 22 | - vim.notify("[syncmap] " .. msg, level) | |
| 22 | + vim.schedule(function() | |
| 23 | + vim.notify("[syncmap] " .. msg, level) | |
| 24 | + end) | |
| 23 | 25 | end |
| 24 | 26 | end |
| 25 | 27 |