dotsync 0.1.25 → 0.1.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 793ae0a7e00707a97255d631304eddae60e6ce6224d8c4d85c9550f54cbd59bd
4
- data.tar.gz: 34fdbefc7f9b27a2f7fedd8dcbac9748ae59c99fb7cb15a970ebc67605e5ebe1
3
+ metadata.gz: 6d2cef06dff635c8202f87424d1532d0db5cfdf7e26e1c0c98daee44acdd12e4
4
+ data.tar.gz: 38484cab4e99854a8b54259e222ace225834000c9d9a6df8005dff8b1baa228c
5
5
  SHA512:
6
- metadata.gz: 50471dd7fca75246adb01dd946b17dc217b590cc0df359253f608f4868ae190c08aeb5ce5c9302dafa2533f368c69f35b1f9b3f70143ed36066745729904030b
7
- data.tar.gz: 2061b3db4dfb07aaec4750efba675091797ce8ebcb9979ce37ffca5e1b838f20d2ebec181925c45d5a0a6c52d4681d05f989953f4022540c0a6705dc8fc6dd76
6
+ metadata.gz: 22d5fe759b17a723377363c22f05f77cedf57fd6ac41b4c8d379c2f2b2bf4fb42022a0c92707083356a096385fe51b1175c9865fb1f78fde58ba41b94be9fa17
7
+ data.tar.gz: 3fb40ad4ac4835cf0c3a45e8bb3d872197dc60bb79d04b8a6ff09d5626d6b92f63865b035d5eb7cc923f12319b4651e08ffe36e808296d002f88712e5bc54730
@@ -1,4 +1,4 @@
1
- name: Ruby Gem
1
+ name: CI
2
2
 
3
3
  on:
4
4
  push:
@@ -0,0 +1,50 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ permissions:
9
+ contents: write
10
+
11
+ jobs:
12
+ release:
13
+ runs-on: ubuntu-latest
14
+
15
+ steps:
16
+ - name: Checkout code
17
+ uses: actions/checkout@v6
18
+
19
+ - name: Get version from tag
20
+ id: version
21
+ run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
22
+
23
+ - name: Extract changelog for version
24
+ id: changelog
25
+ run: |
26
+ # Extract the section for this version from CHANGELOG.md
27
+ # Matches from "## [X.Y.Z]" until the next "## [" or end of file
28
+ VERSION="${{ steps.version.outputs.version }}"
29
+ CHANGELOG=$(awk -v ver="$VERSION" '
30
+ /^## \[/ {
31
+ if (found) exit
32
+ if ($0 ~ "\\[" ver "\\]") found=1
33
+ }
34
+ found { print }
35
+ ' CHANGELOG.md | tail -n +2)
36
+
37
+ # Use heredoc for multiline output
38
+ echo "content<<EOF" >> $GITHUB_OUTPUT
39
+ echo "$CHANGELOG" >> $GITHUB_OUTPUT
40
+ echo "EOF" >> $GITHUB_OUTPUT
41
+
42
+ - name: Create GitHub Release
43
+ uses: softprops/action-gh-release@v2
44
+ with:
45
+ name: v${{ steps.version.outputs.version }}
46
+ body: ${{ steps.changelog.outputs.content }}
47
+ draft: false
48
+ prerelease: false
49
+ env:
50
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
data/.gitignore CHANGED
@@ -9,3 +9,5 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+
13
+ .claude/
@@ -0,0 +1,9 @@
1
+ repos:
2
+ - repo: local
3
+ hooks:
4
+ - id: rubocop
5
+ name: rubocop
6
+ entry: bundle exec rubocop --autocorrect --force-exclusion
7
+ language: system
8
+ types: [ruby]
9
+ pass_filenames: true
data/CHANGELOG.md CHANGED
@@ -1,4 +1,36 @@
1
- # 0.1.25
1
+ ## [0.1.26] - 2025-01-11
2
+
3
+ **Breaking Changes:**
4
+ - The explicit sync mapping syntax has changed from `[[sync]]` to `[[sync.mappings]]`
5
+ - Old: `[[sync]]` with `local`/`remote` keys
6
+ - New: `[[sync.mappings]]` with `local`/`remote` keys
7
+ - This allows combining explicit mappings with XDG shorthands in the same config
8
+ - See README for migration examples
9
+
10
+ **New Features:**
11
+ - Add bidirectional `[[sync.mappings]]` DSL for two-way synchronization
12
+ - Simplified syntax replaces separate push/pull mappings
13
+ - Automatic expansion to bidirectional mappings (local ↔ remote)
14
+ - Supports all existing options: `force`, `only`, `ignore`
15
+ - Add XDG shorthand DSL for sync mappings
16
+ - `[[sync.home]]` - syncs $HOME ↔ $HOME_MIRROR
17
+ - `[[sync.xdg_config]]` - syncs $XDG_CONFIG_HOME ↔ $XDG_CONFIG_HOME_MIRROR
18
+ - `[[sync.xdg_data]]` - syncs $XDG_DATA_HOME ↔ $XDG_DATA_HOME_MIRROR
19
+ - `[[sync.xdg_cache]]` - syncs $XDG_CACHE_HOME ↔ $XDG_CACHE_HOME_MIRROR
20
+ - `[[sync.xdg_bin]]` - syncs $XDG_BIN_HOME ↔ $XDG_BIN_HOME_MIRROR (new)
21
+ - Use `path` for specific subdirectories or `only` for multiple paths
22
+ - Fix custom config path (`-c` flag) not being applied to Runner
23
+
24
+ **Documentation:**
25
+ - Document bidirectional sync mappings with examples
26
+ - Document XDG shorthand DSL with usage examples
27
+ - Update README with new configuration options and supported shorthands table
28
+
29
+ **Infrastructure:**
30
+ - Rename GitHub workflow to ci.yml
31
+ - Add sync_mappings concern to push and pull loaders
32
+
33
+ ## [0.1.25]
2
34
 
3
35
  **Features:**
4
36
  - Add support for file-specific paths in 'only' configuration option
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dotsync (0.1.25)
4
+ dotsync (0.1.27)
5
5
  fileutils (~> 1.7.3)
6
6
  find (~> 0.2.0)
7
7
  listen (~> 3.9.0)
data/README.md CHANGED
@@ -13,7 +13,8 @@
13
13
  Dotsync is a powerful Ruby gem for managing and synchronizing your dotfiles across machines. Whether you're setting up a new development environment or keeping configurations in sync, Dotsync makes it effortless.
14
14
 
15
15
  **Key Features:**
16
- - **Bidirectional Sync**: Push local dotfiles to your repository or pull from repository to local machine
16
+ - **Bidirectional Sync Mappings**: Define once, sync both ways eliminates config duplication with `[[sync.mappings]]` syntax
17
+ - **XDG Shorthand DSL**: Concise `[[sync.home]]`, `[[sync.xdg_config]]`, `[[sync.xdg_data]]`, `[[sync.xdg_bin]]` syntax for common directory patterns
17
18
  - **Preview Mode**: See what changes would be made before applying them (dry-run by default)
18
19
  - **Smart Filtering**: Use `force`, `only`, and `ignore` options to precisely control what gets synced
19
20
  - **Automatic Backups**: Pull operations create timestamped backups for easy recovery
@@ -29,6 +30,9 @@ Dotsync is a powerful Ruby gem for managing and synchronizing your dotfiles acro
29
30
  - [Usage](#usage)
30
31
  - [Executable Commands](#executable-commands)
31
32
  - [Configuration](#configuration)
33
+ - [Bidirectional Sync Mappings (Recommended)](#bidirectional-sync-mappings-recommended)
34
+ - [Alternative: Unidirectional Mappings](#alternative-unidirectional-mappings)
35
+ - [Mapping Options (force, only, ignore)](#force-only-and-ignore-options-in-mappings)
32
36
  - [Safety Features](#safety-features)
33
37
  - [Customizing Icons](#customizing-icons)
34
38
  - [Automatic Update Checks](#automatic-update-checks)
@@ -76,22 +80,29 @@ Get started with Dotsync in just a few steps:
76
80
  ```
77
81
  This creates `~/.config/dotsync.toml` with example mappings.
78
82
 
79
- 3. **Edit the configuration** (`~/.config/dotsync.toml`) to define your dotfile mappings:
83
+ 3. **Edit the configuration** (`~/.config/dotsync.toml`) to define your dotfile mappings using bidirectional sync:
80
84
  ```toml
81
- [[pull.mappings]]
82
- src = "$HOME/dotfiles/config"
83
- dest = "$HOME/.config"
85
+ # Sync your shell config
86
+ [[sync.home]]
87
+ path = ".zshenv"
88
+
89
+ # Sync XDG config directories
90
+ [[sync.xdg_config]]
91
+ only = ["nvim", "alacritty", "zsh", "git"]
92
+ force = true
84
93
  ```
85
94
 
86
95
  4. **Preview your changes** (dry-run mode):
87
96
  ```shell
88
- dotsync pull
97
+ dotsync pull # Preview pulling from repo to local
98
+ dotsync push # Preview pushing from local to repo
89
99
  ```
90
100
  This shows what would be changed without modifying any files.
91
101
 
92
102
  5. **Apply changes** when you're ready:
93
103
  ```shell
94
- dotsync pull --apply
104
+ dotsync pull --apply # Apply repo → local
105
+ dotsync push --apply # Apply local → repo
95
106
  ```
96
107
 
97
108
  ## Usage
@@ -127,7 +138,7 @@ Dotsync provides the following commands to manage your dotfiles:
127
138
  ```shell
128
139
  dotsync watch [OPTIONS]
129
140
  ```
130
-
141
+
131
142
  The watch command supports the same output control options as push and pull (e.g., `--quiet`, `--no-legend`, `--no-mappings`).
132
143
 
133
144
  - **Setup** (alias: **init**): Generate a default configuration file at `~/.config/dotsync.toml` with example mappings for `pull`, `push`, and `watch`.
@@ -212,53 +223,162 @@ dotsync watch --quiet # Watch with minimal output
212
223
 
213
224
  ### Configuration
214
225
 
215
- The configuration file uses a `mappings` structure to define the source and destination of your dotfiles. Here is an example:
226
+ Dotsync uses TOML configuration files to define mappings between your local machine and your dotfiles repository. The recommended approach is **bidirectional sync mappings**, which eliminate duplication and keep your config clean.
227
+
228
+ > [!TIP]
229
+ > Set up mirror environment variables for cleaner configuration:
230
+ > ```bash
231
+ > # Add to your ~/.zshrc or ~/.bashrc
232
+ > export DOTFILES_DIR="$HOME/Code/dotfiles"
233
+ > export XDG_CONFIG_HOME_MIRROR="$DOTFILES_DIR/xdg_config_home"
234
+ > export XDG_DATA_HOME_MIRROR="$DOTFILES_DIR/xdg_data_home"
235
+ > export HOME_MIRROR="$DOTFILES_DIR/home"
236
+ > ```
237
+
238
+ #### Bidirectional Sync Mappings (Recommended)
239
+
240
+ Use `[[sync]]` mappings to define paths that sync in both directions. This is the **preferred approach** as it eliminates duplication between push and pull configurations.
241
+
242
+ ##### XDG Shorthand Syntax
243
+
244
+ The most concise way to define mappings for standard XDG directories:
216
245
 
217
246
  ```toml
218
- [[pull.mappings]]
219
- src = "$XDG_CONFIG_HOME_MIRROR"
220
- dest = "$XDG_CONFIG_HOME"
221
- ignore = ["nvim"]
247
+ # Sync home directory files
248
+ [[sync.home]]
249
+ path = ".zshenv"
222
250
 
223
- [[pull.mappings]]
224
- src = "$XDG_CONFIG_HOME_MIRROR/nvim"
225
- dest = "$XDG_CONFIG_HOME/nvim"
226
- # FEATURE: forces the deletion of destination folder
251
+ # Sync multiple configs from XDG_CONFIG_HOME
252
+ [[sync.xdg_config]]
253
+ only = ["alacritty", "git", "zsh", "starship.toml"]
254
+ force = true
255
+
256
+ # Sync specific config with custom options
257
+ [[sync.xdg_config]]
258
+ path = "nvim"
227
259
  force = true
228
- # FEATURE: use relative paths to "dest" to ignore files and folders
229
260
  ignore = ["lazy-lock.json"]
230
261
 
231
- [[pull.mappings]]
232
- src = "$HOME_MIRROR/.zshenv"
233
- dest = "$HOME"
262
+ # Sync XDG data directories
263
+ [[sync.xdg_data]]
264
+ path = "git"
265
+ force = true
266
+ ```
234
267
 
268
+ **Supported shorthands:**
235
269
 
236
- [[push.mappings]]
237
- src = "$HOME/.zshenv"
238
- dest = "$HOME_MIRROR/.zshenv"
270
+ | Shorthand | Local | Remote |
271
+ |-----------|-------|--------|
272
+ | `sync.home` | `$HOME` | `$HOME_MIRROR` |
273
+ | `sync.xdg_config` | `$XDG_CONFIG_HOME` | `$XDG_CONFIG_HOME_MIRROR` |
274
+ | `sync.xdg_data` | `$XDG_DATA_HOME` | `$XDG_DATA_HOME_MIRROR` |
275
+ | `sync.xdg_cache` | `$XDG_CACHE_HOME` | `$XDG_CACHE_HOME_MIRROR` |
276
+ | `sync.xdg_bin` | `$XDG_BIN_HOME` | `$XDG_BIN_HOME_MIRROR` |
239
277
 
240
- [[push.mappings]]
241
- src = "$XDG_CONFIG_HOME/alacritty"
242
- dest = "$DOTFILES_DIR/config/alacritty"
243
- # FEATURE: transfer only relative paths of files and folders passed here
244
- only = ["alacritty.toml", "rose-pine.toml"]
278
+ **Options:**
279
+ - `path` (optional): Relative path within the directory. If omitted, syncs the entire directory.
280
+ - `force`, `ignore`, `only`: All standard mapping options are supported.
245
281
 
282
+ ##### Explicit Sync Syntax
246
283
 
247
- [[watch.mappings]]
248
- src = "$HOME/.zshenv"
249
- dest = "$HOME_MIRROR/.zshenv"
284
+ For custom paths that don't follow XDG conventions, use explicit `[[sync.mappings]]` entries:
285
+
286
+ ```toml
287
+ [[sync.mappings]]
288
+ local = "$XDG_CONFIG_HOME/nvim"
289
+ remote = "$XDG_CONFIG_HOME_MIRROR/nvim"
290
+ force = true
291
+ ignore = ["lazy-lock.json"]
292
+
293
+ [[sync.mappings]]
294
+ local = "$HOME/.zshenv"
295
+ remote = "$HOME_MIRROR/.zshenv"
296
+
297
+ # Sync config file to a different location in repo
298
+ [[sync.mappings]]
299
+ local = "$XDG_CONFIG_HOME/dotsync.toml"
300
+ remote = "$XDG_CONFIG_HOME_MIRROR/dotsync/dotsync.macbook.toml"
301
+ ```
302
+
303
+ **How it works:**
304
+ - `local` is your local machine path (e.g., `~/.config/nvim`)
305
+ - `remote` is your dotfiles repository path (e.g., `~/dotfiles/config/nvim`)
306
+ - For **push** operations: `local` → `remote`
307
+ - For **pull** operations: `remote` → `local`
308
+ - All standard options (`force`, `ignore`, `only`) are supported
309
+
310
+ ##### Complete Example
311
+
312
+ Here's a real-world configuration using bidirectional sync:
313
+
314
+ ```toml
315
+ ## BIDIRECTIONAL SYNC CONFIGURATION
316
+
317
+ # Home directory files
318
+ [[sync.home]]
319
+ path = ".zshenv"
320
+
321
+ # Bulk sync multiple configs
322
+ [[sync.xdg_config]]
323
+ only = [
324
+ "alacritty",
325
+ "brewfile",
326
+ "git",
327
+ "lazygit",
328
+ "tmux",
329
+ "zellij",
330
+ "starship.toml"
331
+ ]
332
+ force = true
333
+
334
+ # Zsh with ignored files
335
+ [[sync.xdg_config]]
336
+ path = "zsh"
337
+ ignore = [".zsh_sessions", ".zsh_history", ".zcompdump"]
338
+
339
+ # Neovim with force sync
340
+ [[sync.xdg_config]]
341
+ path = "nvim"
342
+ force = true
343
+ ignore = ["lazy-lock.json"]
344
+
345
+ # Git templates in data directory
346
+ [[sync.xdg_data]]
347
+ path = "git"
348
+ force = true
349
+
350
+ # This config file itself
351
+ [[sync.mappings]]
352
+ local = "$XDG_CONFIG_HOME/dotsync.toml"
353
+ remote = "$XDG_CONFIG_HOME_MIRROR/dotsync/dotsync.macbook.toml"
354
+ ```
355
+
356
+ #### Alternative: Unidirectional Mappings
357
+
358
+ For asymmetric sync scenarios where push and pull need different configurations, you can use separate `[[push.mappings]]` and `[[pull.mappings]]` sections:
250
359
 
360
+ ```toml
361
+ # Pull from repo to local (repo → local)
362
+ [[pull.mappings]]
363
+ src = "$XDG_CONFIG_HOME_MIRROR/nvim"
364
+ dest = "$XDG_CONFIG_HOME/nvim"
365
+ force = true
366
+ ignore = ["lazy-lock.json"]
367
+
368
+ # Push from local to repo (local → repo)
369
+ [[push.mappings]]
370
+ src = "$XDG_CONFIG_HOME/alacritty"
371
+ dest = "$XDG_CONFIG_HOME_MIRROR/alacritty"
372
+ only = ["alacritty.toml", "themes"]
373
+
374
+ # Watch for live syncing
251
375
  [[watch.mappings]]
252
- src = "$XDG_CONFIG_HOME/alacritty"
253
- dest = "$DOTFILES_DIR/config/alacritty"
376
+ src = "$XDG_CONFIG_HOME/nvim"
377
+ dest = "$XDG_CONFIG_HOME_MIRROR/nvim"
254
378
  ```
255
379
 
256
- > [!TIP]
257
- > I use mirror environment variables to cleaner configuration
258
- >
259
- > ```bash
260
- > export XDG_CONFIG_HOME_MIRROR="$HOME/Code/dotfiles/xdg_config_home"
261
- > ```
380
+ > [!NOTE]
381
+ > You can mix `[[sync.mappings]]`, XDG shorthands (`[[sync.home]]`, `[[sync.xdg_config]]`, etc.), and `[[push.mappings]]`/`[[pull.mappings]]` in the same config file. Use bidirectional sync for symmetric mappings and unidirectional for special cases.
262
382
 
263
383
  #### `force`, `only`, and `ignore` Options in Mappings
264
384
 
@@ -270,9 +390,8 @@ A boolean (true/false) value. When set to `true`, it forces deletion of files in
270
390
 
271
391
  **Example:**
272
392
  ```toml
273
- [[pull.mappings]]
274
- src = "$XDG_CONFIG_HOME_MIRROR/nvim"
275
- dest = "$XDG_CONFIG_HOME/nvim"
393
+ [[sync.xdg_config]]
394
+ path = "nvim"
276
395
  force = true
277
396
  ignore = ["lazy-lock.json"]
278
397
  ```
@@ -293,41 +412,34 @@ An array of relative paths (files or directories) to selectively transfer from t
293
412
 
294
413
  **Example 1: Selecting specific directories**
295
414
  ```toml
296
- [[push.mappings]]
297
- src = "$XDG_CONFIG_HOME"
298
- dest = "$DOTFILES_DIR/config"
415
+ [[sync.xdg_config]]
299
416
  only = ["nvim", "alacritty", "zsh"]
300
417
  ```
301
418
  This transfers only the `nvim/`, `alacritty/`, and `zsh/` directories.
302
419
 
303
420
  **Example 2: Selecting specific files**
304
421
  ```toml
305
- [[push.mappings]]
306
- src = "$XDG_CONFIG_HOME/alacritty"
307
- dest = "$DOTFILES_DIR/config/alacritty"
422
+ [[sync.xdg_config]]
423
+ path = "alacritty"
308
424
  only = ["alacritty.toml", "rose-pine.toml"]
309
425
  ```
310
426
  This transfers only two specific TOML files from the alacritty config directory.
311
427
 
312
428
  **Example 3: Selecting files inside nested directories**
313
429
  ```toml
314
- [[push.mappings]]
315
- src = "$HOME/.config"
316
- dest = "$DOTFILES_DIR/config"
430
+ [[sync.xdg_config]]
317
431
  only = ["bundle/config", "ghc/ghci.conf", "cabal/config"]
318
432
  ```
319
433
  This transfers only specific configuration files from different subdirectories:
320
434
  - `bundle/config` file from the `bundle/` directory
321
- - `ghc/ghci.conf` file from the `ghc/` directory
435
+ - `ghc/ghci.conf` file from the `ghc/` directory
322
436
  - `cabal/config` file from the `cabal/` directory
323
437
 
324
438
  The parent directories (`bundle/`, `ghc/`, `cabal/`) are created automatically in the destination, but other files in those directories are not transferred.
325
439
 
326
440
  **Example 4: Deeply nested paths**
327
441
  ```toml
328
- [[push.mappings]]
329
- src = "$XDG_CONFIG_HOME"
330
- dest = "$DOTFILES_DIR/config"
442
+ [[sync.xdg_config]]
331
443
  only = ["nvim/lua/plugins/init.lua", "nvim/lua/config/settings.lua"]
332
444
  ```
333
445
  This transfers only specific Lua files from deeply nested paths within the nvim configuration.
@@ -343,17 +455,15 @@ An array of relative paths or patterns to exclude during transfer. This allows y
343
455
 
344
456
  **Example:**
345
457
  ```toml
346
- [[pull.mappings]]
347
- src = "$XDG_CONFIG_HOME_MIRROR/nvim"
348
- dest = "$XDG_CONFIG_HOME/nvim"
458
+ [[sync.xdg_config]]
459
+ path = "nvim"
349
460
  ignore = ["lazy-lock.json", "plugin/packer_compiled.lua"]
350
461
  ```
351
462
 
352
463
  **Combining options:**
353
464
  ```toml
354
- [[push.mappings]]
355
- src = "$XDG_CONFIG_HOME/nvim"
356
- dest = "$DOTFILES_DIR/config/nvim"
465
+ [[sync.xdg_config]]
466
+ path = "nvim"
357
467
  only = ["lua", "init.lua"]
358
468
  ignore = ["lua/plugin/packer_compiled.lua"]
359
469
  force = true
@@ -426,7 +536,7 @@ By default, all `push` and `pull` commands run in preview mode:
426
536
 
427
537
  Dotsync provides clear, actionable error messages for common issues:
428
538
 
429
- - **Permission Errors**:
539
+ - **Permission Errors**:
430
540
  ```
431
541
  Permission denied: /path/to/file
432
542
  Try: chmod +w <path> or check file permissions
@@ -496,10 +606,8 @@ diff_created = "✨" # New files created
496
606
  diff_updated = "📝" # Files modified
497
607
  diff_removed = "🗑️ " # Files deleted
498
608
 
499
- # Example mappings section
500
- [[pull.mappings]]
501
- src = "$XDG_CONFIG_HOME_MIRROR"
502
- dest = "$XDG_CONFIG_HOME"
609
+ # Example sync mapping
610
+ [[sync.xdg_config]]
503
611
  ignore = ["cache"]
504
612
  ```
505
613
 
@@ -550,10 +658,10 @@ The check runs after your command completes and uses a cached timestamp to avoid
550
658
  ```bash
551
659
  # Work dotfiles
552
660
  dotsync -c ~/work-dotfiles.toml push --apply
553
-
661
+
554
662
  # Personal dotfiles
555
663
  dotsync -c ~/.config/personal.toml pull --apply
556
-
664
+
557
665
  # Server configs
558
666
  dotsync --config ~/server.toml push --apply
559
667
  ```
@@ -562,7 +670,7 @@ The check runs after your command completes and uses a cached timestamp to avoid
562
670
  ```shell
563
671
  # In a script or CI/CD pipeline
564
672
  dotsync pull --apply --yes --quiet
565
-
673
+
566
674
  # Shorthand
567
675
  dotsync push -ayq
568
676
  ```
@@ -604,14 +712,13 @@ The check runs after your command completes and uses a cached timestamp to avoid
604
712
 
605
713
  ## Common Use Cases
606
714
 
607
- Here are some practical examples of how to use Dotsync for popular configuration files:
715
+ Here are practical examples using bidirectional sync for popular configuration files:
608
716
 
609
717
  ### Syncing Neovim Configuration
610
718
 
611
719
  ```toml
612
- [[pull.mappings]]
613
- src = "$HOME/dotfiles/config/nvim"
614
- dest = "$HOME/.config/nvim"
720
+ [[sync.xdg_config]]
721
+ path = "nvim"
615
722
  force = true
616
723
  ignore = ["lazy-lock.json", ".luarc.json"]
617
724
  ```
@@ -619,31 +726,49 @@ ignore = ["lazy-lock.json", ".luarc.json"]
619
726
  ### Syncing Terminal Emulator (Alacritty)
620
727
 
621
728
  ```toml
622
- [[push.mappings]]
623
- src = "$HOME/.config/alacritty"
624
- dest = "$HOME/dotfiles/config/alacritty"
729
+ [[sync.xdg_config]]
730
+ path = "alacritty"
625
731
  only = ["alacritty.toml", "themes"]
626
732
  ```
627
733
 
628
734
  ### Syncing Shell Configuration
629
735
 
630
736
  ```toml
631
- [[pull.mappings]]
632
- src = "$HOME/dotfiles/shell/.zshrc"
633
- dest = "$HOME"
737
+ [[sync.home]]
738
+ path = ".zshenv"
634
739
 
635
- [[pull.mappings]]
636
- src = "$HOME/dotfiles/shell/.zshenv"
637
- dest = "$HOME"
740
+ [[sync.xdg_config]]
741
+ path = "zsh"
742
+ ignore = [".zsh_sessions", ".zsh_history", ".zcompdump"]
638
743
  ```
639
744
 
640
745
  ### Syncing Multiple Config Directories
641
746
 
642
747
  ```toml
643
- [[pull.mappings]]
644
- src = "$HOME/dotfiles/config"
645
- dest = "$HOME/.config"
646
- ignore = ["nvim", "cache", "*.log"]
748
+ [[sync.xdg_config]]
749
+ only = ["nvim", "alacritty", "git", "zsh", "tmux", "starship.toml"]
750
+ force = true
751
+ ```
752
+
753
+ ### Per-Machine Configuration Files
754
+
755
+ Use different config files for different machines:
756
+
757
+ ```toml
758
+ # In dotsync.macbook.toml
759
+ [[sync.mappings]]
760
+ local = "$XDG_CONFIG_HOME/dotsync.toml"
761
+ remote = "$XDG_CONFIG_HOME_MIRROR/dotsync/dotsync.macbook.toml"
762
+
763
+ # In dotsync.work.toml
764
+ [[sync.mappings]]
765
+ local = "$XDG_CONFIG_HOME/dotsync.toml"
766
+ remote = "$XDG_CONFIG_HOME_MIRROR/dotsync/dotsync.work.toml"
767
+ ```
768
+
769
+ Then use `-c` flag to select the appropriate config:
770
+ ```shell
771
+ dotsync -c ~/.config/dotsync/dotsync.macbook.toml push --apply
647
772
  ```
648
773
 
649
774
  ## Troubleshooting
@@ -652,7 +777,7 @@ ignore = ["nvim", "cache", "*.log"]
652
777
 
653
778
  **Problem**: Icons appear as boxes, question marks, or strange characters.
654
779
 
655
- **Solution**:
780
+ **Solution**:
656
781
  - Install a [Nerd Font](https://www.nerdfonts.com/) and configure your terminal to use it
657
782
  - Or customize icons in `~/.config/dotsync.toml` using UTF-8 emojis or regular characters:
658
783
  ```toml