mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-05 01:46:46 +01:00
Merge branch 'master' of github.com:sjl/oh-my-zsh
This commit is contained in:
commit
be0191cf83
9 changed files with 16 additions and 149 deletions
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
# ls colors
|
||||
autoload colors; colors;
|
||||
export LSCOLORS="Gxfxcxdxbxegedabagacad"
|
||||
#export LS_COLORS
|
||||
|
||||
# Enable ls colors
|
||||
if [ "$DISABLE_LS_COLORS" != "true" ]
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
## fixme - the load process here seems a bit bizarre
|
||||
|
||||
setopt noautomenu
|
||||
unsetopt noautomenu
|
||||
setopt complete_in_word
|
||||
setopt always_to_end
|
||||
unsetopt always_to_end
|
||||
|
||||
unsetopt flowcontrol
|
||||
|
||||
|
|
@ -13,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
|
||||
|
|
@ -23,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 yes 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"
|
||||
|
|
@ -41,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
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
alias d='dirs -v'
|
||||
|
||||
# List direcory contents
|
||||
alias lsa='ls -lah'
|
||||
alias l='ls -la'
|
||||
alias ll='ls -alr'
|
||||
alias sl=ls
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
15
lib/git.zsh
15
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'
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
#
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue