Skip to content

Commit 00aba56

Browse files
committed
Conflicts: lib/termsupport.zsh
2 parents 9a26880 + 3913106 commit 00aba56

File tree

122 files changed

+4116
-1254
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+4116
-1254
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
locals.zsh
22
log/.zsh_history
33
projects.zsh
4-
custom/*
5-
!custom/example
4+
custom
5+
!custom/plugins/example
66
!custom/example.zsh
77
*.swp
88
!custom/example.zshcache

MIT-LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License
22

3-
Copyright (c) 2009-2013 Robby Russell and contributors (see https://github.com/robbyrussell/oh-my-zsh/contributors)
3+
Copyright (c) 2009-2014 Robby Russell and contributors (see https://github.com/robbyrussell/oh-my-zsh/contributors)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.textile

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,25 @@ You can install this via the command line with either `curl` or `wget`.
1414

1515
h4. via `curl`
1616

17-
@curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh@
17+
@curl -L http://install.ohmyz.sh | sh@
1818

1919
h4. via `wget`
2020

21-
@wget --no-check-certificate https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O - | sh@
21+
@wget --no-check-certificate http://install.ohmyz.sh -O - | sh@
2222

23-
h3. The manual way
23+
h4. Optional: change the install directory
24+
25+
The default location is `~/.oh-my-zsh` (hidden in your home directory).
26+
27+
You can change the install directory with the ZSH environment variable, either
28+
by running `export ZSH=/your/path` before installing, or setting it before the
29+
end of the install pipeline like this:
30+
31+
@curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | ZSH=~/.dotfiles/zsh sh@
2432

2533

34+
h3. The manual way
35+
2636
1. Clone the repository
2737

2838
@git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh@
@@ -35,7 +45,6 @@ h3. The manual way
3545

3646
@cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc@
3747

38-
3948
4. Set zsh as your default shell:
4049

4150
@chsh -s /bin/zsh@
@@ -46,9 +55,11 @@ h3. Problems?
4655

4756
You _might_ need to modify your PATH in ~/.zshrc if you're not able to find some commands after switching to _Oh My Zsh_.
4857

58+
If you installed manually or changed the install location, check ZSH in ~/.zshrc
59+
4960
h2. Usage
5061

51-
* enable the plugins you want in your @~/.zshrc@ (take a look at @plugins/@ to see what's possible)
62+
* enable the plugins you want in your @~/.zshrc@ (take a look at the @plugins/@ directory and the "wiki":https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins to see what's possible)
5263
** example: @plugins=(git osx ruby)@
5364
* Theme support: Change the @ZSH_THEME@ environment variable in @~/.zshrc@.
5465
** Take a look at the "current themes":https://wiki.github.com/robbyrussell/oh-my-zsh/themes that come bundled with _Oh My Zsh_.

lib/aliases.zsh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ else
2727
fi
2828
# List direcory contents
2929
alias lsa='ls -lah'
30-
alias l='ls -la'
31-
alias ll='ls -l'
32-
alias la='ls -lA'
30+
alias l='ls -lah'
31+
alias ll='ls -lh'
32+
alias la='ls -lAh'
3333
alias sl=ls # often screw this up
3434

3535
alias afind='ack-grep -il'

lib/completion.zsh

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -31,35 +31,20 @@ zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm
3131
zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
3232
cdpath=(.)
3333

34-
# use /etc/hosts and known_hosts for hostname completion
35-
[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _global_ssh_hosts=()
36-
[ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
37-
[ -r ~/.ssh/config ] && _ssh_config=($(cat ~/.ssh/config | sed -ne 's/Host[=\t ]//p')) || _ssh_config=()
38-
[ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
39-
hosts=(
40-
"$_ssh_config[@]"
41-
"$_global_ssh_hosts[@]"
42-
"$_ssh_hosts[@]"
43-
"$_etc_hosts[@]"
44-
"$HOST"
45-
localhost
46-
)
47-
zstyle ':completion:*:hosts' hosts $hosts
48-
zstyle ':completion:*' users off
49-
5034
# Use caching so that commands like apt and dpkg complete are useable
5135
zstyle ':completion::complete:*' use-cache 1
5236
zstyle ':completion::complete:*' cache-path $ZSH/cache/
5337

5438
# Don't complete uninteresting users
5539
zstyle ':completion:*:*:*:users' ignored-patterns \
56-
adm amanda apache avahi beaglidx bin cacti canna clamav daemon \
57-
dbus distcache dovecot fax ftp games gdm gkrellmd gopher \
58-
hacluster haldaemon halt hsqldb ident junkbust ldap lp mail \
59-
mailman mailnull mldonkey mysql nagios \
60-
named netdump news nfsnobody nobody nscd ntp nut nx openvpn \
61-
operator pcap postfix postgres privoxy pulse pvm quagga radvd \
62-
rpc rpcuser rpm shutdown squid sshd sync uucp vcsa xfs
40+
adm amanda apache at avahi avahi-autoipd beaglidx bin cacti canna \
41+
clamav daemon dbus distcache dnsmasq dovecot fax ftp games gdm \
42+
gkrellmd gopher hacluster haldaemon halt hsqldb ident junkbust kdm \
43+
ldap lp mail mailman mailnull man messagebus mldonkey mysql nagios \
44+
named netdump news nfsnobody nobody nscd ntp nut nx obsrun openvpn \
45+
operator pcap polkitd postfix postgres privoxy pulse pvm quagga radvd \
46+
rpc rpcuser rpm rtkit scard shutdown squid sshd statd svn sync tftp \
47+
usbmux uucp vcsa wwwrun xfs
6348

6449
# ... unless we really want to.
6550
zstyle '*' single-ignored show

lib/functions.zsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function zsh_stats() {
2-
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20
2+
fc -l 1 | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20
33
}
44

55
function uninstall_oh_my_zsh() {

lib/grep.zsh

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,23 @@
22
# Color grep results
33
# Examples: http://rubyurl.com/ZXv
44
#
5-
export GREP_OPTIONS='--color=auto'
6-
export GREP_COLOR='1;32'
5+
6+
GREP_OPTIONS="--color=auto"
7+
8+
# avoid VCS folders (if the necessary grep flags are available)
9+
grep-flag-available() {
10+
echo | grep $1 "" >/dev/null 2>&1
11+
}
12+
if grep-flag-available --exclude-dir=.cvs; then
13+
for PATTERN in .cvs .git .hg .svn; do
14+
GREP_OPTIONS+=" --exclude-dir=$PATTERN"
15+
done
16+
elif grep-flag-available --exclude=.cvs; then
17+
for PATTERN in .cvs .git .hg .svn; do
18+
GREP_OPTIONS+=" --exclude=$PATTERN"
19+
done
20+
fi
21+
unfunction grep-flag-available
22+
23+
export GREP_OPTIONS="$GREP_OPTIONS"
24+
export GREP_COLOR='1;32'

lib/history.zsh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ fi
55
HISTSIZE=10000
66
SAVEHIST=10000
77

8-
setopt append_history
98
setopt extended_history
109
setopt hist_expire_dups_first
1110
setopt hist_ignore_dups # ignore duplication command history list

lib/key-bindings.zsh

Lines changed: 60 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,63 @@
1-
# TODO: Explain what some of this does..
2-
3-
bindkey -e
4-
bindkey '\ew' kill-region
5-
bindkey -s '\el' "ls\n"
6-
bindkey '^r' history-incremental-search-backward
7-
bindkey "^[[5~" up-line-or-history
8-
bindkey "^[[6~" down-line-or-history
9-
10-
# make search up and down work, so partially type and hit up/down to find relevant stuff
11-
bindkey '^[[A' up-line-or-search
12-
bindkey '^[[B' down-line-or-search
13-
14-
bindkey "^[[H" beginning-of-line
15-
bindkey "^[[1~" beginning-of-line
16-
bindkey "^[OH" beginning-of-line
17-
bindkey "^[[F" end-of-line
18-
bindkey "^[[4~" end-of-line
19-
bindkey "^[OF" end-of-line
20-
bindkey ' ' magic-space # also do history expansion on space
21-
22-
bindkey "^[[1;5C" forward-word
23-
bindkey "^[[1;5D" backward-word
24-
25-
bindkey '^[[Z' reverse-menu-complete
26-
27-
# Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~
28-
bindkey '^?' backward-delete-char
29-
bindkey "^[[3~" delete-char
30-
bindkey "^[3;5~" delete-char
31-
bindkey "\e[3~" delete-char
1+
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html
2+
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Zle-Builtins
3+
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Standard-Widgets
4+
5+
# Make sure that the terminal is in application mode when zle is active, since
6+
# only then values from $terminfo are valid
7+
if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
8+
function zle-line-init() {
9+
echoti smkx
10+
}
11+
function zle-line-finish() {
12+
echoti rmkx
13+
}
14+
zle -N zle-line-init
15+
zle -N zle-line-finish
16+
fi
17+
18+
bindkey -e # Use emacs key bindings
19+
20+
bindkey '\ew' kill-region # [Esc-w] - Kill from the cursor to the mark
21+
bindkey -s '\el' 'ls\n' # [Esc-l] - run command: ls
22+
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.
23+
if [[ "${terminfo[kpp]}" != "" ]]; then
24+
bindkey "${terminfo[kpp]}" up-line-or-history # [PageUp] - Up a line of history
25+
fi
26+
if [[ "${terminfo[knp]}" != "" ]]; then
27+
bindkey "${terminfo[knp]}" down-line-or-history # [PageDown] - Down a line of history
28+
fi
29+
30+
if [[ "${terminfo[kcuu1]}" != "" ]]; then
31+
bindkey "${terminfo[kcuu1]}" up-line-or-search # start typing + [Up-Arrow] - fuzzy find history forward
32+
fi
33+
if [[ "${terminfo[kcud1]}" != "" ]]; then
34+
bindkey "${terminfo[kcud1]}" down-line-or-search # start typing + [Down-Arrow] - fuzzy find history backward
35+
fi
36+
37+
if [[ "${terminfo[khome]}" != "" ]]; then
38+
bindkey "${terminfo[khome]}" beginning-of-line # [Home] - Go to beginning of line
39+
fi
40+
if [[ "${terminfo[kend]}" != "" ]]; then
41+
bindkey "${terminfo[kend]}" end-of-line # [End] - Go to end of line
42+
fi
43+
44+
bindkey ' ' magic-space # [Space] - do history expansion
45+
46+
bindkey '^[[1;5C' forward-word # [Ctrl-RightArrow] - move forward one word
47+
bindkey '^[[1;5D' backward-word # [Ctrl-LeftArrow] - move backward one word
48+
49+
if [[ "${terminfo[kcbt]}" != "" ]]; then
50+
bindkey "${terminfo[kcbt]}" reverse-menu-complete # [Shift-Tab] - move through the completion menu backwards
51+
fi
52+
53+
bindkey '^?' backward-delete-char # [Backspace] - delete backward
54+
if [[ "${terminfo[kdch1]}" != "" ]]; then
55+
bindkey "${terminfo[kdch1]}" delete-char # [Delete] - delete forward
56+
else
57+
bindkey "^[[3~" delete-char
58+
bindkey "^[3;5~" delete-char
59+
bindkey "\e[3~" delete-char
60+
fi
3261

3362
# Edit the current command line in $EDITOR
3463
autoload -U edit-command-line

lib/prompt_info_functions.zsh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# *_prompt_info functions for usage in your prompt
2+
#
3+
# Plugin creators, please add your *_prompt_info function to the list
4+
# of dummy implementations to help theme creators not receiving errors
5+
# without the need of implementing conditional clauses.
6+
#
7+
# See also lib/bzr.zsh, lib/git.zsh and lib/nvm.zsh for
8+
# git_prompt_info, bzr_prompt_info and nvm_prompt_info
9+
10+
# Dummy implementations that return false to prevent command_not_found
11+
# errors with themes, that implement these functions
12+
# Real implementations will be used when the respective plugins are loaded
13+
function chruby_prompt_info hg_prompt_info pyenv_prompt_info \
14+
rbenv_prompt_info svn_prompt_info vi_mode_prompt_info \
15+
virtualenv_prompt_info {
16+
return 1
17+
}
18+
19+
# oh-my-zsh supports an rvm prompt by default
20+
# get the name of the rvm ruby version
21+
function rvm_prompt_info() {
22+
[ -f $HOME/.rvm/bin/rvm-prompt ] || return 1
23+
local rvm_prompt
24+
rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${=ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null)
25+
[[ "${rvm_prompt}x" == "x" ]] && return 1
26+
echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
27+
}
28+
29+
# use this to enable users to see their ruby version, no matter which
30+
# version management system they use
31+
function ruby_prompt_info() {
32+
echo $(rvm_prompt_info || rbenv_prompt_info || chruby_prompt_info)
33+
}

lib/rbenv.zsh

Lines changed: 0 additions & 2 deletions
This file was deleted.

lib/rvm.zsh

Lines changed: 0 additions & 8 deletions
This file was deleted.

lib/spectrum.zsh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,19 @@ for color in {000..255}; do
1919
BG[$color]="%{[48;5;${color}m%}"
2020
done
2121

22+
23+
ZSH_SPECTRUM_TEXT=${ZSH_SPECTRUM_TEXT:-Arma virumque cano Troiae qui primus ab oris}
24+
2225
# Show all 256 colors with color number
2326
function spectrum_ls() {
2427
for code in {000..255}; do
25-
print -P -- "$code: %F{$code}Test%f"
28+
print -P -- "$code: %F{$code}$ZSH_SPECTRUM_TEXT%f"
2629
done
2730
}
2831

2932
# Show all 256 colors where the background is set to specific color
3033
function spectrum_bls() {
3134
for code in {000..255}; do
32-
((cc = code + 1))
33-
print -P -- "$BG[$code]$code: Test %{$reset_color%}"
35+
print -P -- "$BG[$code]$code: $ZSH_SPECTRUM_TEXT %{$reset_color%}"
3436
done
3537
}

lib/termsupport.zsh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ function title {
66
if [[ "$DISABLE_AUTO_TITLE" == "true" ]] || [[ "$EMACS" == *term* ]]; then
77
return
88
fi
9-
setopt +o promptsubst
109
if [[ "$TERM" == screen* ]]; then
1110
print -Pn "\ek$2:q\e\\" #set screen hardstatus, usually truncated at 20 chars
1211
elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ $TERM == ansi ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
1312
print -Pn "\e]2;$2:q\a" #set window name
1413
print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal)
1514
fi
16-
setopt -o promptsubst
1715
}
1816

1917
ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD
@@ -28,10 +26,12 @@ function omz_termsupport_precmd {
2826
function omz_termsupport_preexec {
2927
emulate -L zsh
3028
setopt extended_glob
31-
local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
32-
local LINE="${2:gs/$/\\$}"
33-
LINE="${LINE:gs/%/%%}"
34-
title "$CMD" "%n@%m: %100>...>$LINE%<<"
29+
30+
# cmd name only, or if this is sudo or ssh, the next cmd
31+
local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]:gs/%/%%}
32+
local LINE="${2:gs/%/%%}"
33+
34+
title '$CMD' '%100>...>$LINE%<<'
3535
}
3636

3737
autoload -U add-zsh-hook

oh-my-zsh.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Check for updates on initial load...
22
if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then
3-
/usr/bin/env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh $ZSH/tools/check_for_upgrade.sh
3+
/usr/bin/env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f $ZSH/tools/check_for_upgrade.sh
44
fi
55

66
# Initializes Oh My Zsh

plugins/atom/atom.plugin.zsh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
local _atom_paths > /dev/null 2>&1
2+
_atom_paths=(
3+
"$HOME/Applications/Atom.app"
4+
"/Applications/Atom.app"
5+
)
6+
7+
for _atom_path in $_atom_paths; do
8+
if [[ -a $_atom_path ]]; then
9+
alias at="open -a '$_atom_path'"
10+
break
11+
fi
12+
done
13+
14+
alias att='at .'

0 commit comments

Comments
 (0)