diff --git a/lib/aliases.zsh b/lib/aliases.zsh index f97daf41a..eac15103f 100644 --- a/lib/aliases.zsh +++ b/lib/aliases.zsh @@ -5,49 +5,14 @@ alias pu='pushd' alias po='popd' alias ss='thin --stats "/thin/stats" start' -alias sg='ruby script/generate' -alias sd='ruby script/destroy' -alias sp='ruby script/plugin' -alias ssp='ruby script/spec' -alias rdbm='rake db:migrate' -alias sc='ruby script/console' -alias sd='ruby script/server --debugger' alias devlog='tail -f log/development.log' -# Basic directory operations -alias .='pwd' -alias ...='cd ../..' -alias -- -='cd -' - # Super user alias _='sudo' alias ss='sudo su -' -#alias g='grep -in' - # Show history alias history='fc -l 1' -# List direcory contents -alias lsa='ls -lah' -alias l='ls -la' -alias ll='ls -alr' -alias sl=ls # often screw this up - -alias sgem='sudo gem' - -# Find ruby file -alias rfind='find . -name *.rb | xargs grep -n' -alias afind='ack-grep -il' - -# Git and svn mix -alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' - # TextMate alias et='mate . &' -alias ett='mate app config lib db public spec test Rakefile Capfile Todo &' -alias etp='mate app config lib db public spec test vendor/plugins vendor/gems Rakefile Capfile Todo &' -alias etts='mate app config lib db public script spec test vendor/plugins vendor/gems Rakefile Capfile Todo &' - -# Editor Ruby file in TextMate -alias mr='mate CHANGELOG app config db lib public script spec test' diff --git a/lib/appearance.zsh b/lib/appearance.zsh index ffee52b5e..0fd7f463f 100644 --- a/lib/appearance.zsh +++ b/lib/appearance.zsh @@ -1,7 +1,6 @@ # ls colors autoload colors; colors; export LSCOLORS="Gxfxcxdxbxegedabagacad" -#export LS_COLORS # Enable ls colors if [ "$DISABLE_LS_COLORS" != "true" ] diff --git a/lib/completion.zsh b/lib/completion.zsh index 0e2e38849..dbf8572a6 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -1,7 +1,8 @@ ## fixme - the load process here seems a bit bizarre +unsetopt noautomenu setopt complete_in_word -setopt always_to_end +unsetopt always_to_end unsetopt flowcontrol @@ -12,7 +13,7 @@ compinit zmodload -i zsh/complist -## case-insensitive (all),partial-word and then substring completion +# case-insensitive (all), partial-word and then substring completion if [ "x$CASE_SENSITIVE" = "xtrue" ]; then zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' unset CASE_SENSITIVE @@ -22,15 +23,14 @@ fi zstyle ':completion:*' list-colors '' - unsetopt MENU_COMPLETE -#setopt AUTO_MENU +setopt AUTO_MENU # should this be in keybindings? bindkey -M menuselect '^o' accept-and-infer-next-history -zstyle ':completion:*:*:*:*:*' menu select -# zstyle ':completion:*:*:*:*:processes' force-list always +zstyle ':completion:*:*:*:*:*' menu select=1 +zstyle ':completion:*:*:*:*:processes' force-list always zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01' zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w" @@ -40,9 +40,3 @@ if [ -f ~/.ssh/known_hosts ]; then zstyle ':completion:*' hosts $( sed 's/[, ].*$//' $HOME/.ssh/known_hosts ) zstyle ':completion:*:*:(ssh|scp):*:*' hosts `sed 's/^\([^ ,]*\).*$/\1/' ~/.ssh/known_hosts` fi - -# Complete on history -#zstyle ':completion:*:history-words' stop yes -#zstyle ':completion:*:history-words' remove-all-dups yes -#zstyle ':completion:*:history-words' list false -#zstyle ':completion:*:history-words' menu yes diff --git a/lib/directories.zsh b/lib/directories.zsh index 146a5b069..3fd274fc9 100644 --- a/lib/directories.zsh +++ b/lib/directories.zsh @@ -3,6 +3,8 @@ setopt auto_name_dirs setopt auto_pushd setopt pushd_ignore_dups +alias -- -='cd -' +alias .='pwd' alias ..='cd ..' alias ...='cd ../..' alias ....='cd ../../..' @@ -40,4 +42,10 @@ cd () { alias md='mkdir -p' alias rd=rmdir -alias d='dirs -v' \ No newline at end of file +alias d='dirs -v' + +# List direcory contents +alias lsa='ls -lah' +alias l='ls -la' +alias ll='ls -alr' +alias sl=ls diff --git a/lib/functions.zsh b/lib/functions.zsh index aa974e5c2..d272b6460 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -21,10 +21,6 @@ function preexec { title $cmd[1]:t "$cmd[2,-1]" } -function remote_console() { - /usr/bin/env ssh $1 "( cd $2 && ruby script/console production )" -} - function zsh_stats() { history | awk '{print $2}' | sort | uniq -c | sort -rn | head } @@ -58,20 +54,3 @@ function tm() { cd $1 mate $1 } - -# To use: add a .lighthouse file into your directory with the URL to the -# individual project. For example: -# https://rails.lighthouseapp.com/projects/8994 -# Example usage: http://screencast.com/t/ZDgwNDUwNT -open_lighthouse_ticket () { - if [ ! -f .lighthouse-url ]; then - echo "There is no .lighthouse file in the current directory..." - return 0; - else - lighthouse_url=$(cat .lighthouse-url); - echo "Opening ticket #$1"; - `open $lighthouse_url/tickets/$1`; - fi -} - -alias lho='open_lighthouse_ticket' diff --git a/lib/git.zsh b/lib/git.zsh index 31fa77c10..7628d9e8a 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -28,18 +28,3 @@ function current_branch() { ref=$(git symbolic-ref HEAD 2> /dev/null) || return echo ${ref#refs/heads/} } - -# Aliases -alias g='git' -alias gst='git status' -alias gl='git pull' -alias gup='git fetch && git rebase' -alias gp='git push' -alias gd='git diff | mate' -alias gdv='git diff -w "$@" | vim -R -' -alias gc='git commit -v' -alias gca='git commit -v -a' -alias gb='git branch' -alias gba='git branch -a' -alias gcount='git shortlog -sn' -alias gcp='git cherry-pick' diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh index 87e47bab6..134a0bcbd 100644 --- a/lib/key-bindings.zsh +++ b/lib/key-bindings.zsh @@ -19,23 +19,3 @@ bindkey "^[[1~" beginning-of-line bindkey "^[[F" end-of-line bindkey "^[[4~" end-of-line bindkey ' ' magic-space # also do history expansion on space - - -# consider emacs keybindings: - -#bindkey -e ## emacs key bindings -# -#bindkey '^[[A' up-line-or-search -#bindkey '^[[B' down-line-or-search -#bindkey '^[^[[C' emacs-forward-word -#bindkey '^[^[[D' emacs-backward-word -# -#bindkey -s '^X^Z' '%-^M' -#bindkey '^[e' expand-cmd-path -#bindkey '^[^I' reverse-menu-complete -#bindkey '^X^N' accept-and-infer-next-history -#bindkey '^W' kill-region -#bindkey '^I' complete-word -## Fix weird sequence that rxvt produces -#bindkey -s '^[[Z' '\t' -# \ No newline at end of file diff --git a/lib/misc.zsh b/lib/misc.zsh index bf68182e1..d09375044 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -10,5 +10,5 @@ bindkey "^[m" copy-prev-shell-word setopt long_list_jobs ## pager -export PAGER=less +export PAGER='less -R' export LC_CTYPE=en_US.UTF-8 diff --git a/lib/rake_completion.zsh b/lib/rake_completion.zsh deleted file mode 100644 index c425a625e..000000000 --- a/lib/rake_completion.zsh +++ /dev/null @@ -1,42 +0,0 @@ -_rake_does_task_list_need_generating () { - if [ ! -f .rake_tasks~ ]; then return 0; - else - accurate=$(stat -f%m .rake_tasks~) - changed=$(stat -f%m Rakefile) - return $(expr $accurate '>=' $changed) - fi -} - -_rake () { - if [ -f Rakefile ]; then - if _rake_does_task_list_need_generating; then - echo "\nGenerating .rake_tasks~..." > /dev/stderr - rake --silent --tasks | cut -d " " -f 2 > .rake_tasks~ - fi - compadd `cat .rake_tasks~` - fi -} - -compctl -K _rake rake - -function _cap_does_task_list_need_generating () { - if [ ! -f .cap_tasks~ ]; then return 0; - else - accurate=$(stat -f%m .cap_tasks~) - changed=$(stat -f%m config/deploy.rb) - return $(expr $accurate '>=' $changed) - fi -} - -function _cap () { - if [ -f config/deploy.rb ]; then - if _cap_does_task_list_need_generating; then - echo "\nGenerating .cap_tasks~..." > /dev/stderr - cap show_tasks -q | cut -d " " -f 1 | sed -e '/^ *$/D' -e '1,2D' -> .cap_tasks~ - fi - compadd `cat .cap_tasks~` - fi -} - -compctl -K _cap cap