21
submitted 1 year ago by dark776174657273 to c/vim

Does anyone have experience using GNU Stow for managing dot files? I'm especially interested in using it to build a git repo to include my .vimrc file so I can sync it between hosts.

I know I've seen other methods, such as making your home directory a bare git repo, so you can check-in your config files without moving them. There is also the chezmoi golang project.

How do others sync .vimrc between hosts?

you are viewing a single comment's thread
view the rest of the comments
[-] bhagwan 9 points 1 year ago

I’m especially interested in using it to build a git repo to include my .vimrc

I have tried many different ways to manage my dotfiles across different systems, IMHO the best way is using a "git bare" repository, it takes a few minutes to wrap your head around how it works (your entire home being a "selective git repo") but thankfully yadm makes this super easy and once you have it setup properly it's life changing.

What I like the most about it is the fact that there's no more manual trigger commands to copy/symlink the files, you work on the file directly and then commit directly (as your homefolder is essentially the git repo) and here's the best thing any command that works on git works with the yadm bare repo, so you can branch, rebase, revert commits, bisect, etc.

In my dot files I have a simple alias to yadm as follows: dot='/home/bhagwan/dots/yadm/yadm --yadm-repo /home/bhagwan/dots/yadm-repo-priv -C /home/bhagwan' and I use it as git command replacement for the yadm repo, say I want to see diff or status I would execute dot status (or dot diff respectively) and even have zsh command completeion for it with tab.

If nothing else, use yadm just for this quote (from their homepage): When you are away from your own configurations, you are an orphaned refugee in unfamiliar and hostile surroundings :-)

If this peaked your interest, you can also checkout the bootstrap script for the yadm repo from my dotfiles.

[-] Elw 2 points 1 year ago

This is really interesting! I’ve kept a selective repo of my config files for many years and maintained a bootstrap script inside of it that sounds similar, but distinctly different in a couple of ways, from this approach.

My approach has always been to have the actual files in a git directory in my home directory and the bootstrap script builds the symlinks around my system but the actual files still live in the directory. It never occurred to me to make my whole home directory a fit repo, though, and manage the files selectively that way…. Might try that out on this Arch system I just got up and running since the home dir isn’t too big yet

this post was submitted on 07 Jul 2023
21 points (100.0% liked)

VIM - Vi IMproved

1060 readers
10 users here now

For Vim enthusiasts and anyone interested in Vim/Neovim!

"VIM is the greatest editor since the stone chisel." - Dr. Jose Unpingco

#HJKL

founded 1 year ago
MODERATORS