-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbashrc.sh
More file actions
61 lines (54 loc) · 1.74 KB
/
Copy pathbashrc.sh
File metadata and controls
61 lines (54 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
# customize bash prompt
__git_ps1()
{
local b="$(git symbolic-ref HEAD 2>/dev/null)";
if [ -n "$b" ]; then
printf "$1" "${b##refs/heads/}";
fi
}
export PS1='\[\e[0;95m\]In \w:\n\[\e[0;37m\]\D{%a %b %e %r}\[\e[0m\] \[\e[0;96m\]\u\[\e[0;91m\]@\h\[\e[0m\] \[\e[1;95m\]\W\[\e[0m\] $(__git_ps1 "(\[\e[1;33m\]%s\[\e[m\])") \[\e[1;33m\]\$\[\e[0m\] '
# What this looks like (ignoring colors):
# In ~/code/faust:
# Mon Aug 19 07:59:54 PM chris.rebert@devbox faust (master) $
# colorize `ls` (and other cmd) output
export CLICOLOR=YES
# suppress dupe history entries
export HISTCONTROL=erasedups
# preserve shell history
shopt -s histappend
# enable ** globbing
shopt -s globstar
# set history length
export HISTFILESIZE=10000
# bash completion for homebrew apps
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
# have `cd` keep history and auto-ls
cd()
{
if [ -z "${1}" ]; then
set -- "$HOME" # defaulting
fi
pushd "${1}" > /dev/null && ls
}
# view manpages as PDFs in Preview
pan()
{
man -t "${1}" | open -f -a /Applications/Preview.app
}
# concat multiple PDFs together
# usage: pdfjoin -o out.pdf file1.pdf file2.pdf
alias pdfjoin='/System/Library/Automator/Combine\ PDF\ Pages.action/Contents/Resources/join.py'
# for higher GitHub API rate limit for homebrew
export HOMEBREW_GITHUB_API_TOKEN=XXXXXXXX
# for virtualenvwrapper
export WORKON_HOME=$HOME/venvs
export PROJECT_HOME=$HOME/code
source /usr/local/bin/virtualenvwrapper.sh
# for Go
export PATH=$PATH:/usr/local/opt/go/libexec/bin
# GCP
source /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.bash.inc
source /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.bash.inc