added zsh aliases. Moved other files but left symlinks for backwards compatibility.
This commit is contained in:
parent
f8adde9e05
commit
228d89ec38
119
zsh/aliases
119
zsh/aliases
@ -1,119 +0,0 @@
|
||||
# Aliases in this file are bash and zsh compatible
|
||||
|
||||
# Don't change. The following determines where YADR is installed.
|
||||
yadr=`find -L ~ -type file -maxdepth 2 -name .yadr | head | sed 's:\.yadr\/::'`
|
||||
|
||||
# YADR support
|
||||
alias yav='yadr vim-add-plugin'
|
||||
alias yuv='yadr vim-update-plugins'
|
||||
alias yip='yadr init-plugins'
|
||||
|
||||
# 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 $yadr/zsh/aliases' #alias edit
|
||||
alias ar='source $yadr/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 gplr='git pull --rebase'
|
||||
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'
|
||||
alias gt='git t'
|
||||
|
||||
# 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'
|
||||
|
1
zsh/aliases
Symbolic link
1
zsh/aliases
Symbolic link
@ -0,0 +1 @@
|
||||
aliases.zsh
|
119
zsh/aliases.zsh
Normal file
119
zsh/aliases.zsh
Normal file
@ -0,0 +1,119 @@
|
||||
# Aliases in this file are bash and zsh compatible
|
||||
|
||||
# Don't change. The following determines where YADR is installed.
|
||||
yadr=`find -L ~ -type file -maxdepth 2 -name .yadr | head | sed 's:\.yadr\/::'`
|
||||
|
||||
# YADR support
|
||||
alias yav='yadr vim-add-plugin'
|
||||
alias yuv='yadr vim-update-plugins'
|
||||
alias yip='yadr init-plugins'
|
||||
|
||||
# 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 $yadr/zsh/aliases' #alias edit
|
||||
alias ar='source $yadr/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 gplr='git pull --rebase'
|
||||
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'
|
||||
alias gt='git t'
|
||||
|
||||
# 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'
|
||||
|
34
zsh/key-bindings.zsh
Normal file
34
zsh/key-bindings.zsh
Normal file
@ -0,0 +1,34 @@
|
||||
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html
|
||||
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Zle-Builtins
|
||||
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Standard-Widgets
|
||||
|
||||
bindkey -v # Use vi key bindings
|
||||
|
||||
bindkey '\ew' kill-region # [Esc-w] - Kill from the cursor to the mark
|
||||
bindkey -s '\el' 'ls\n' # [Esc-l] - run command: ls
|
||||
bindkey -s '\e.' '..\n' # [Esc-.] - run command: .. (up directory)
|
||||
bindkey '^r' history-incremental-search-backward # [Ctrl-r] - Search backward incrementally for a specified string. The string may begin with ^ to anchor the search to the beginning of the line.
|
||||
bindkey '^[[5~' up-line-or-history # [PageUp] - Up a line of history
|
||||
bindkey '^[[6~' down-line-or-history # [PageDown] - Down a line of history
|
||||
|
||||
bindkey '^[[A' up-line-or-search # start typing + [Up-Arrow] - fuzzy find history forward
|
||||
bindkey '^[[B' down-line-or-search # start typing + [Down-Arrow] - fuzzy find history backward
|
||||
|
||||
bindkey '^[[H' beginning-of-line # [Home] - Go to beginning of line
|
||||
bindkey '^[[1~' beginning-of-line # [Home] - Go to beginning of line
|
||||
bindkey '^[OH' beginning-of-line # [Home] - Go to beginning of line
|
||||
bindkey '^[[F' end-of-line # [End] - Go to end of line
|
||||
bindkey '^[[4~' end-of-line # [End] - Go to end of line
|
||||
bindkey '^[OF' end-of-line # [End] - Go to end of line
|
||||
|
||||
bindkey ' ' magic-space # [Space] - do history expansion
|
||||
|
||||
bindkey '^[[1;5C' forward-word # [Ctrl-RightArrow] - move forward one word
|
||||
bindkey '^[[1;5D' backward-word # [Ctrl-LeftArrow] - move backward one word
|
||||
|
||||
# Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~
|
||||
bindkey '^?' backward-delete-char # [Delete] - delete backward
|
||||
bindkey '^[[3~' delete-char # [fn-Delete] - delete forward
|
||||
bindkey '^[3;5~' delete-char
|
||||
bindkey '\e[3~' delete-char
|
||||
|
17
zsh/zsh-aliases.zsh
Normal file
17
zsh/zsh-aliases.zsh
Normal 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* }
|
@ -1,17 +0,0 @@
|
||||
# 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* }
|
1
zsh/zsh_aliases
Symbolic link
1
zsh/zsh_aliases
Symbolic link
@ -0,0 +1 @@
|
||||
zsh-aliases.zsh
|
@ -30,8 +30,7 @@ if [[ -d $HOME/.oh-my-zsh ]]; then
|
||||
fi
|
||||
|
||||
# Configuration
|
||||
source $yadr/zsh/aliases
|
||||
source $yadr/zsh/zsh_aliases
|
||||
for config_file ($yadr/zsh/*.zsh) source $config_file
|
||||
|
||||
# RVM / rbenv
|
||||
if [[ -d ~/.rvm/ ]] && [[ -d ~/.rbenv/ ]]; then
|
||||
@ -44,11 +43,9 @@ if [[ -d ~/.rvm/ ]] && [[ -d ~/.rbenv/ ]]; then
|
||||
echo ''
|
||||
else
|
||||
if [[ -d ~/.rvm/ ]]; then
|
||||
echo 'found RVM'
|
||||
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
|
||||
fi
|
||||
if [[ -d ~/.rbenv/ ]]; then
|
||||
echo 'found rbenv'
|
||||
eval "$(rbenv init -)"
|
||||
fi
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user