diff --git a/.gitconfig b/.gitconfig index 58c2f68..fb9566b 100644 --- a/.gitconfig +++ b/.gitconfig @@ -21,6 +21,28 @@ amend = commit --amend untrack = rm --cached unadd = restore --staged softadd = add --intent-to-add +wdiff = diff -w --word-diff=color --ignore-space-at-eol + +# Diff of last commit +dlc = diff --cached HEAD^ + +# list all defined aliases +aliases = config --get-regexp alias + +# Find very first commit +first = rev-list --max-parents=0 HEAD + +# what would be merged +incoming = log HEAD..@{upstream} + +# what would be pushed +outgoing = log @{upstream}..HEAD +outgoing = log @{u}.. + +# List all commits (on this branch) made by me +mycommits = log --author=\".*[Jj]an\\s*[Kk]rag.*\" + +structure = log --oneline --simplify-by-decoration --graph --all # init new git repo with empty initial commit start = !git init && git commit --allow-empty -m \"Initial commit\" diff --git a/.zshrc b/.zshrc index fbbd8e9..08e076d 100644 --- a/.zshrc +++ b/.zshrc @@ -37,15 +37,21 @@ fpath+=($HOME/.config/zsh/functions) CONFIG_DIR=$HOME/.config ZSH_CONFIG_DIR=$CONFIG_DIR/zsh -FILES_TO_SOURCE=( +FILES_TO_SOURCE=() +FILES_TO_SOURCE+=( $ZSH_CONFIG_DIR/aliases $ZSH_CONFIG_DIR/environment $ZSH_CONFIG_DIR/zsh-unplugged # extremely minimal "package manager" $HOME/.iterm2_shell_integration.zsh - $HOMEBREW_PREFIX/opt/nvm/nvm.sh - $HOMEBREW_PREFIX/opt/nvm/etc/bash_completion.d/nvm ) +if [ "$system_type" = "Darwin" ]; then + FILES_TO_SOURCE+=( + $HOMEBREW_PREFIX/opt/nvm/nvm.sh + $HOMEBREW_PREFIX/opt/nvm/etc/bash_completion.d/nvm + ) +fi + for file in "${FILES_TO_SOURCE[@]}"; do if [ -s $file ]; then source "$file" @@ -57,8 +63,8 @@ done # Load functions fpath+=("$ZSH_CONFIG_DIR/functions") -FUNCS_TO_AUTOLOAD=( - brew-visit +FUNCS_TO_AUTOLOAD=() +FUNCS_TO_AUTOLOAD+=( f fshow ql @@ -70,6 +76,13 @@ FUNCS_TO_AUTOLOAD=( promptinit compinit ) + +if [ "$system_type" = "Darwin" ]; then + FUNCS_TO_AUTOLOAD+=( + brew-visit + ) +fi + autoload -Uz $FUNCS_TO_AUTOLOAD && compinit && promptinit prompt pure