Collection of dotfiles
- Lua 79%
- Shell 21%
|
|
||
|---|---|---|
| .config | ||
| .local/bin | ||
| .newsboat | ||
| .nbrc | ||
| .tmux.conf | ||
| LICENSE | ||
| README.md | ||
Dotfiles
A very simple dotfiles setup - no special tools, just git and zsh.
Inspired by this HN post.
Initial Setup
# create the .dotfiles repository
git init --bare $HOME/.dotfiles
# add an alias to manage the dotfiles
echo "alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'" >> $HOME/.zshrc
# reload zsh so the alias is available
source ~/.zshrc
# set git status to hide untracked files
dotfiles config --local status.showUntrackedFiles no
# add the remote
dotfiles remote add origin git@git.ghostze.ro:felixdv/dotfiles.git
Usage
# dotfiles status
dotfiles status
# add files and commit
dotfiles add .config/nvim/init.lua
dotfiles add .config/nvim/lua
dotfiles commit -m "Add vim config"
# push changes to remote
dotfiles push
New Computer Setup
A normal git clone will fail if your home directory isn't empty. To get around that, clone the repo's working directory into a temporary directory first and then delete that directory:
# clone your dotfiles from the remote
git clone --separate-git-dir=$HOME/.dotfiles git@git.ghostze.ro:felixdv/dotfiles.git $HOME/dotfiles-tmp
# remove the temporary directory
rm -r ~/dotfiles-tmp/
# set up the alias again
echo "alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'" >> $HOME/.zshrc