Skip to content

Instantly share code, notes, and snippets.

@xfanwu
Created July 3, 2015 00:17
Show Gist options
  • Save xfanwu/25eeca8ece0bf7d99a6f to your computer and use it in GitHub Desktop.
Save xfanwu/25eeca8ece0bf7d99a6f to your computer and use it in GitHub Desktop.
Bakcup for Bash
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
export LC_ALL=en_US.UTF-8
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
#Git prompt
export GITAWAREPROMPT=~/.bash/git-aware-prompt
source "${GITAWAREPROMPT}/main.sh"
export PS1="\[$txtred\]\t \[$txtgrn\]\u@\h \[$txtrst\]in \[$txtylw\]\w \[$txtcyn\]\$git_branch \[$txtred\]\$git_dirty\[$txtgrn\]\$git_clean \[$txtrst\]\$git_last_commit\n› "
# Git completion
source ~/.bash/git-completion.bash
# set color output
export CLICOLOR=1
export LSCOLORS=gxfxcxdxbxegedabagacad
#########
# Alias #
#########
alias elasticsearch="elasticsearch --config=/usr/local/opt/elasticsearch/config/elasticsearch.yml"
# others
alias ls="ls -G"
alias cl="clear"
alias la="ls -a"
alias lal="ls -al"
alias ll="ls -l"
alias vim="mvim"
alias downloads="cd ~/Downloads"
alias dropbox="cd ~/Dropbox"
alias ggdrive="cd ~/Google\ Drive"
alias google=google
google() {
open "https://www.google.fr/search?q=$@";
}
# pow
alias pow_restart="touch ~/.pow/restart.txt"
# built-in servers
alias pysvr="python -m SimpleHTTPServer 8000"
alias phpsvr0="php -S localhost:8000"
alias phpsvr1="php -S localhost:8001"
alias todo="cd ~/Todo"
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment