Skip to content

Instantly share code, notes, and snippets.

@zstatmanweil
Last active June 2, 2019 01:06
Show Gist options
  • Save zstatmanweil/7011a6b3aa7aba0d7b3ae40aab991313 to your computer and use it in GitHub Desktop.
Save zstatmanweil/7011a6b3aa7aba0d7b3ae40aab991313 to your computer and use it in GitHub Desktop.
# Welcome user
echo "Welcome, Zoe. Enjoy!"
export PATH=~/bin:$PATH
[ -f "$HOME/.bashrc" ] && source "$HOME/.bashrc" # Load bashrc when Ubuntu stars
# TERMINAL
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx # dark background
alias ls='ls -laghFG'
alias ll='ls -l'
alias cd..='cd ..'
alias hg="history | grep"
alias cd..='cd ../' # Go back 1 directory level (for fast typers)
alias ..='cd ../' # Go back 1 directory level
alias ...='cd ../../' # Go back 2 directory levels
alias .3='cd ../../../' # Go back 3 directory levels
alias .4='cd ../../../../' # Go back 4 directory levels
alias .5='cd ../../../../../' # Go back 5 directory levels
alias .6='cd ../../../../../../' # Go back 6 directory levels
# MISC BASH
alias qfind="find . -name " # qfind: Quickly search for file
# VIM / TMUX
alias tmux="tmux -2"
# GIT
# Show git branch in command line
force_color_prompt=yes
color_prompt=yes
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(
parse_git_branch)\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(parse_git_branch)\$ '
fi
unset color_prompt force_color_prompt
# Show Git branch in tmux
echo "if [[ \$TMUX ]]; then source ~/.tmux-git/tmux-git.sh; fi" >> ~/.bashrc
# DOCKER
export PATH="$HOME/bin:$HOME/.local/bin:$PATH"
export PATH="$PATH:/mnt/c/Program\ Files/Docker/Docker/resources/bin"
alias docker=docker.exe
alias docker-compose=docker-compose.exe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment