Dir structure cleanup

This commit is contained in:
yan
2011-12-07 02:48:00 -08:00
committed by Yan Pritzker
parent 13a5ac829b
commit f82daf5aec
4 changed files with 7 additions and 5 deletions

108
zsh/aliases Normal file
View File

@@ -0,0 +1,108 @@
# Aliases in this file are bash and zsh compatible
#
# PS
alias psg="ps aux | grep "
alias psr='ps aux | grep ruby'
# Moving around
alias ..='cd ..'
alias cdb='cd -'
# Show human friendly numbers and colors
alias df='df -h'
alias ll='ls -alGh'
alias ls='ls -Gh'
alias du='du -h -d 2'
# show me files matching "ls grep"
alias lsg='ll | grep'
# Alias Editing
alias ae='vi ~/.dotfiles/zsh/aliases' #alias edit
alias ar='source ~/.dotfiles/zsh/aliases' #alias reload
# vimrc editing
alias ve='vi ~/.vimrc'
# zsh profile editing
alias ze='vi ~/.zshrc'
alias zr='source ~/.zshrc'
# Git Aliases
alias gs='git status'
alias gstsh='git stash'
alias gst='git stash'
alias gsh='git show'
alias gshw='git show'
alias gshow='git show'
alias gi='vi .gitignore'
alias gcm='git ci -m'
alias gcim='git ci -m'
alias gci='git ci'
alias gco='git co'
alias ga='git add -A'
alias guns='git unstage'
alias gunc='git uncommit'
alias gm='git merge'
alias gms='git merge --squash'
alias gam='git amend'
alias gr='git rebase'
alias gra='git rebase --abort'
alias grc='git rebase --continue'
alias gbi='git rebase --interactive'
alias gl='git l'
alias glg='git l'
alias glog='git l'
alias co='git co'
alias gf='git fetch'
alias gfch='git fetch'
alias gd='git diff'
alias gb='git b'
alias gdc='git diff --cached'
alias gpub='grb publish'
alias gtr='grb track'
alias gpl='git pull'
alias gps='git push'
alias gpsh='git push'
alias gnb='git nb' # new branch aka checkout -b
alias grs='git reset'
alias grsh='git reset --hard'
alias gcln='git clean'
alias gclndf='git clean -df'
alias gsm='git submodule'
alias gsmi='git submodule init'
alias gsmu='git submodule update'
# Common shell functions
alias less='less -r'
alias tf='tail -f'
alias l='less'
alias lh='ls -alt | head' # see the last modified files
alias screen='TERM=screen screen'
alias cl='clear'
alias ps='ps aux'
# Zippin
alias gz='tar -zcvf'
# Ruby
alias c='script/console --irb=pry'
alias ms='mongrel_rails start'
# Vim/ctags "mctags = make ctags", using the ruby specific version
# to save some time
alias mctags=~/.bin/run_tags.rb #'/opt/local/bin/ctags -Rf ./tags *'
alias ka9='killall -9'
alias k9='kill -9'
# This trick makes sudo understand all my aliases
alias sudo='sudo '
# Gem install
alias sgi='sudo gem install --no-ri --no-rdoc'
# TODOS
# This uses NValt (NotationalVelocity alt fork) - http://brettterpstra.com/project/nvalt/
# to find the note called 'todo'
alias todo='open nvalt://find/todo'

17
zsh/zsh_aliases Normal file
View File

@@ -0,0 +1,17 @@
# Global aliases
alias -g ...='../..'
alias -g ....='../../..'
alias -g .....='../../../..'
alias -g C='| wc -l'
alias -g H='| head'
alias -g L="| less"
alias -g N="| /dev/null"
alias -g S='| sort'
alias -g G='| grep' # now you can do: ls foo G something
# Functions
#
# (f)ind by (n)ame
# usage: fn foo
# to find all files containing 'foo' in the name
function fn() { ls **/*$1* }

32
zsh/zshrc Normal file
View File

@@ -0,0 +1,32 @@
# Configuration
source ~/.dotfiles/zsh/aliases
source ~/.dotfiles/zsh/zsh_aliases
# Things I don't want to publish to github
source ~/.secrets
# Vim mode
bindkey -v
# Give me my bash style incremental search
bindkey '^R' history-incremental-search-backward
# Speed up git completion
# http://talkings.org/post/5236392664/zsh-and-slow-git-completion
__git_files () {
_wanted files expl 'local files' _files
}
# Always pushd when changing directory
setopt auto_pushd
# Fuzzy matching of completions for when you mistype them:
zstyle ':completion:*' completer _complete _match _approximate
zstyle ':completion:*:match:*' original only
zstyle ':completion:*:approximate:*' max-errors 1 numeric
# RVM
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
# Add path to our custom bins
export PATH=$PATH:~/.dotfiles/bin