Skip to content

Instantly share code, notes, and snippets.

@manzaloros
Last active February 5, 2021 02:24
Show Gist options
  • Save manzaloros/9d5f4e7e2139d93e6011f529d06c8b38 to your computer and use it in GitHub Desktop.
Save manzaloros/9d5f4e7e2139d93e6011f529d06c8b38 to your computer and use it in GitHub Desktop.
My .bash_profile
# Aliases go in bashrc, customizing $PATH environment variable in bash_profile
export PS1="___________________ | \w @ \h (\u) \n| => "
export PS2="| => "
# Aliases
alias git-pull-all="find . -maxdepth 3 -name .git -type d | rev | cut -c 6- | rev | xargs -I {} git -C {} pull"
# Update bashrc gist: https://gist.github.com/Ashwinning/35f530be96754e71a138af842d147cf8
alias gistbash="gist -u 9d5f4e7e2139d93e6011f529d06c8b38 ~/.bash_profile"
alias gistjourn="gist -u 1f81bf1b026283b109bf92298ee39fa3 ~/Documents/projects/software-engineering-journal/journal.md"
alias journ="vim ~/Documents/projects/software-engineering-journal/journal.md"
alias gistvim="gist -u a1e16bb0ebb3eca65e896b4dff83edfa ~/.vimrc"
# Navigation
alias ..="cd ..; ls"
alias downl="cd ~/Downloads; ls -1"
alias home="cd ~/; ls -1"
alias proj="cd ~/Documents/projects; ls -1"
alias desk="cd ~/Desktop; ls -1"
# Replace cat with bat
alias cat='bat --style=plain'
# Config files
alias bashp="vim ~/.bash_profile; source ~/.bash_profile"
alias vimrc="vim ~/.vimrc;"
# Preview file with quick look
alias qlf='qlmanage -p "$@" 2>/dev/null'
# Functions
journalpush(){
cd /Users/zacharymansell/Documents/projects/software-engineering-journal
git add .
git commit -a -m "$1"
git push origin master
cd -
}
pushempty(){
cd /Users/zacharymansell/Documents/projects/coding-practice
git commit --allow-empty -m "add empty commit"
git push origin master
cd -
}
cdd() {
cd "$1" && ls -1;
}
# Sets the title of the current terminal window: https://askubuntu.com/questions/774532/how-to-change-terminal-title-in-ubuntu-16-04
function set-title(){
if [[ -z "$ORIG" ]]; then
ORIG="$PS1"
fi
TITLE="\[\e]2;$*\a\]"
PS1="${ORIG}${TITLE}"
}
# Copy github gist of custom bashrc when using SSH: https://superuser.com/questions/587870/auto-propagation-of-bash-settings-across-many-machines
function customssh(){
ssh $@ -t 'cd $HOME ;
wget --quiet -N "https://gist.githubusercontent.com/manzaloros/a1d56f1fb04b1d0596157b43f3b84e60/raw/b94d24a26e2805e9d90d5eead82470ad5cf41e53/mycustombashrc.sh" ;
cp mycustombashrc.sh .'$USER'bashrc ;
bash --rcfile $HOME/.'$USER'bashrc'
}
# Activate colors in the terminal:
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# Fuzzy Finder alias, https://github.com/junegunn/fzf#using-homebrew-or-linuxbrew
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
# Source powerline
#powerline-daemon -q
#POWERLINE_BASH_CONTINUATION=1
#POWERLINE_BASH_SELECT=1
#source /usr/local/lib/python3.9/site-packages/powerline/bindings/bash/powerline.sh
# Trying a different powerline theme
export THEME=$HOME/.bash/themes/agnoster-bash/agnoster.bash
if [[ -f $THEME ]]; then
export DEFAULT_USER=`whoami`
source $THEME
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment