From 2b6001e75cecf1ffd7eafd7c36297b149f4c219d Mon Sep 17 00:00:00 2001 From: tmont Date: Tue, 13 Nov 2018 10:26:44 -0800 Subject: [PATCH] os x tweaks --- .bashrc | 25 +++++++++++++++++++------ .gitconfig-mac | 23 +++++++++++++++++++++++ 2 files changed, 42 insertions(+), 6 deletions(-) create mode 100644 .gitconfig-mac diff --git a/.bashrc b/.bashrc index 5ef8333..6392458 100644 --- a/.bashrc +++ b/.bashrc @@ -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 diff --git a/.gitconfig-mac b/.gitconfig-mac new file mode 100644 index 0000000..c400054 --- /dev/null +++ b/.gitconfig-mac @@ -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"