PasiBergman / dotfiles-old

**OLD** collection of configuration files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IMPORTANT NOTICE

I'm moving to GNU Stow instead of using git bare repository during 11/2023.

dotfiles

Collection of macOS/Linux configuration files, including Neovim (Nvim).

IMPORTANT! Neovim configuration requires version 0.5+

dotfiles installation

  • Choose a folder name for your dotfiles and store the name to a variable. Store also the URL of the dotfiles repository
DOTFILES_DIR=".dotfiles"
REPO_URL="git@github.com:PasiBergman/dotfiles.git"
MY_SHELL_RC_FILE=".zshrc"
  • Make sure, that there is an dot alias. Note! Change the git-dir value based on the directory that you'll later choose to clone the dotfiles repository to.
alias dot='git --git-dir=$HOME/$DOTFILES_DIR/ --work-tree=$HOME'
  • Add dotfiles directory to .gitignore file to avoid recursion problems.
cd $HOME && echo "$DOTFILES_DIR" >> .gitignore
  • Clone dotfiles to a bare (i.e. empty) repository in your $HOME/$DOTFILES_DIR path.
git clone --bare $REPO_URL $HOME/$DOTFILES_DIR
  • Checkout the repository content to $HOME directory. Note! You may get an error about untracked working tree, it means that the chekcout would overwrite existing files, which are listed in the error message. Remove or move the existing files to safe location and repeat the repository checkout.
cd $HOME
dot checkout
  • Use flag showUntrackedFiles with value no to disable listing untracked files.
dot config --local status.showUntrackedFiles no
  • Done. Use command dot (instead of git) to add, commit, push etc. dotfiles.

Initial creation of the repository

DOTFILES_DIR=".dotfiles"
MY_SHELL_RC_FILE=".zshrc"
REPO_URL="git@github.com:PasiBergman/dotfiles.git"

cd $HOME
git init --bare $HOME/$DOTFILES_DIR
alias dot='git --git-dir=$HOME/$DOTFILES_DIR/ --work-tree=$HOME'
dot config --local status.showUntrackedFiles no
echo "alias dot='git --git-dir=$HOME/$DOTFILES_DIR/ --work-tree=$HOME'" >> $HOME/$MY_SHELL_RC_FILE

Usage

Example:

REPO_URL="git@github.com:PasiBergman/dotfiles.git"
cd $HOME
dot status
dot add .config/nvim/init.vim
dot commit -m "Add nvim configuration"
dot add .zshrc
dot commit -m "Add zshrc"
dot pull $REPO_URL
dot push $REPO_URL

Credits

https://www.atlassian.com/git/tutorials/dotfiles

About

**OLD** collection of configuration files.


Languages

Language:Shell 66.9%Language:Lua 26.9%Language:Python 6.2%