Configure synchronization of files and directories through a plugin.
fixed some typos
3 files changed, +29 -12
+28-4README.md
| @@ -60,20 +60,44 @@ For inline type hints and autocomplete, annotate your `opts` using: | ||
| 60 | 60 | |
| 61 | 61 | ```lua |
| 62 | 62 | if false then |
| 63 | - require("syncmap.lazy") | |
| 63 | + require("syncmap.types") | |
| 64 | + require("lazy.types") | |
| 64 | 65 | end |
| 65 | ----@type SyncmapLazySpec | |
| 66 | +---@type LazySpec | |
| 66 | 67 | return { |
| 67 | 68 | "huncholane/syncmap.nvim", |
| 69 | + ---@type SyncmapOpts | |
| 68 | 70 | opts = { |
| 69 | 71 | map = { |
| 70 | - { vim.fn.expand("~/.dotfiles/test/"), vim.fn.expand("~/.config/test/") }, | |
| 72 | + { vim.fn.expand("~/.dotfiles/nvim/"), vim.fn.expand("~/.config/nvim/") }, | |
| 73 | + { vim.fn.expand("~/.dotfiles/tmux/"), vim.fn.expand("~/.config/tmux/") }, | |
| 71 | 74 | }, |
| 72 | - log_level = "info", | |
| 73 | 75 | }, |
| 74 | 76 | } |
| 75 | 77 | ``` |
| 76 | 78 | |
| 79 | +or ... | |
| 80 | + | |
| 81 | +```lua | |
| 82 | +if false then | |
| 83 | + require("syncmap.types") | |
| 84 | + require("lazy.types") | |
| 85 | +end | |
| 86 | +return { | |
| 87 | + ---@type LazySpec | |
| 88 | + { | |
| 89 | + "huncholane/syncmap.nvim", | |
| 90 | + ---@type SyncmapOpts | |
| 91 | + opts = { | |
| 92 | + map = { | |
| 93 | + { vim.fn.expand("~/.dotfiles/nvim/"), vim.fn.expand("~/.config/nvim/") }, | |
| 94 | + { vim.fn.expand("~/.dotfiles/tmux/"), vim.fn.expand("~/.config/tmux/") }, | |
| 95 | + }, | |
| 96 | + }, | |
| 97 | + } | |
| 98 | +} | |
| 99 | +``` | |
| 100 | + | |
| 77 | 101 |  |
| 78 | 102 | |
| 79 | 103 | This gives you full visibility into available options and correct types. |
+0-7lua/syncmap/lazy.lua
| @@ -1,7 +0,0 @@ | ||
| 1 | -require("lazy.types") | |
| 2 | - | |
| 3 | ----@class SyncMapOptsWrapper | |
| 4 | ----@field opts? SyncmapOpts | |
| 5 | - | |
| 6 | ----LazyVim Specs for syncmap | |
| 7 | ----@alias SyncmapLazySpec LazySpec|SyncMapOptsWrapper |
+1-1lua/syncmap/rsync.lua
| @@ -12,7 +12,7 @@ function M.run(args) | ||
| 12 | 12 | if vim.v.shell_error ~= 0 then |
| 13 | 13 | log.error(table.concat(cmd, " ") .. " failed:\n" .. result) |
| 14 | 14 | else |
| 15 | - log.info(table.concat(cmd, " ") .. " succed") | |
| 15 | + log.info(table.concat(cmd, " ") .. " succeeded") | |
| 16 | 16 | end |
| 17 | 17 | return result |
| 18 | 18 | end |