Configure synchronization of files and directories through a plugin.
made it more clear that folders get expanded
3 files changed, +12 -9
+10-7README.md
| @@ -14,6 +14,7 @@ A lightweight Neovim plugin that keeps directories in sync using `inotifywait`, | ||
| 14 | 14 | - Reverse sync on startup (optional) |
| 15 | 15 | - Logs and restarts lost watchers automatically |
| 16 | 16 | - Fully typed config for autocompletion and inline docs |
| 17 | +- Automatically expands paths in the config | |
| 17 | 18 | |
| 18 | 19 | ## Requirements |
| 19 | 20 | |
| @@ -34,7 +35,7 @@ Using [lazy.nvim](https://github.com/folke/lazy.nvim): | ||
| 34 | 35 | name = "syncmap.nvim", |
| 35 | 36 | opts = { |
| 36 | 37 | map = { |
| 37 | - { vim.fn.expand("~/.dotfiles/test/"), vim.fn.expand("~/.config/test/") }, | |
| 38 | + { "~/.dotfiles/test/", "~/.config/test/" }, | |
| 38 | 39 | }, |
| 39 | 40 | log_level = "info", |
| 40 | 41 | }, |
| @@ -46,7 +47,7 @@ Using [lazy.nvim](https://github.com/folke/lazy.nvim): | ||
| 46 | 47 | ```lua |
| 47 | 48 | { |
| 48 | 49 | map = { |
| 49 | - { vim.fn.expand("~/.dotfiles/nvim/"), vim.fn.expand("~/.config/nvim/") }, | |
| 50 | + { "~/.dotfiles/nvim/", "~/.config/nvim/" }, | |
| 50 | 51 | }, |
| 51 | 52 | reverse_sync_on_startup = true, |
| 52 | 53 | rsync = { "-a", "--delete" }, |
| @@ -69,8 +70,8 @@ return { | ||
| 69 | 70 | ---@type SyncmapOpts |
| 70 | 71 | opts = { |
| 71 | 72 | map = { |
| 72 | - { vim.fn.expand("~/.dotfiles/nvim/"), vim.fn.expand("~/.config/nvim/") }, | |
| 73 | - { vim.fn.expand("~/.dotfiles/tmux/"), vim.fn.expand("~/.config/tmux/") }, | |
| 73 | + { "~/.dotfiles/nvim/", "~/.config/nvim/" }, | |
| 74 | + { "~/.dotfiles/tmux/", "~/.config/tmux/" }, | |
| 74 | 75 | }, |
| 75 | 76 | }, |
| 76 | 77 | } |
| @@ -90,14 +91,16 @@ return { | ||
| 90 | 91 | ---@type SyncmapOpts |
| 91 | 92 | opts = { |
| 92 | 93 | map = { |
| 93 | - { vim.fn.expand("~/.dotfiles/nvim/"), vim.fn.expand("~/.config/nvim/") }, | |
| 94 | - { vim.fn.expand("~/.dotfiles/tmux/"), vim.fn.expand("~/.config/tmux/") }, | |
| 94 | + { "~/.dotfiles/nvim/", "~/.config/nvim/" }, | |
| 95 | + { "~/.dotfiles/tmux/", "~/.config/tmux/" }, | |
| 95 | 96 | }, |
| 96 | 97 | }, |
| 97 | 98 | } |
| 98 | 99 | } |
| 99 | 100 | ``` |
| 100 | 101 | |
| 102 | +## Type Sample | |
| 103 | + | |
| 101 | 104 |  |
| 102 | 105 | |
| 103 | 106 | This gives you full visibility into available options and correct types. |
| @@ -109,7 +112,7 @@ This gives you full visibility into available options and correct types. | ||
| 109 | 112 | ```txt |
| 110 | 113 | MIT License |
| 111 | 114 | |
| 112 | -Copyright (c) 2025 Huncho | |
| 115 | +Copyright (c) 2025 huncholane | |
| 113 | 116 | |
| 114 | 117 | Permission is hereby granted, free of charge, to any person obtaining a copy |
| 115 | 118 | of this software and associated documentation files (the "Software"), to deal |
+0-0doc/type.png
Binary file changed.
+2-2lua/syncmap/types.lua
| @@ -26,7 +26,7 @@ | ||
| 26 | 26 | |
| 27 | 27 | ---A match to use for syncing using files or folders. |
| 28 | 28 | --- |
| 29 | ----Ex: `{vim.fn.expand("~/.dotfiles/nvim/"), vim.fn.expand("~/.config/nvim/")}` sync everything within `~/.dotfiles/nvim` into `~/.config/nvim/` | |
| 29 | +---Ex: `{"~/.dotfiles/nvim/", "~/.config/nvim/"}` sync everything within `~/.dotfiles/nvim/` into `~/.config/nvim/` | |
| 30 | 30 | ---@class SyncmapConfigMatch |
| 31 | 31 | ---@field [1] RsyncPath @[required] Path to sync from |
| 32 | 32 | ---@field [2] RsyncPath @[required] Path to sync to |
| @@ -36,7 +36,7 @@ | ||
| 36 | 36 | |
| 37 | 37 | ---Configurations for syncmap |
| 38 | 38 | ---@class SyncmapOpts |
| 39 | ----@field map? SyncmapConfigMatch[] @[default=~/.dotfiles/nvim/ ~/.config/nvim] The folders and files to keep synchronized | |
| 39 | +---@field map? SyncmapConfigMatch[] @[default=~/.dotfiles/nvim/ ~/.config/nvim/] The folders and files to keep synchronized | |
| 40 | 40 | ---@field reverse_sync_on_startup? ReverseSyncOnSpawn |
| 41 | 41 | ---@field rsync? RsyncFlag[] @[default={"-a", "--delete"}] Rsync flags that will be used if a map item doesn't include anything. I.E. Default flags |
| 42 | 42 | ---@field log_level? LogLevel @[default="error"] Sets the log level for syncmap |