Skip to content

Commit 85d2a6f

Browse files
committed
Merge branch 'master' of github.com:gebner/oh-my-zsh
2 parents ae1cbd9 + dee8171 commit 85d2a6f

25 files changed

+1288
-114
lines changed

lib/aliases.zsh

-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,3 @@ alias sl=ls # often screw this up
2222

2323
alias afind='ack-grep -il'
2424

25-
alias x=extract

lib/functions.zsh

-35
Original file line numberDiff line numberDiff line change
@@ -15,38 +15,3 @@ function take() {
1515
cd $1
1616
}
1717

18-
function extract() {
19-
unset REMOVE_ARCHIVE
20-
21-
if test "$1" = "-r"; then
22-
REMOVE=1
23-
shift
24-
fi
25-
if [[ -f $1 ]]; then
26-
case $1 in
27-
*.tar.bz2) tar xvjf $1;;
28-
*.tar.gz) tar xvzf $1;;
29-
*.tar.xz) tar xvJf $1;;
30-
*.tar.lzma) tar --lzma -xvf $1;;
31-
*.bz2) bunzip $1;;
32-
*.rar) unrar x $1;;
33-
*.gz) gunzip $1;;
34-
*.tar) tar xvf $1;;
35-
*.tbz2) tar xvjf $1;;
36-
*.tgz) tar xvzf $1;;
37-
*.zip) unzip $1;;
38-
*.Z) uncompress $1;;
39-
*.7z) 7z x $1;;
40-
*) echo "'$1' cannot be extracted via >extract<";;
41-
esac
42-
43-
if [[ $REMOVE_ARCHIVE -eq 1 ]]; then
44-
echo removing "$1";
45-
/bin/rm "$1";
46-
fi
47-
48-
else
49-
echo "'$1' is not a valid file"
50-
fi
51-
}
52-

lib/key-bindings.zsh

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ bindkey ' ' magic-space # also do history expansion on space
2121
bindkey '^[[Z' reverse-menu-complete
2222

2323
# Make the delete key (or Fn + Delete on the Mac) work instead of outputting a ~
24+
bindkey '^?' backward-delete-char
2425
bindkey "^[[3~" delete-char
2526
bindkey "^[3;5~" delete-char
2627
bindkey "\e[3~" delete-char

lib/misc.zsh

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ setopt long_list_jobs
1010

1111
## pager
1212
export PAGER=less
13-
export LC_CTYPE=en_US.UTF-8
13+
export LC_CTYPE=$LANG

lib/spectrum.zsh

+8
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,11 @@ for color in {000..255}; do
1818
FG[$color]="%{[38;5;${color}m%}"
1919
BG[$color]="%{[48;5;${color}m%}"
2020
done
21+
22+
# Show all 256 colors with color number
23+
function spectrum_ls() {
24+
for code in {000..255}; do
25+
print -P -- "$code: %F{$code}Test%f"
26+
done
27+
}
28+

plugins/archlinux/archlinux.plugin.zsh

+25-17
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
1-
# Archlinux zsh aliases and functions for zsh
2-
3-
# Aliases ###################################################################
1+
# Archlinux zsh aliases and functions
2+
# Usage is also described at https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins
43

54
# Look for yaourt, and add some useful functions if we have it.
65
if [[ -x `which yaourt` ]]; then
76
upgrade () {
8-
yaourt -Syu -C
7+
yaourt -Syu
98
}
9+
alias yaconf='yaourt -C' # Fix all configuration files with vimdiff
1010
# Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
11-
alias yaupg='sudo yaourt -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system.
12-
alias yain='sudo yaourt -S' # Install specific package(s) from the repositories
13-
alias yains='sudo yaourt -U' # Install specific package not from the repositories but from a file
14-
alias yare='sudo yaourt -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies
15-
alias yarem='sudo yaourt -Rns' # Remove the specified package(s), its configuration(s) and unneeded dependencies
16-
alias yarep='yaourt -Si' # Display information about a given package in the repositories
17-
alias yareps='yaourt -Ss' # Search for package(s) in the repositories
18-
alias yaloc='yaourt -Qi' # Display information about a given package in the local database
19-
alias yalocs='yaourt -Qs' # Search for package(s) in the local database
11+
alias yaupg='yaourt -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system.
12+
alias yain='yaourt -S' # Install specific package(s) from the repositories
13+
alias yains='yaourt -U' # Install specific package not from the repositories but from a file
14+
alias yare='yaourt -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies
15+
alias yarem='yaourt -Rns' # Remove the specified package(s), its configuration(s) and unneeded dependencies
16+
alias yarep='yaourt -Si' # Display information about a given package in the repositories
17+
alias yareps='yaourt -Ss' # Search for package(s) in the repositories
18+
alias yaloc='yaourt -Qi' # Display information about a given package in the local database
19+
alias yalocs='yaourt -Qs' # Search for package(s) in the local database
2020
# Additional yaourt alias examples
21-
alias yaupd='sudo yaourt -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories
22-
alias yainsd='sudo yaourt -S --asdeps' # Install given package(s) as dependencies of another package
23-
alias yamir='sudo yaourt -Syy' # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist
21+
if [[ -x `which abs` ]]; then
22+
alias yaupd='yaourt -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories
23+
else
24+
alias yaupd='yaourt -Sy' # Update and refresh the local package and ABS databases against repositories
25+
fi
26+
alias yainsd='yaourt -S --asdeps' # Install given package(s) as dependencies of another package
27+
alias yamir='yaourt -Syy' # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist
2428
else
2529
upgrade() {
2630
sudo pacman -Syu
@@ -38,7 +42,11 @@ alias pacreps='pacman -Ss' # Search for package(s) in the repositori
3842
alias pacloc='pacman -Qi' # Display information about a given package in the local database
3943
alias paclocs='pacman -Qs' # Search for package(s) in the local database
4044
# Additional pacman alias examples
41-
alias pacupd='sudo pacman -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories
45+
if [[ -x `which abs` ]]; then
46+
alias pacupd='sudo pacman -Sy && sudo abs' # Update and refresh the local package and ABS databases against repositories
47+
else
48+
alias pacupd='sudo pacman -Sy' # Update and refresh the local package and ABS databases against repositories
49+
fi
4250
alias pacinsd='sudo pacman -S --asdeps' # Install given package(s) as dependencies of another package
4351
alias pacmir='sudo pacman -Syy' # Force refresh of all package lists after updating /etc/pacman.d/mirrorlist
4452

plugins/bundler/bundler.plugin.zsh

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ alias be="bundle exec"
22
alias bi="bundle install"
33
alias bl="bundle list"
44
alias bu="bundle update"
5+
alias bp="bundle package"
56

67
# The following is based on https://github.com/gma/bundler-exec
78

plugins/django/django.plugin.zsh

+222
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
1+
#compdef manage.py
2+
3+
typeset -ga nul_args
4+
nul_args=(
5+
'--settings=-[the Python path to a settings module.]:file:_files'
6+
'--pythonpath=-[a directory to add to the Python path.]::directory:_directories'
7+
'--traceback[print traceback on exception.]'
8+
"--version[show program's version number and exit.]"
9+
{-h,--help}'[show this help message and exit.]'
10+
)
11+
12+
_managepy-adminindex(){
13+
_arguments -s : \
14+
$nul_args \
15+
'*::directory:_directories' && ret=0
16+
}
17+
18+
_managepy-createcachetable(){
19+
_arguments -s : \
20+
$nul_args && ret=0
21+
}
22+
23+
_managepy-dbshell(){
24+
_arguments -s : \
25+
$nul_args && ret=0
26+
}
27+
28+
_managepy-diffsettings(){
29+
_arguments -s : \
30+
$nul_args && ret=0
31+
}
32+
33+
_managepy-dumpdata(){
34+
_arguments -s : \
35+
'--format=-[specifies the output serialization format for fixtures.]:format:(json yaml xml)' \
36+
'--indent=-[specifies the indent level to use when pretty-printing output.]:' \
37+
$nul_args \
38+
'*::appname:_applist' && ret=0
39+
}
40+
41+
_managepy-flush(){
42+
_arguments -s : \
43+
'--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
44+
'--noinput[tells Django to NOT prompt the user for input of any kind.]' \
45+
$nul_args && ret=0
46+
}
47+
48+
_managepy-help(){
49+
_arguments -s : \
50+
'*:command:_managepy_cmds' \
51+
$nul_args && ret=0
52+
}
53+
54+
_managepy_cmds(){
55+
local line
56+
local -a cmd
57+
_call_program help-command ./manage.py help \
58+
|& sed -n '/^ /s/[(), ]/ /gp' \
59+
| while read -A line; do cmd=($line $cmd) done
60+
_describe -t managepy-command 'manage.py command' cmd
61+
}
62+
63+
_managepy-inspectdb(){
64+
_arguments -s : \
65+
$nul_args && ret=0
66+
}
67+
68+
_managepy-loaddata(){
69+
_arguments -s : \
70+
'--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
71+
'*::file:_files' \
72+
$nul_args && ret=0
73+
}
74+
75+
_managepy-reset(){
76+
_arguments -s : \
77+
'--noinput[tells Django to NOT prompt the user for input of any kind.]' \
78+
'*::appname:_applist' \
79+
$nul_args && ret=0
80+
}
81+
82+
_managepy-runfcgi(){
83+
local state
84+
85+
local fcgi_opts
86+
fcgi_opts=(
87+
'protocol[fcgi, scgi, ajp, ... (default fcgi)]:protocol:(fcgi scgi ajp)'
88+
'host[hostname to listen on..]:'
89+
'port[port to listen on.]:'
90+
'socket[UNIX socket to listen on.]::file:_files'
91+
'method[prefork or threaded (default prefork)]:method:(prefork threaded)'
92+
'maxrequests[number of requests a child handles before it is killed and a new child is forked (0 = no limit).]:'
93+
'maxspare[max number of spare processes / threads.]:'
94+
'minspare[min number of spare processes / threads.]:'
95+
'maxchildren[hard limit number of processes / threads.]:'
96+
'daemonize[whether to detach from terminal.]:boolean:(False True)'
97+
'pidfile[write the spawned process-id to this file.]:file:_files'
98+
'workdir[change to this directory when daemonizing.]:directory:_files'
99+
'outlog[write stdout to this file.]:file:_files'
100+
'errlog[write stderr to this file.]:file:_files'
101+
)
102+
103+
_arguments -s : \
104+
$nul_args \
105+
'*: :_values "FCGI Setting" $fcgi_opts' && ret=0
106+
}
107+
108+
_managepy-runserver(){
109+
_arguments -s : \
110+
'--noreload[tells Django to NOT use the auto-reloader.]' \
111+
'--adminmedia[specifies the directory from which to serve admin media.]:directory:_files' \
112+
$nul_args && ret=0
113+
}
114+
115+
_managepy-shell(){
116+
_arguments -s : \
117+
'--plain[tells Django to use plain Python, not IPython.]' \
118+
$nul_args && ret=0
119+
}
120+
121+
_managepy-sql(){}
122+
_managepy-sqlall(){}
123+
_managepy-sqlclear(){}
124+
_managepy-sqlcustom(){}
125+
_managepy-sqlflush(){}
126+
_managepy-sqlindexes(){}
127+
_managepy-sqlinitialdata(){}
128+
_managepy-sqlreset(){}
129+
_managepy-sqlsequencereset(){}
130+
_managepy-startapp(){}
131+
132+
_managepy-syncdb() {
133+
_arguments -s : \
134+
'--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
135+
'--noinput[tells Django to NOT prompt the user for input of any kind.]' \
136+
$nul_args && ret=0
137+
}
138+
139+
_managepy-test() {
140+
_arguments -s : \
141+
'--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
142+
'--noinput[tells Django to NOT prompt the user for input of any kind.]' \
143+
'*::appname:_applist' \
144+
$nul_args && ret=0
145+
}
146+
147+
_managepy-testserver() {
148+
_arguments -s : \
149+
'--verbosity=-[verbosity level; 0=minimal output, 1=normal output, 2=all output.]:Verbosity:((0\:minimal 1\:normal 2\:all))' \
150+
'--addrport=-[port number or ipaddr:port to run the server on.]' \
151+
'*::fixture:_files' \
152+
$nul_args && ret=0
153+
}
154+
155+
_managepy-validate() {
156+
_arguments -s : \
157+
$nul_args && ret=0
158+
}
159+
160+
_managepy-commands() {
161+
local -a commands
162+
163+
commands=(
164+
'adminindex:prints the admin-index template snippet for the given app name(s).'
165+
'createcachetable:creates the table needed to use the SQL cache backend.'
166+
'dbshell:runs the command-line client for the current DATABASE_ENGINE.'
167+
"diffsettings:displays differences between the current settings.py and Django's default settings."
168+
'dumpdata:Output the contents of the database as a fixture of the given format.'
169+
'flush:Executes ``sqlflush`` on the current database.'
170+
'help:manage.py help.'
171+
'inspectdb:Introspects the database tables in the given database and outputs a Django model module.'
172+
'loaddata:Installs the named fixture(s) in the database.'
173+
'reset:Executes ``sqlreset`` for the given app(s) in the current database.'
174+
'runfcgi:Run this project as a fastcgi (or some other protocol supported by flup) application,'
175+
'runserver:Starts a lightweight Web server for development.'
176+
'shell:Runs a Python interactive interpreter.'
177+
'sql:Prints the CREATE TABLE SQL statements for the given app name(s).'
178+
'sqlall:Prints the CREATE TABLE, custom SQL and CREATE INDEX SQL statements for the given model module name(s).'
179+
'sqlclear:Prints the DROP TABLE SQL statements for the given app name(s).'
180+
'sqlcustom:Prints the custom table modifying SQL statements for the given app name(s).'
181+
'sqlflush:Returns a list of the SQL statements required to return all tables in the database to the state they were in just after they were installed.'
182+
'sqlindexes:Prints the CREATE INDEX SQL statements for the given model module name(s).'
183+
"sqlinitialdata:RENAMED: see 'sqlcustom'"
184+
'sqlreset:Prints the DROP TABLE SQL, then the CREATE TABLE SQL, for the given app name(s).'
185+
'sqlsequencereset:Prints the SQL statements for resetting sequences for the given app name(s).'
186+
"startapp:Creates a Django app directory structure for the given app name in this project's directory."
187+
"syncdb:Create the database tables for all apps in INSTALLED_APPS whose tables haven't already been created."
188+
'test:Runs the test suite for the specified applications, or the entire site if no apps are specified.'
189+
'testserver:Runs a development server with data from the given fixture(s).'
190+
'validate:Validates all installed models.'
191+
)
192+
193+
_describe -t commands 'manage.py command' commands && ret=0
194+
}
195+
196+
_applist() {
197+
local line
198+
local -a apps
199+
_call_program help-command "python -c \"import os.path as op, re, django.conf, sys;\\
200+
bn=op.basename(op.abspath(op.curdir));[sys\\
201+
.stdout.write(str(re.sub(r'^%s\.(.*?)$' %
202+
bn, r'\1', i)) + '\n') for i in django.conf.settings.\\
203+
INSTALLED_APPS if re.match(r'^%s' % bn, i)]\"" \
204+
| while read -A line; do apps=($line $apps) done
205+
_values 'Application' $apps && ret=0
206+
}
207+
208+
_managepy() {
209+
local curcontext=$curcontext ret=1
210+
211+
if ((CURRENT == 2)); then
212+
_managepy-commands
213+
else
214+
shift words
215+
(( CURRENT -- ))
216+
curcontext="${curcontext%:*:*}:managepy-$words[1]:"
217+
_call_function ret _managepy-$words[1]
218+
fi
219+
}
220+
221+
compdef _managepy manage.py
222+
compdef _managepy django

plugins/extract/_extract

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#compdef extract
2+
#autoload
3+
4+
_arguments \
5+
'(-r --remove)'{-r,--remove}'[Remove archive.]' \
6+
"*::archive file:_files -g '(#i)*.(tar|tgz|tbz|tbz2|txz|tlz|gz|bz2|xz|lzma|Z|zip|rar|7z|deb)(-.)'" && return 0
7+
8+

0 commit comments

Comments
 (0)