-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbash_profile
More file actions
169 lines (129 loc) · 4.24 KB
/
Copy pathbash_profile
File metadata and controls
169 lines (129 loc) · 4.24 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
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
#!/usr/bin/env bash
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
#set -xv
[ -f /etc/profile ] && source /etc/profile
[ -f ${HOME}/.bashrc ] && source ${HOME}/.bashrc
#TERM=xterm-color
####
# Local paths
#
PATH=${PATH}:${HOME}/.local/bin:${HOME}/.local/pandoc/bin
MANPATH=${MANPATH}:${HOME}/.local/share/man:${HOME}/.local/pandoc/share/man
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${HOME}/local/lib
export PATH MANPATH LD_LIBRARY_PATH
####
# Configure grep
#
alias grep='grep --color=auto'
####
# Configure Vim
#
if ! $( which vim 2>&1 > /dev/null ); then alias vim=`which vi`; fi
export EDITOR=vim
alias vi='echo "Use vim"'
####
# Configure prompt
#
PS1="\n\[\033[01;36m\]\d \@\n\[\033[01;35m\][\[\033[01;32m\]\u@\h:\[\033[01;36m\]\w\[\033[01;35m\]]\$\[\033[01;00m\] "
#PS1="\n\[\033[01;36m\]\d \@\n[\[\033[01;32m\]\u@\h:\[\033[01;34m\]\w\[\033[01;36m\]]\$\[\033[01;00m\] "
export PS1
####
# Configure less
#
export LESS='-R'
export LESSOPEN='|~/.lessfilter %s'
####
# Configure history
#
HISTCONTROL=ignorespace
HISTSIZE=10000
export HISTCONTROL HISTSIZE
shopt -s histappend
export PROMPT_COMMAND="history -a; history -r${PROMPT_COMMAND:+; $PROMPT_COMMAND}"
if [[ -f ~/.dircolors ]]; then
eval `dircolors ~/.dircolors`
fi
####
# Keep SSH agent up to date
#
if [ -S "${SSH_AUTH_SOCK}" ] && [ ! -L "${SSH_AUTH_SOCK}" ]; then
ln -sf "${SSH_AUTH_SOCK}" ${HOME}/.ssh/ssh_auth_sock
fi
export SSH_AUTH_SOCK=${HOME}/.ssh/ssh_auth_sock
# Keep SSH_AUTH_SOCK updated so tmux sessions also stay updated
export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND; }export SSH_AUTH_SOCK=${HOME}/.ssh/ssh_auth_sock"
####
# Configure Homebrew
#
# Homebrew GitHub token
# export HOMEBREW_GITHUB_API_TOKEN="16eab4aa3f07289741fda2d8b1a3d344fd28d0a1"
if [ `uname -s` = "Darwin" ]; then
export HOMEBREW_GITHUB_API_TOKEN="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" # No longer valid
if [ `uname -m` = "arm64" ]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
else
eval "$(/usr/local/bin/brew shellenv)"
fi
fi
##
# Configure bash_completion
#
if [ `uname -s` = "Darwin" ]; then
[ -f ${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh ] && . ${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh
fi
####
# Configure Bash-it
#
# Path to the bash it configuration
export BASH_IT="${HOME}/.bash_it"
# Lock and Load a custom theme file
# location /.bash_it/themes/
# export BASH_IT_THEME='bobby'
export BASH_IT_THEME=""
# Your place for hosting Git repos. I use this for private repos.
# export GIT_HOSTING='git@git.domain.com'
# Don't check mail when opening terminal.
unset MAILCHECK
# Change this to your console based IRC client of choice.
export IRC_CLIENT='irssi'
# Set this to the command you use for todo.txt-cli
export TODO="t"
# Set this to false to turn off version control status checking within the prompt for all themes
export SCM_CHECK=false
# Set vcprompt executable path for scm advance info in prompt (demula theme)
# https://github.com/xvzf/vcprompt
#export VCPROMPT_EXECUTABLE=~/.vcprompt/bin/vcprompt
# Load Bash It
source "$BASH_IT"/bash_it.sh
# Load Slurm completions
[ -f ${HOME}/.slurm_completion.sh ] && source ${HOME}/.slurm_completion.sh
# Let tmx2 complete like tmux
complete -F _tmux tmx2
# Add SUP to path if available
[ -d ${HOME}/gerrit/sup-ssh-utils ] && export PATH=${HOME}/gerrit/sup-ssh-utils:${PATH}
# Add Jetski if available
[ -d ${HOME}/.jetski/jetski/bin ] && export PATH="${HOME}/.jetski/jetski/bin:${PATH}"
# Add GOPATH
if command -v go > /dev/null 2>&1; then
export PATH=${PATH}:$(go env GOPATH)/bin
fi
export VIRTUAL_ENV_DISABLE_PROMPT=1
[ -f ${HOME}/.venv/bin/activate ] && source ${HOME}/.venv/bin/activate
# Add Spack to path if available
[ -f ${HOME}/git/spack/share/spack/setup-env.sh ] && source ${HOME}/git/spack/share/spack/setup-env.sh
# Add ramble to path if available
[ -f ${HOME}/git/ramble/share/ramble/setup-env.sh ] && source ${HOME}/git/ramble/share/ramble/setup-env.sh
# Add Cluster Toolkit to path if available
[ -x ${HOME}/git/cluster-toolkit/gcluster ] && export PATH="${PATH}:${HOME}/git/cluster-toolkit"
####
# Configure general overrides
#
if [ `uname -s` = "Linux" ]; then
alias ls='ls --color --classify'
elif [ `uname -s` = "Darwin" ]; then
alias ls='ls -F -G'
fi