aboutsummaryrefslogtreecommitdiff
path: root/.bashrc
diff options
context:
space:
mode:
authorbenj <benj@rse8.com>2021-06-19 16:05:02 -0700
committerbenj <benj@rse8.com>2021-06-19 16:05:02 -0700
commit05b44b0acbc88b5fc5a8c48a7a8b80825088772b (patch)
tree9488cb2f3a8fc144eab14249230f2cd183987766 /.bashrc
parent4db414d5161ac05618e675f3fbd9dad3af8b310a (diff)
parent580682ff01096b3d40ba73a8d4dbf12c10993d39 (diff)
downloadsetup-05b44b0acbc88b5fc5a8c48a7a8b80825088772b.tar
setup-05b44b0acbc88b5fc5a8c48a7a8b80825088772b.tar.gz
setup-05b44b0acbc88b5fc5a8c48a7a8b80825088772b.tar.bz2
setup-05b44b0acbc88b5fc5a8c48a7a8b80825088772b.tar.lz
setup-05b44b0acbc88b5fc5a8c48a7a8b80825088772b.tar.xz
setup-05b44b0acbc88b5fc5a8c48a7a8b80825088772b.tar.zst
setup-05b44b0acbc88b5fc5a8c48a7a8b80825088772b.zip
merge AD2 updates
Diffstat (limited to '.bashrc')
-rw-r--r--.bashrc21
1 files changed, 14 insertions, 7 deletions
diff --git a/.bashrc b/.bashrc
index 9200aba..34c62cb 100644
--- a/.bashrc
+++ b/.bashrc
@@ -5,26 +5,33 @@
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
-# History size
-HISTSIZE=1000000
+export HISTSIZE=-1
# generic setup
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
+function show_opam_switch () {
+ current_switch="$(opam switch show)"
+ if [ ! -z "$current_switch" ] && [ "$current_switch" != "default" ]; then
+ echo $(echo $current_switch | rev | cut -d'/' -f1 | rev) "← "
+ fi
+}
+
# mkdir and follow into dir
function mkdirf () {
mkdir -p $1 && cd $1
}
# Customize prompt
-if [ -n "$SSH_CLIENT" ]; then ssh_text="ssh"
+if [ -n "$SSH_CLIENT" ]; then
+ ssh_text="ssh"
fi
if [ -z $STY ]; then
- export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h\[\033[36;1m\]#$ssh_text\[\033[32m\]:\[\033[33;1m\]\W\[\033[m\]\[\033[34;1m\]\$(parse_git_branch)\[\033[m\]$ "
+ export PS1="\[\033[0;34m\]\$(show_opam_switch)\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h\[\033[36;1m\]#$ssh_text\[\033[32m\]:\[\033[33;1m\]\W\[\033[m\]\[\033[34;1m\]\$(parse_git_branch)\[\033[m\]$ "
else
- export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]$STY\[\033[36;1m\]#$ssh_text\[\033[32m\]:\[\033[33;1m\]\W\[\033[m\]\[\033[34;1m\]\$(parse_git_branch)\[\033[m\]$ "
+ export PS1="\[\033[0;34m\]\$(show_opam_switch)\[\033[36m\]\u\[\033[m\]@\[\033[32m\]$STY\[\033[36;1m\]#$ssh_text\[\033[32m\]:\[\033[33;1m\]\W\[\033[m\]\[\033[34;1m\]\$(parse_git_branch)\[\033[m\]$ "
fi
# Alias
@@ -95,10 +102,10 @@ if [ -f "/etc/arch-release" ]; then
fi
source ~/.setup/.git-completion.bash
-#source /usr/local/arcanist/resources/shell/bash-completion
source ~/.setup/.bashrc.local
+complete -cf sudo
complete -C /usr/bin/vault vault
complete -C /usr/bin/aws_completer aws
complete -C /usr/bin/terraform terraform
-alias please='python ~/workspace/imagine/infrastructure/scripts/please/please.py'
+complete -C /usr/bin/packer packer