Skip to content

Instantly share code, notes, and snippets.

@puhitaku
Last active January 22, 2018 05:20
Show Gist options
  • Select an option

  • Save puhitaku/961d9aa76145112cc3440f3ef166e627 to your computer and use it in GitHub Desktop.

Select an option

Save puhitaku/961d9aa76145112cc3440f3ef166e627 to your computer and use it in GitHub Desktop.
bash_profile
eval "$(pyenv init -)"
# Color Diff
if [[ -x `which colordiff` ]]; then
alias diff='colordiff -u'
else
alias diff='diff -u'
fi
export LESS='-R'
memo() {
vim $(date +%y%m%d)_$1.md
}
function ndir() {
if [ -n "$1" ]; then
mkdir $1; cd $1
else
echo "ndir: specify directory name."
fi
}
alias ls="ls -G"
alias ll="ls -lhG"
alias la="ls -lahG"
alias g="git"
alias ga="git add"
alias gb="git branch"
alias gc="git commit"
alias gd="git diff"
alias gdi_='git diff $(git status | ag '\''ed:'\'' | peco | ag -o '\''ed:\s*\K.*'\'')'
alias gcm="git commit -m"
alias gco="git checkout"
alias gf='git status --porcelain | peco | cut -c 4- | tr "\n" " " | pbcopy'
alias gp="git push"
alias gpo="git push origin"
alias gst="git status"
alias gt="git tag"
alias fa='find . | ag'
alias lg='ls | ag'
alias s='ls'
alias ss='ls -lah'
alias rename='tmux rename-window'
alias v='vim'
alias vi='vim'
alias cl='clear'
alias dk='docker'
alias ha='history | ag -o '\''^\s+[0-9]+\s+\K.*'\'' | peco --layout=bottom-up | pbcopy'
alias s3ls='aws s3 ls'
alias s3lsr='aws s3 ls --recursive'
alias s3cp='aws s3 cp'
alias s3sync='aws s3 sync'
# Python
alias py='python'
alias ipy='ipython'
alias pyてょn='python'
alias いpyてょn='ipython'
alias venv='python -m venv'
export GOPATH="/Users/takumi/dev/go"
export PATH="$PATH:$GOPATH/bin"
function gdi() {
while [ 1 ]; do
gdi_
done
}
function calc() {
python3 -c "from math import *; print( $* )"
}
function c() {
if [ -z "$1" ]; then
cd ..
else
cd "$1"
fi
}
function gocd() {
SRC="${GOPATH}/src"
CHOSEN=$(find ${SRC} -mindepth 3 -maxdepth 3 -type d | sed -E "s|${SRC}/||g" | ag -v "\.[^/]+$" | peco)
if [ "$CHOSEN" != "" ]; then
cd $SRC
cd $CHOSEN
fi
}
PS1="\[\e[32m\]\W\[\e[0m\] \$ "
cd ~/dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment