forked from jmhobbs/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbashrc.symlink
91 lines (67 loc) · 2.58 KB
/
bashrc.symlink
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
############
# Settings #
############
# Prevent file overwrite on stdout redirection
# Use `>|` to force redirection to an existing file
# set -o noclobber
# Perform file completion in a case insensitive fashion
#bind "set completion-ignore-case on"
# Treat hyphens and underscores as equivalent
#bind "set completion-map-case on"
# Display matches for ambiguous patterns at first tab press
#bind "set show-all-if-ambiguous on"
# Immediately add a trailing slash when autocompleting symlinks to directories
bind "set mark-symlinked-directories on"
# Append to the history file, don't overwrite it
shopt -s histappend
# Save multi-line commands as one command
shopt -s cmdhist
# Huge history. Doesn't appear to slow things down, so why not?
HISTSIZE=500000
HISTFILESIZE=100000
# Avoid duplicate entries
HISTCONTROL="erasedups:ignoreboth"
#########
# Paths #
#########
# Load personal bins
export PATH="$HOME/opt/bin:$HOME/opt/platform-tools:${PATH}"
# Go
export GOPATH=$HOME/go
export PATH="${GOPATH}/bin:${PATH}"
# Heroku
export PATH="/usr/local/heroku/bin:${PATH}"
# Homebrew
export PATH="/usr/local/bin:/usr/local/sbin:${PATH}"
#############
# Load Misc #
#############
# Autoload linked bash configs
for f in $(find $HOME -maxdepth 1 -name '.bash-*'); do
source "$f"
done
# Load fzf autocomplete
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
export FZF_DEFAULT_OPTS="--tiebreak=begin"
eval "$(direnv hook bash)"
# iTerm2 integrations take over PROMPT_COMMAND, so we hook direnv into them instead.
type -t "__bp_precmd_invoke_cmd" > /dev/null && precmd_functions+=(_direnv_hook)
#################
# Let's Prompt! #
#################
if [ -f "$(brew --prefix)/etc/bash_completion.d/git-prompt.sh" ]; then
source $(brew --prefix)/etc/bash_completion.d/git-prompt.sh
GIT_PS1_SHOWDIRTYSTATE=true
export PS1="${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$(__git_ps1)\[\033[38;5;208m\]\$(__kubectl_cluster)\[\033[1;31m\] ✪ \[\033[00m\]"
else
export PS1="${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\[\033[38;5;208m\]\$(__kubectl_cluster)\[\033[00m\]\[\033[1;31m\] ✪ \[\033[00m\]"
fi
# Shorter one for demo videos and Asciinema recording
#export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]\[\033[1;31m\] ✪ \[\033[00m\]'
imgdiff () {
convert '(' "$1" -flatten -grayscale Rec709Luminance ')' \
'(' "$2" -flatten -grayscale Rec709Luminance ')' \
'(' -clone 0-1 -compose darken -composite ')' \
-channel RGB -combine /tmp/imgdiff.png \
&& open /tmp/imgdiff.png
}