os x tweaks

This commit is contained in:
tmont 2018-11-13 10:26:44 -08:00
parent e737144a57
commit 2b6001e75c
2 changed files with 42 additions and 6 deletions

25
.bashrc
View File

@ -6,6 +6,12 @@ awsAutocomplete=$(which aws_completer)
if [ -n "${awsAutocomplete}" ]; then
complete -C "${awsAutocomplete}" aws
fi
if [ -f /usr/local/etc/bash_completion.d/git-completion.bash ]; then
source /usr/local/etc/bash_completion.d/git-completion.bash
fi
if [ -f /usr/local/etc/bash_completion.d/git-prompt.sh ]; then
source /usr/local/etc/bash_completion.d/git-prompt.sh
fi
export EDITOR=vim
@ -31,14 +37,21 @@ else
PS1="$GREEN\u@\h$RESET:$BLUE\w$RESET "
fi
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
colorOption="--color=auto"
if [ "$(uname)" = "Darwin" ]; then
colorOption=-G
fi
alias ls="ls ${colorOption}"
alias grep="grep --color-auto"
alias egrep="egrep --color=auto"
alias fgrep="fgrep --color=auto"
# override for Debian's new idiotic quoting style in ls
export QUOTING_STYLE=literal
# override executable directories weird blue on green color scheme
eval "$(dircolors)"
export LS_COLORS="${LS_COLORS}:ow=1;4;33"
if which dircolors 2>&1 /dev/null; then
eval "$(dircolors)"
export LS_COLORS="${LS_COLORS}:ow=1;4;33"
fi

23
.gitconfig-mac Normal file
View File

@ -0,0 +1,23 @@
[user]
name = tmont
email = tommy.mont@gmail.com
[color]
ui = true
[alias]
stat = status -sb
lg = log --graph --pretty=format:'%Cred%h%Creset %Cgreen%cr%Creset %Cblue%an%Creset%C(yellow)%d%Creset %s'
releases = !git log --date=local --decorate=full --all --pretty=format:'%Cgreen%ai%Creset\t%Cred%h%Creset\t%Cblue%cn%Creset\t%d\t%s' --abbrev-commit | grep -E 'release:? v?\\d+\\.\\d+\\.\\d+(:| -)' | perl -p -e 's%\\(.*?tag: .+?\\)\\s*release(:\\s*)?%%' | sort -i
release-count = !git releases | cut -f 3 | sort | uniq -c | sort -n -r
old-branches = for-each-ref refs/remotes/origin/ --sort=committerdate --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) %(color:blue)%(authorname)%(color:reset) (%(color:green)%(committerdate:relative)%(color:reset))'
hidiff = "!f() { [ \"$GIT_PREFIX\" != \"\" ] && cd "$GIT_PREFIX"; git diff --color $@ | diff-so-fancy | less --tabs=4 -RFX; }; f"
[push]
default = upstream
[core]
pager = less -x4
autocrlf = false
safecrlf = false
[merge]
tool = diffmerge
[mergetool "diffmerge"]
trustExitCode = true
cmd = /usr/local/bin/diffmerge --merge --result="$MERGED" "$LOCAL" "$BASE" "$REMOTE"