diff --git a/README.textile b/README.textile index 86d2652..d01c331 100644 --- a/README.textile +++ b/README.textile @@ -54,12 +54,6 @@ h3. Uninstalling If you want to uninstall it, just run @uninstall_oh_my_zsh@ from the command line and it'll remove itself and revert you to bash (or your previous zsh config). -h2. Thanks - -* Rick Olson (technoweenie) might remember some of the configuration, which I took from a pastie a few years ago. -* Marcel (noradio) provided Rick the original zsh configuration. -* Nicholas (ulysses) for the "rake autocompletion code":http://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh. - h2. Help out! I'm far from being a zsh-expert and suspect there are many ways to improve. If you have ideas on how to make the configuration easier to maintain (and faster), don't hesitate to fork and send pull requests! @@ -67,3 +61,11 @@ I'm far from being a zsh-expert and suspect there are many ways to improve. If y h3. Send us your theme! I'm hoping to collect a bunch of themes for our command prompts. You can see existing ones in the @themes/@ directory. + +h2. Contributors + +This project wouldn't exist without all of our awesome users and contributors. + +* "View our growing list of contributors":https://github.com/robbyrussell/oh-my-zsh/contributors + +Thank you so much! \ No newline at end of file diff --git a/lib/completion.zsh b/lib/completion.zsh index 3c5a41e..fdd0a85 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -4,7 +4,6 @@ unsetopt menu_complete # do not autoselect the first completion entry unsetopt flowcontrol setopt auto_menu # show completion menu on succesive tab press setopt complete_in_word -setopt complete_aliases setopt always_to_end WORDCHARS='' diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index b250833..3152751 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -3,11 +3,12 @@ #Fully support screen, iterm, and probably most modern xterm and rxvt #Limited support for Apple Terminal (Terminal can't set window or tab separately) function title { - if [[ "$TERM" == "screen" ]]; then - print -Pn "\ek$1\e\\" #set screen hardstatus, usually truncated at 20 chars + [ "$DISABLE_AUTO_TITLE" != "true" ] || return + if [[ $TERM =~ "^screen" ]]; then + print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars elif [[ ($TERM =~ "^xterm") ]] || [[ ($TERM == "rxvt") ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then - print -Pn "\e]2;$2\a" #set window name - print -Pn "\e]1;$1\a" #set icon (=tab) name (will override window name on broken terminal) + print -Pn "\e]2;$2:q\a" #set window name + print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal) fi } @@ -16,15 +17,13 @@ ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~" #Appears when you have the prompt function precmd { - if [ "$DISABLE_AUTO_TITLE" != "true" ]; then - title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE - fi + title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE } #Appears at the beginning of (and during) of command execution function preexec { - if [ "$DISABLE_AUTO_TITLE" != "true" ]; then - local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd - title "$CMD" "%100>...>$2%<<" - fi + emulate -L zsh + setopt extended_glob + local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd + title "$CMD" "%100>...>$2%<<" } diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 8470c28..bc340e8 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -6,24 +6,21 @@ compdef _git gst=git-status alias gl='git pull' compdef _git gl=git-pull alias gup='git fetch && git rebase' -compdef gup=git +compdef _git gup=git-fetch alias gp='git push' compdef _git gp=git-push -alias gd='git diff | mate' -# WTF is mate?? -compdef _git gd=git-diff -alias gdv='git diff -w "$@" | vim -R -' -compdef gdv=git +gdv() { git-diff -w "$@" | view - } +compdef _git gdv=git-diff alias gc='git commit -v' -compdef gc=git +compdef _git gc=git-commit alias gca='git commit -v -a' -compdef gca=git +compdef _git gca=git-commit alias gco='git checkout' compdef _git gco=git-checkout alias gb='git branch' compdef _git gb=git-branch alias gba='git branch -a' -compdef gba=git +compdef _git gba=git-branch alias gcount='git shortlog -sn' compdef gcount=git alias gcp='git cherry-pick' diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh new file mode 100644 index 0000000..8d45806 --- /dev/null +++ b/plugins/github/github.plugin.zsh @@ -0,0 +1,11 @@ +# hub alias from defunkt +# https://github.com/defunkt/hub +if [ "$commands[(I)hub]" ]; then + # eval `hub alias -s zsh` + function git(){hub "$@"} +fi + +# add github completion function to path +fpath=($ZSH/plugins/github $fpath) +autoload -U compinit +compinit -i diff --git a/plugins/npm/_npm b/plugins/npm/_npm new file mode 100644 index 0000000..24b5361 --- /dev/null +++ b/plugins/npm/_npm @@ -0,0 +1,19 @@ +#compdef npm + +# Node Package Manager 0.3.15 completion, letting npm do all the completion work + +_npm() { + compadd -- $(_npm_complete $words) +} + +# We want to show all errors of any substance, but never the "npm (not )ok" one. +# (Also doesn't consider "ERR! no match found" worth breaking the terminal for.) +_npm_complete() { + local ask_npm + ask_npm=(npm completion --color false --loglevel error -- $@) + { _call_program npm $ask_npm 2>&1 >&3 \ + | egrep -v '^(npm (not |)ok|ERR! no match found)$' >&2; \ + } 3>&1 +} + +_npm "$@" diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh new file mode 100644 index 0000000..826f0f7 --- /dev/null +++ b/plugins/npm/npm.plugin.zsh @@ -0,0 +1,4 @@ +# add npm completion function to path +fpath=($ZSH/plugins/npm $fpath) +autoload -U compinit +compinit -i diff --git a/themes/frisk.zsh-theme b/themes/frisk.zsh-theme new file mode 100644 index 0000000..f181aec --- /dev/null +++ b/themes/frisk.zsh-theme @@ -0,0 +1,10 @@ +PROMPT=$' +%{$fg[blue]%}%/%{$reset_color%} $(git_prompt_info)%{$fg[white]%}[%n@%m]%{$reset_color%} %{$fg[white]%}[%T]%{$reset_color%} +%{$fg_bold[black]%}>%{$reset_color%} ' + +PROMPT2="%{$fg_blod[black]%}%_> %{$reset_color%}" + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[" +ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%} " +ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}" +ZSH_THEME_GIT_PROMPT_CLEAN="" diff --git a/themes/kolo.zsh-theme b/themes/kolo.zsh-theme new file mode 100644 index 0000000..6e04e15 --- /dev/null +++ b/themes/kolo.zsh-theme @@ -0,0 +1,21 @@ +autoload -U colors && colors + +autoload -Uz vcs_info + +zstyle ':vcs_info:*' stagedstr '%F{green}●' +zstyle ':vcs_info:*' unstagedstr '%F{yellow}●' +zstyle ':vcs_info:*' check-for-changes true +zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{11}%r' +zstyle ':vcs_info:*' enable git svn +precmd () { + if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] { + zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{green}]' + } else { + zstyle ':vcs_info:*' formats ' [%b%c%u%B%F{red}●%F{green}]' + } + + vcs_info +} + +setopt prompt_subst +PROMPT='%B%F{magenta}%c%B%F{green}${vcs_info_msg_0_}%B%F{magenta} %{$reset_color%}%% ' diff --git a/themes/kphoen.zsh-theme b/themes/kphoen.zsh-theme new file mode 100644 index 0000000..0e9b5e7 --- /dev/null +++ b/themes/kphoen.zsh-theme @@ -0,0 +1,50 @@ +# ------------------------------------------------------------------------------ +# FILE: kphoen.zsh-theme +# DESCRIPTION: oh-my-zsh theme file. +# AUTHOR: Kévin Gomez (geek63@gmail.com) +# VERSION: 1.0.0 +# SCREENSHOT: +# ------------------------------------------------------------------------------ + + +if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then + PROMPT='[%{$fg[red]%}%n%{$reset_color%}@%{$fg[magenta]%}%m%{$reset_color%}:%{$fg[blue]%}%~%{$reset_color%}$(git_prompt_info)] +%# ' + + ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[green]%}" + ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" + ZSH_THEME_GIT_PROMPT_DIRTY="" + ZSH_THEME_GIT_PROMPT_CLEAN="" + + # display exitcode on the right when >0 + return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" + + RPROMPT='${return_code}$(git_prompt_status)%{$reset_color%}' + + ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚" + ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹" + ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖" + ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜" + ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═" + ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" +else + PROMPT='[%n@%m:%~$(git_prompt_info)] +%# ' + + ZSH_THEME_GIT_PROMPT_PREFIX=" on" + ZSH_THEME_GIT_PROMPT_SUFFIX="" + ZSH_THEME_GIT_PROMPT_DIRTY="" + ZSH_THEME_GIT_PROMPT_CLEAN="" + + # display exitcode on the right when >0 + return_code="%(?..%? ↵)" + + RPROMPT='${return_code}$(git_prompt_status)' + + ZSH_THEME_GIT_PROMPT_ADDED=" ✚" + ZSH_THEME_GIT_PROMPT_MODIFIED=" ✹" + ZSH_THEME_GIT_PROMPT_DELETED=" ✖" + ZSH_THEME_GIT_PROMPT_RENAMED=" ➜" + ZSH_THEME_GIT_PROMPT_UNMERGED=" ═" + ZSH_THEME_GIT_PROMPT_UNTRACKED=" ✭" +fi