I am using git submodules and git bare repository to maintain my dotfiles.
alias config='/usr/bin/git --git-dir=$HOME/dotfiles/ --work-tree=$HOME'
echo "dotfiles" >> .gitignore
git clone --bare https://github.com/svaderia/dotfiles $HOME/dotfiles
# Checkout config from bare repository to home
# if you get error, take backup of all the files
config checkout
config config --local status.showUntrackedFiles no
# When you are first initialising the submodules on a new system, run below command
config submodule update --init --recursive
# Reload the shell before doing below
# Don't forget to change the local_profile.zsh and local_alias.zsh to set the new paths
cp $ZSH_CUSTOM/setup.zsh.example $ZSH_CUSTOM/00-setup.zsh
touch $ZSH_CUSTOM/02-local_profile.zsh
touch $ZSH_CUSTOM/04-local_alias.zsh
# Optional
## Use following to update your git name and email
## TODO: This can be moved to a global variable in profile.zsh
git config --global user.name "svaderia"
git config --global user.email "<email>"
git config --global credential.helper store
git config --global core.editor vim
## Generate a new GPG key and set it to sign your commits with git
# https://docs.github.com/en/authentication/managing-commit-signature-verification/generating-a-new-gpg-key
# https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key
config submodule update --remote --merge
# create the undodir for the .vim
mkdir -p ~/.vim/undodir
config submodule deinit .vim/pack/bundle/start/vim-airline
config rm .vim/pack/bundle/start/vim-airline
rm -Rf .git/modules/.vim/pack/bundle/start/vim-airline
config commit
config submodule add https://github.com/kana/vim-textobj-user ~/.vim/pack/bundle/start/vim-textobj-user
# Commit it
config add .gitsubmodule ~/.vim/pack/bundle/start/vim-textobj-user
config commit
- Vim: So long Pathogen, hello native package loading
- The best way to store your dotfiles: A bare Git repository
- I want to add a start up script which will run all the commands required to be run on a new machine. At least have them here.
- Maybe have a test script which will make sure all the component of my dotfiles are running correctly.
- Read more about this here https://dotfiles.github.io/tutorials/. Essentially decide if you want to switch to using the dotfiles this way.
- I definitely need a way to have my global configs shared between systems, but still have local settings. For example, if I am on a remote machine I might want to set some aliases which wouldn't make sense elsewhere. The above link does go into handling it in multiple ways. Research and get better !
- Add the project path to a profile variable, which can vary in each machine. For example my path aliases depend on my Mac config, so they are useless elsewhere. They can be useful only if I have profile variables.
- Change to zsh fast syntax highlighting.
- I want to also write about all the features I am using on a blog, again for me, so that I can come to it later when I will forget that I have some functionalities I don't use.
- Add what I installed via brew, if it contains something I use for my terminal, I can reinstall it. 1
- Explore Tmux
- Explore SSH Config
- I might want to switch to SSH-keys for Github
Footnotes
-
See
Brewfile
andmackup
on driesvints/dotfiles โฉ