Last active
March 22, 2021 12:49
-
-
Save mexelout/fd6990c2808d284e59885040d5c5d1b2 to your computer and use it in GitHub Desktop.
bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PATH="$HOME/homebrew/bin:$PATH" | |
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 | |
# rails | |
export PATH="$HOME/.rbenv/bin:$PATH" | |
eval "$(rbenv init -)" | |
# alias | |
alias vi='vim' | |
alias ls='ls -G' | |
alias ll='ls -l' | |
alias la='ls -a' | |
alias lla='ls -la' | |
alias dsstore='sudo find / -name ".DS_Store" -print -exec rm {} ";"' | |
alias ga='git add' | |
alias gd='git diff' | |
alias gdc='gd --cached' | |
alias gb='git branch' | |
alias gs='git status -s' | |
alias gc='git checkout' | |
alias gps='git push' | |
alias gpu='git pull' | |
alias gl='git log' | |
alias gla='gl --all --graph --date=format:"%y-%m-%d %H:%M" --pretty="%C(cyan)%h %C(green)%d %C(yellow)%an %C(red)%ad %C(reset)%s"' | |
alias gco='git commit' | |
alias gst='git stash' | |
alias tiga='tig --all' | |
alias be='bundle exec' | |
alias em='emacs' | |
# functions | |
function gbchange() { | |
gc $(gb | cut -b3- | peco) | |
} | |
function gbcurrent() { | |
echo $(git rev-parse --abbrev-ref HEAD) | |
} | |
# new local branch | |
alias gpsu='gps --set-upstream origin $(gbcurrent)' | |
function gbgone() { | |
gb -vv | grep gone | awk '{print $1}' | |
} | |
function gbdelete() { | |
gb -D $(gb | cut -b3- | peco) | |
} | |
function gbclean() { | |
gbgone | xargs git branch -D | |
} | |
function already_exec() { | |
ps aux | grep $1 | grep -v grep | |
} | |
function ropen() { | |
chrome "http://$(lsof -P -i | grep $(cat tmp/pids/server.pid) | awk '{print $9}')/$1" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment