irongit

Configure synchronization of files and directories through a plugin.

made it more clear that folders get expanded

huncholanehuncholaneauthored
parent 5ee7342commit 74b20ed799ca1f8cee27271a4dd5085ded233a48Browse files

3 files changed, +12 -9

+10-7README.md
@@ -14,6 +14,7 @@ A lightweight Neovim plugin that keeps directories in sync using `inotifywait`,
1414 - Reverse sync on startup (optional)
1515 - Logs and restarts lost watchers automatically
1616 - Fully typed config for autocompletion and inline docs
17+- Automatically expands paths in the config
1718
1819 ## Requirements
1920
@@ -34,7 +35,7 @@ Using [lazy.nvim](https://github.com/folke/lazy.nvim):
3435 name = "syncmap.nvim",
3536 opts = {
3637 map = {
37- { vim.fn.expand("~/.dotfiles/test/"), vim.fn.expand("~/.config/test/") },
38+ { "~/.dotfiles/test/", "~/.config/test/" },
3839 },
3940 log_level = "info",
4041 },
@@ -46,7 +47,7 @@ Using [lazy.nvim](https://github.com/folke/lazy.nvim):
4647 ```lua
4748 {
4849 map = {
49- { vim.fn.expand("~/.dotfiles/nvim/"), vim.fn.expand("~/.config/nvim/") },
50+ { "~/.dotfiles/nvim/", "~/.config/nvim/" },
5051 },
5152 reverse_sync_on_startup = true,
5253 rsync = { "-a", "--delete" },
@@ -69,8 +70,8 @@ return {
6970 ---@type SyncmapOpts
7071 opts = {
7172 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/" },
7475 },
7576 },
7677 }
@@ -90,14 +91,16 @@ return {
9091 ---@type SyncmapOpts
9192 opts = {
9293 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/" },
9596 },
9697 },
9798 }
9899 }
99100 ```
100101
102+## Type Sample
103+
101104 ![type-sample](./doc/type.png)
102105
103106 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.
109112 ```txt
110113 MIT License
111114
112-Copyright (c) 2025 Huncho
115+Copyright (c) 2025 huncholane
113116
114117 Permission is hereby granted, free of charge, to any person obtaining a copy
115118 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 @@
2626
2727 ---A match to use for syncing using files or folders.
2828 ---
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/`
3030 ---@class SyncmapConfigMatch
3131 ---@field [1] RsyncPath @[required] Path to sync from
3232 ---@field [2] RsyncPath @[required] Path to sync to
@@ -36,7 +36,7 @@
3636
3737 ---Configurations for syncmap
3838 ---@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
4040 ---@field reverse_sync_on_startup? ReverseSyncOnSpawn
4141 ---@field rsync? RsyncFlag[] @[default={"-a", "--delete"}] Rsync flags that will be used if a map item doesn't include anything. I.E. Default flags
4242 ---@field log_level? LogLevel @[default="error"] Sets the log level for syncmap