Skip to content

Instantly share code, notes, and snippets.

@nikolovlazar
Last active June 16, 2023 01:14
Show Gist options
  • Save nikolovlazar/195f33efd2cd20bb99bdc6263076cca4 to your computer and use it in GitHub Desktop.
Save nikolovlazar/195f33efd2cd20bb99bdc6263076cca4 to your computer and use it in GitHub Desktop.
Dotfiles installation script
git clone --depth 1 https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/start/packer.nvim
git clone --bare https://github.com/nikolovlazar/dotfiles.git $HOME/.dotfiles
function dotfiles {
/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME $@
}
mkdir -p .config-backup
dotfiles checkout
if [ $? = 0 ]; then
echo "Checked out config.";
else
echo "Backing up pre-existing dot files.";
config checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | xargs -I{} mv {} .config-backup/{}
fi;
dotfiles checkout
dotfiles config status.showUntrackedFiles no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment