irongit

Configure synchronization of files and directories through a plugin.

syncmap.nvim/lua/syncmap/commands.lua
29 lines629 BLua
1local M = {
2 opts = require("syncmap.default"),
3}
4local state = require("syncmap.state")
5
6function M.setup()
7 vim.api.nvim_create_user_command("Syncmap", function(args)
8 local arg = args.args
9 if arg == "restart" then
10 state.restart()
11 elseif arg == "clean" then
12 state.clean()
13 elseif arg == "active" then
14 state.show_active()
15 elseif arg == "opts" then
16 state.show_opts()
17 else
18 vim.notify("Unknown Syncmap command: " .. arg, vim.log.levels.ERROR)
19 end
20 end, {
21 desc = "Syncmap control command",
22 nargs = 1,
23 complete = function()
24 return { "restart", "clean", "active", "opts" }
25 end,
26 })
27end
28
29return M