Home - test482/dotfiles GitHub Wiki

my arch dotfiles

Shell (Shell framework) WM / DE Editor Terminal Multiplexer Monitor File Manager
bash KDE neovim / vscode wezterm / alacritty tmux htop yazi

Install this dotfiles onto a new system (or migrate to this setup)

alias dotgit='/usr/bin/git --git-dir=$HOME/.config/.dotfiles/ --work-tree=$HOME'

git clone --bare https://github.com/test482/dotfiles.git ~/.config/.dotfiles

# checkout to specify branch
dotgit checkout $BRANCH_NAME
# or create new branch
dotgit switch --create $NEW_BRANCH

# backup configuration files that might already exist if needed
# mkdir -p ~/config-backup && dotgit checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | xargs -I{} mv {} ~/config-backup/{}
# dotgit checkout

dotgit config --local status.showUntrackedFiles no

dotgit submodule update --init

# ignore some files change
# dotgit ls-files -v | rg "^S" for check skiped file list
dotgit update-index --skip-worktree $HOME/.ssh/authorized_keys

# git pre-commit hook to avoid CRLF file
echo '#!/bin/env bash

crlf_file_num=$(git --git-dir=$HOME/.config/.dotfiles/ --work-tree=$HOME ls-files | xargs -I{} rg -l $'\''\r'\'' {} | wc -l)
if test $crlf_file_num -ne 0; then
  echo "错误:有文件包含 CRLF 换行符。"
  exit 1
fi' > $HOME/.config/.dotfiles/hooks/pre-commit && chmod +x $HOME/.config/.dotfiles/hooks/pre-commit