Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
3b6a695b
Commit
3b6a695b
authored
Feb 11, 2015
by
Ashley Valent
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:avalent/oh-my-zsh
parents
3ba10ad0
ef7e53a7
Changes
34
Show whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
273 additions
and
248 deletions
+273
-248
aliases.zsh
lib/aliases.zsh
+0
-35
directories.zsh
lib/directories.zsh
+14
-23
history.zsh
lib/history.zsh
+9
-0
key-bindings.zsh
lib/key-bindings.zsh
+3
-0
misc.zsh
lib/misc.zsh
+11
-4
termsupport.zsh
lib/termsupport.zsh
+32
-22
theme-and-appearance.zsh
lib/theme-and-appearance.zsh
+3
-5
ant.plugin.zsh
plugins/ant/ant.plugin.zsh
+3
-3
autoenv.plugin.zsh
plugins/autoenv/autoenv.plugin.zsh
+11
-0
cake.plugin.zsh
plugins/cake/cake.plugin.zsh
+1
-1
command-not-found.plugin.zsh
plugins/command-not-found/command-not-found.plugin.zsh
+16
-0
common-aliases.plugin.zsh
plugins/common-aliases/common-aliases.plugin.zsh
+0
-6
composer.plugin.zsh
plugins/composer/composer.plugin.zsh
+15
-14
dircycle.plugin.zsh
plugins/dircycle/dircycle.plugin.zsh
+34
-7
git-prompt.plugin.zsh
plugins/git-prompt/git-prompt.plugin.zsh
+0
-3
jump.plugin.zsh
plugins/jump/jump.plugin.zsh
+0
-1
last-working-dir.plugin.zsh
plugins/last-working-dir/last-working-dir.plugin.zsh
+1
-1
sudo.plugin.zsh
plugins/sudo/sudo.plugin.zsh
+2
-3
vi-mode.plugin.zsh
plugins/vi-mode/vi-mode.plugin.zsh
+8
-0
virtualenvwrapper.plugin.zsh
plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
+59
-54
web-search.plugin.zsh
plugins/web-search/web-search.plugin.zsh
+33
-28
adben.zsh-theme
themes/adben.zsh-theme
+6
-9
apple.zsh-theme
themes/apple.zsh-theme
+0
-1
gnzh.zsh-theme
themes/gnzh.zsh-theme
+1
-2
half-life.zsh-theme
themes/half-life.zsh-theme
+0
-2
jonathan.zsh-theme
themes/jonathan.zsh-theme
+1
-4
kolo.zsh-theme
themes/kolo.zsh-theme
+0
-2
linuxonly.zsh-theme
themes/linuxonly.zsh-theme
+0
-1
mikeh.zsh-theme
themes/mikeh.zsh-theme
+0
-2
rkj-repos.zsh-theme
themes/rkj-repos.zsh-theme
+7
-5
simonoff.zsh-theme
themes/simonoff.zsh-theme
+1
-4
steeef.zsh-theme
themes/steeef.zsh-theme
+0
-2
zhann.zsh-theme
themes/zhann.zsh-theme
+0
-2
install.sh
tools/install.sh
+2
-2
No files found.
lib/aliases.zsh
deleted
100644 → 0
View file @
3ba10ad0
# Push and pop directories on directory stack
alias
pu
=
'pushd'
alias
po
=
'popd'
# Basic directory operations
alias
...
=
'cd ../..'
alias
--
-
=
'cd -'
# Super user
alias
_
=
'sudo'
alias
please
=
'sudo'
#alias g='grep -in'
# Show history
if
[
"
$HIST_STAMPS
"
=
"mm/dd/yyyy"
]
then
alias history
=
'fc -fl 1'
elif
[
"
$HIST_STAMPS
"
=
"dd.mm.yyyy"
]
then
alias history
=
'fc -El 1'
elif
[
"
$HIST_STAMPS
"
=
"yyyy-mm-dd"
]
then
alias history
=
'fc -il 1'
else
alias history
=
'fc -l 1'
fi
# List direcory contents
alias
lsa
=
'ls -lah'
alias
l
=
'ls -lah'
alias
ll
=
'ls -lh'
alias
la
=
'ls -lAh'
alias
afind
=
'ack-grep -il'
lib/directories.zsh
View file @
3b6a695b
...
...
@@ -3,12 +3,10 @@ setopt auto_pushd
setopt pushd_ignore_dups
setopt pushdminus
alias
..
=
'cd ..'
alias
cd..
=
'cd ..'
alias
cd...
=
'cd ../..'
alias
cd....
=
'cd ../../..'
alias
cd.....
=
'cd ../../../..'
alias cd
/
=
'cd /'
alias
-g
...
=
'../..'
alias
-g
....
=
'../../..'
alias
-g
.....
=
'../../../..'
alias
-g
......
=
'../../../../..'
alias
1
=
'cd -'
alias
2
=
'cd -2'
...
...
@@ -20,23 +18,16 @@ alias 7='cd -7'
alias
8
=
'cd -8'
alias
9
=
'cd -9'
cd
()
{
if
[[
"x
$*
"
==
"x..."
]]
;
then
cd
../..
elif
[[
"x
$*
"
==
"x...."
]]
;
then
cd
../../..
elif
[[
"x
$*
"
==
"x....."
]]
;
then
cd
../../../..
elif
[[
"x
$*
"
==
"x......"
]]
;
then
cd
../../../../..
elif
[
-d
~/.autoenv
]
;
then
source
~/.autoenv/activate.sh
autoenv_cd
"
$@
"
else
builtin cd
"
$@
"
fi
}
alias
md
=
'mkdir -p'
alias
rd
=
rmdir
alias
d
=
'dirs -v | head -10'
# List directory contents
alias
lsa
=
'ls -lah'
alias
l
=
'ls -la'
alias
ll
=
'ls -l'
alias
la
=
'ls -lA'
# Push and pop directories on directory stack
alias
pu
=
'pushd'
alias
po
=
'popd'
lib/history.zsh
View file @
3b6a695b
...
...
@@ -6,6 +6,15 @@ fi
HISTSIZE
=
10000
SAVEHIST
=
10000
# Show history
case
$HIST_STAMPS
in
"mm/dd/yyyy"
)
alias history
=
'fc -fl 1'
;;
"dd.mm.yyyy"
)
alias history
=
'fc -El 1'
;;
"yyyy-mm-dd"
)
alias history
=
'fc -il 1'
;;
*
)
alias history
=
'fc -l 1'
;;
esac
setopt append_history
setopt extended_history
setopt hist_expire_dups_first
setopt hist_ignore_dups
# ignore duplication command history list
...
...
lib/key-bindings.zsh
View file @
3b6a695b
...
...
@@ -64,6 +64,9 @@ autoload -U edit-command-line
zle
-N
edit-command-line
bindkey
'\C-x\C-e'
edit-command-line
# file rename magick
bindkey
"^[m"
copy-prev-shell-word
# consider emacs keybindings:
#bindkey -e ## emacs key bindings
...
...
lib/misc.zsh
View file @
3b6a695b
...
...
@@ -2,9 +2,6 @@
autoload
-U
url-quote-magic
zle
-N
self-insert url-quote-magic
## file rename magick
bindkey
"^[m"
copy-prev-shell-word
## jobs
setopt long_list_jobs
...
...
@@ -12,4 +9,14 @@ setopt long_list_jobs
export
PAGER
=
"less"
export
LESS
=
"-R"
export
LC_CTYPE
=
$LANG
## super user alias
alias
_
=
'sudo'
alias
please
=
'sudo'
## more intelligent acking for ubuntu users
alias
afind
=
'ack-grep -il'
# only define LC_CTYPE if undefined
if
[[
-z
"
$LC_CTYPE
"
&&
-z
"
$LC_ALL
"
]]
;
then
export
LC_CTYPE
=
${
LANG
%%
:
*
}
# pick the first entry from LANG
fi
lib/termsupport.zsh
View file @
3b6a695b
#usage: title short_tab_title looooooooooooooooooooooggggggg_windows_title
#http://www.faqs.org/docs/Linux-mini/Xterm-Title.html#ss3.1
#Fully support screen, iterm, and probably most modern xterm and rxvt
# Set terminal window and tab/icon title
#
# usage: title short_tab_title [long_window_title]
#
# See: http://www.faqs.org/docs/Linux-mini/Xterm-Title.html#ss3.1
# Fully supports screen, iterm, and probably most modern xterm and rxvt
# (In screen, only short_tab_title is used)
# Limited support for Apple Terminal (Terminal can't set window and tab separately)
function
title
{
if
[[
"
$DISABLE_AUTO_TITLE
"
==
"true"
]]
||
[[
"
$EMACS
"
==
*
term
*
]]
;
then
return
fi
[[
"
$EMACS
"
==
*
term
*
]]
&&
return
# if $2 is unset use $1 as default
# if it is set and empty, leave it as is
:
${
2
=
$1
}
if
[[
"
$TERM
"
==
screen
*
]]
;
then
print
-Pn
"
\e
k
$1
:q
\e\\
"
#set screen hardstatus, usually truncated at 20 chars
elif
[[
"
$TERM
"
==
xterm
*
]]
||
[[
$TERM
==
rxvt
*
]]
||
[[
$TERM
==
ansi
]]
||
[[
"
$TERM_PROGRAM
"
==
"iTerm.app"
]]
;
then
elif
[[
"
$TERM
"
==
xterm
*
]]
||
[[
"
$TERM
"
==
rxvt
*
]]
||
[[
"
$TERM
"
==
ansi
]]
||
[[
"
$TERM_PROGRAM
"
==
"iTerm.app"
]]
;
then
print
-Pn
"
\e
]2;
$2
:q
\a
"
#set window name
print
-Pn
"
\e
]1;
$1
:q
\a
"
#set icon (=tab) name
fi
...
...
@@ -16,13 +24,28 @@ function title {
ZSH_THEME_TERM_TAB_TITLE_IDLE
=
"%15<..<%~%<<"
#15 char left truncated PWD
ZSH_THEME_TERM_TITLE_IDLE
=
"%n@%m: %~"
#
Appears when you have
the prompt
#
Runs before showing
the prompt
function
omz_termsupport_precmd
{
if
[[
$DISABLE_AUTO_TITLE
==
true
]]
;
then
return
fi
title
$ZSH_THEME_TERM_TAB_TITLE_IDLE
$ZSH_THEME_TERM_TITLE_IDLE
# Notify Terminal.app of current directory using undocumented OSC sequence
# found in OS X 10.9 and 10.10's /etc/bashrc
if
[[
$TERM_PROGRAM
==
Apple_Terminal
]]
&&
[[
-z
$INSIDE_EMACS
]]
;
then
local
PWD_URL
=
"file://
$HOSTNAME
${
PWD
// /%20
}
"
printf
'\e]7;%s\a'
"
$PWD_URL
"
fi
}
#
Appears at the beginning of (and during) of command execution
#
Runs before executing the command
function
omz_termsupport_preexec
{
if
[[
$DISABLE_AUTO_TITLE
==
true
]]
;
then
return
fi
emulate
-L
zsh
setopt extended_glob
...
...
@@ -33,18 +56,5 @@ function omz_termsupport_preexec {
title
'$CMD'
'%100>...>$LINE%<<'
}
#Appears each time pwd is changed
function
omz_termsupport_chpwd
{
#Notify Terminal.app of current directory using undocumented OSC sequence
#found in OS X 10.10's /etc/bashrc
if
[[
$TERM_PROGRAM
==
Apple_Terminal
]]
&&
[[
-z
$INSIDE_EMACS
]]
;
then
local
PWD_URL
=
"file://
$HOSTNAME
${
PWD
// /%20
}
"
printf
'\e]7;%s\a'
"
$PWD_URL
"
fi
}
#Fire it once so the pwd is set properly upon shell startup
omz_termsupport_chpwd
precmd_functions+
=(
omz_termsupport_precmd
)
preexec_functions+
=(
omz_termsupport_preexec
)
chpwd_functions+
=(
omz_termsupport_chpwd
)
lib/theme-and-appearance.zsh
View file @
3b6a695b
# ls colors
autoload
colors
;
colors
;
autoload
-U
colors
&&
colors
export
LSCOLORS
=
"Gxfxcxdxbxegedabagacad"
#export LS_COLORS
# Enable ls colors
if
[
"
$DISABLE_LS_COLORS
"
!=
"true"
]
...
...
@@ -23,7 +22,7 @@ fi
#setopt no_beep
setopt auto_cd
setopt multios
setopt cdablevar
S
setopt cdablevar
s
if
[[
x
$WINDOW
!=
x
]]
then
...
...
@@ -43,4 +42,3 @@ ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is c
# Setup the prompt with pretty colors
setopt prompt_subst
plugins/ant/ant.plugin.zsh
View file @
3b6a695b
_ant_does_target_list_need_generating
()
{
[
!
-f
.ant_targets
]
&&
return
0
;
[
.ant_targets
-nt
build.xml
]
&&
return
0
;
[
build.xml
-nt
.ant_targets
]
&&
return
0
;
return
1
;
}
_ant
()
{
if
[
-f
build.xml
]
;
then
if
_ant_does_target_list_need_generating
;
then
sed
-n
'/<target/s/<target.*name="\([^"]*\).*$/\1/p'
build.xml
>
.ant_targets
ant
-p
|
awk
-F
" "
'NR > 5 { print lastTarget }{lastTarget = $1}'
>
.ant_targets
fi
compadd
`
cat
.ant_targets
`
compadd
--
`
cat
.ant_targets
`
fi
}
...
...
plugins/autoenv/autoenv.plugin.zsh
View file @
3b6a695b
# Activates autoenv or reports its failure
if
!
source
$HOME
/.autoenv/activate.sh 2>/dev/null
;
then
echo
'-------- AUTOENV ---------'
echo
'Could not find ~/.autoenv/activate.sh.'
echo
'Please check if autoenv is correctly installed.'
echo
'In the meantime the autoenv plugin is DISABLED.'
echo
'--------------------------'
return
1
fi
# The use_env call below is a reusable command to activate/create a new Python
# virtualenv, requiring only a single declarative line of code in your .env files.
# It only performs an action if the requested virtualenv is not the current one.
use_env
()
{
typeset
venv
venv
=
"
$1
"
...
...
plugins/cake/cake.plugin.zsh
View file @
3b6a695b
...
...
@@ -15,7 +15,7 @@ _cake_does_target_list_need_generating () {
fi
[
!
-f
${
_cake_task_cache_file
}
]
&&
return
0
;
[
${
_cake_task_cache_file
}
-nt
Cakefile
]
&&
return
0
;
[
Cakefile
-nt
${
_cake_task_cache_file
}
]
&&
return
0
;
return
1
;
}
...
...
plugins/command-not-found/command-not-found.plugin.zsh
View file @
3b6a695b
...
...
@@ -7,3 +7,19 @@
# Arch Linux command-not-found support, you must have package pkgfile installed
# https://wiki.archlinux.org/index.php/Pkgfile#.22Command_not_found.22_hook
[[
-e
/usr/share/doc/pkgfile/command-not-found.zsh
]]
&&
source
/usr/share/doc/pkgfile/command-not-found.zsh
# Fedora command-not-found support
if
[
-f
/usr/libexec/pk-command-not-found
]
;
then
command_not_found_handler
()
{
runcnf
=
1
retval
=
127
[
!
-S
/var/run/dbus/system_bus_socket
]
&&
runcnf
=
0
[
!
-x
/usr/libexec/packagekitd
]
&&
runcnf
=
0
if
[
$runcnf
-eq
1
]
then
/usr/libexec/pk-command-not-found
$@
retval
=
$?
fi
return
$retval
}
fi
plugins/common-aliases/common-aliases.plugin.zsh
View file @
3b6a695b
...
...
@@ -20,12 +20,6 @@ alias sgrep='grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS} '
alias
t
=
'tail -f'
# because typing 'cd' is A LOT of work!!
alias
..
=
'cd ../'
alias
...
=
'cd ../../'
alias
....
=
'cd ../../../'
alias
.....
=
'cd ../../../../'
# Command line head / tail shortcuts
alias
-g
H
=
'| head'
alias
-g
T
=
'| tail'
...
...
plugins/composer/composer.plugin.zsh
View file @
3b6a695b
...
...
@@ -7,11 +7,11 @@
# Composer basic command completion
_composer_get_command_list
()
{
composer
--no-ansi
|
sed
"1,/Available commands/d"
|
awk
'/^
[a-z]+/ { print $1 }'
$_comp_command1
--no-ansi
|
sed
"1,/Available commands/d"
|
awk
'/^\s*
[a-z]+/ { print $1 }'
}
_composer_get_required_list
()
{
composer
show
-s
--no-ansi
|
sed
'1,/requires/d'
|
awk
'NF > 0 && !/^requires \(dev\)/{ print $1 }'
$_comp_command1
show
-s
--no-ansi
|
sed
'1,/requires/d'
|
awk
'NF > 0 && !/^requires \(dev\)/{ print $1 }'
}
_composer
()
{
...
...
@@ -20,29 +20,30 @@ _composer () {
_arguments
\
'1: :->command'
\
'*: :->args'
if
[
-f
composer.json
]
;
then
case
$state
in
command
)
compadd
`
_composer_get_command_list
`
compadd
$(
_composer_get_command_list
)
;;
*
)
compadd
`
_composer_get_required_list
`
compadd
$(
_composer_get_required_list
)
;;
esac
else
compadd create-project init search selfupdate show
fi
}
compdef _composer composer
compdef _composer composer.phar
# Aliases
alias
c
=
'composer'
alias
csu
=
'composer self-update'
alias
cu
=
'composer update'
alias
cr
=
'composer require'
alias
ci
=
'composer install'
alias
ccp
=
'composer create-project'
alias
cdu
=
'composer dump-autoload'
alias
cgu
=
'composer global update'
alias
cgr
=
'composer global require'
# install composer in the current directory
alias
cget
=
'curl -s https://getcomposer.org/installer | php'
...
...
plugins/dircycle/dircycle.plugin.zsh
View file @
3b6a695b
##
# dircycle plugin: enables cycling through the directory
# stack using Ctrl+Shift+Left/Right
# enables cycling through the directory stack using
# Ctrl+Shift+Left/Right
#
# left/right direction follows the order in which directories
# were visited, like left/right arrows do in a browser
eval
"insert-cycledleft () { zle push-line; LBUFFER='pushd -q +1'; zle accept-line }"
# NO_PUSHD_MINUS syntax:
# pushd +N: start counting from left of `dirs' output
# pushd -N: start counting from right of `dirs' output
insert-cycledleft
()
{
emulate
-L
zsh
setopt nopushdminus
builtin pushd
-q
+1 &>/dev/null
||
true
zle reset-prompt
}
zle
-N
insert-cycledleft
bindkey
"
\e
[1;6D"
insert-cycledleft
eval
"insert-cycledright () { zle push-line; LBUFFER='pushd -q +0'; zle accept-line }"
insert-cycledright
()
{
emulate
-L
zsh
setopt nopushdminus
builtin pushd
-q
-0
&>/dev/null
||
true
zle reset-prompt
}
zle
-N
insert-cycledright
bindkey
"
\e
[1;6C"
insert-cycledright
# add key bindings for iTerm2
if
[[
"
$TERM_PROGRAM
"
==
"iTerm.app"
]]
;
then
bindkey
"^[[1;6D"
insert-cycledleft
bindkey
"^[[1;6C"
insert-cycledright
else
bindkey
"
\e
[1;6D"
insert-cycledleft
bindkey
"
\e
[1;6C"
insert-cycledright
fi
\ No newline at end of file
plugins/git-prompt/git-prompt.plugin.zsh
View file @
3b6a695b
...
...
@@ -2,9 +2,6 @@
# http://github.com/olivierverdier/zsh-git-prompt
#
export
__GIT_PROMPT_DIR
=
$ZSH
/plugins/git-prompt
# Initialize colors.
autoload
-U
colors
colors
# Allow for functions in the prompt.
setopt PROMPT_SUBST
...
...
plugins/jump/jump.plugin.zsh
View file @
3b6a695b
...
...
@@ -27,7 +27,6 @@ unmark() {
rm
-i
"
$MARKPATH
/
$1
"
}
autoload colors
marks
()
{
for
link
in
$MARKPATH
/
*
(
@
)
;
do
local
markname
=
"
$fg
[cyan]
${
link
:t
}
$reset_color
"
...
...
plugins/last-working-dir/last-working-dir.plugin.zsh
View file @
3b6a695b
...
...
@@ -5,7 +5,7 @@
# Flag indicating if we've previously jumped to last directory.
typeset
-g
ZSH_LAST_WORKING_DIRECTORY
mkdir
-p
$ZSH_CACHE_DIR
local
cache_file
=
"
$ZSH_CACHE_DIR
/last-working-dir"
cache_file
=
"
$ZSH_CACHE_DIR
/last-working-dir"
# Updates the last directory once directory is changed.
function
chpwd
()
{
...
...
plugins/sudo/sudo.plugin.zsh
View file @
3b6a695b
...
...
@@ -13,9 +13,8 @@
# ------------------------------------------------------------------------------
sudo-command-line
()
{
[[
-z
$BUFFER
]]
&&
zle up-history
[[
$BUFFER
!=
sudo
\
*
]]
&&
BUFFER
=
"sudo
$BUFFER
"
zle end-of-line
[[
-z
$BUFFER
]]
&&
zle up-history
[[
$BUFFER
!=
sudo
\
*
]]
&&
LBUFFER
=
"sudo
$LBUFFER
"
}
zle
-N
sudo-command-line
# Defined shortcut keys: [Esc] [Esc]
...
...
plugins/vi-mode/vi-mode.plugin.zsh
View file @
3b6a695b
...
...
@@ -14,6 +14,14 @@ function zle-keymap-select zle-line-init zle-line-finish {
zle
-R
}
# Ensure that the prompt is redrawn when the terminal size changes.
TRAPWINCH
()
{
if
[[
-o
zle
]]
;
then
zle reset-prompt
zle
-R
fi
}
zle
-N
zle-line-init
zle
-N
zle-line-finish
zle
-N
zle-keymap-select
...
...
plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh
View file @
3b6a695b
virtualenvwrapper
=
'virtualenvwrapper.sh'
if
((
$+
commands[
$virtualenvwrapper
]
))
;
then
if
((
$+
commands[
$virtualenvwrapper
]
))
;
then
source
${${
virtualenvwrapper
}
:c
}
elif
[[
-f
"/etc/bash_completion.d/virtualenvwrapper"
]]
;
then
virtualenvwrapper
=
"/etc/bash_completion.d/virtualenvwrapper"
source
"/etc/bash_completion.d/virtualenvwrapper"
else
print
"zsh virtualenvwrapper plugin: Cannot find
${
virtualenvwrapper
}
.
\n
"
\
"Please install with
\`
pip install virtualenvwrapper
\`
"
>
&2
return
fi
if
!
type
workon &>/dev/null
;
then
print
"zsh virtualenvwrapper plugin: shell function 'workon' not defined.
\n
"
\
"Please check
${
virtualenvwrapper
}
"
>
&2
return
fi
if
[[
"
$WORKON_HOME
"
==
""
]]
;
then
echo
"
\$
WORKON_HOME is not defined so ZSH plugin virtualenvwrapper will not work"
else
if
[[
"
$WORKON_HOME
"
==
""
]]
;
then
print
"
\$
WORKON_HOME is not defined so ZSH plugin virtualenvwrapper will not work"
>
&2
return
fi
if
[[
!
$DISABLE_VENV_CD
-eq
1
]]
;
then
if
[[
!
$DISABLE_VENV_CD
-eq
1
]]
;
then
# Automatically activate Git projects's virtual environments based on the
# directory name of the project. Virtual environment name can be overridden
# by placing a .venv file in the project root with a virtualenv name in it
...
...
@@ -38,7 +52,7 @@ if (( $+commands[$virtualenvwrapper] )); then
source
$ENV_NAME
/bin/activate
&&
export
CD_VIRTUAL_ENV
=
"
$ENV_NAME
"
fi
fi
elif
[
$CD_VIRTUAL_ENV
]
;
then
elif
[[
-n
$CD_VIRTUAL_ENV
&&
-n
$VIRTUAL_ENV
]
]
;
then
# We've just left the repo, deactivate the environment
# Note: this only happens if the virtualenv was activated automatically
deactivate
&&
unset
CD_VIRTUAL_ENV
...
...
@@ -50,16 +64,7 @@ if (( $+commands[$virtualenvwrapper] )); then
# Append workon_cwd to the chpwd_functions array, so it will be called on cd
# http://zsh.sourceforge.net/Doc/Release/Functions.html
# TODO: replace with 'add-zsh-hook chpwd workon_cwd' when oh-my-zsh min version is raised above 4.3.4
if
((
${
+chpwd_functions
}
))
;
then
if
((
$chpwd_functions
[(
I
)
workon_cwd]
==
0
))
;
then
set
-A
chpwd_functions
$chpwd_functions
workon_cwd
fi
else
set
-A
chpwd_functions workon_cwd
if
!
((
$chpwd_functions
[(
I
)
workon_cwd]
))
;
then
chpwd_functions+
=(
workon_cwd
)
fi
fi
fi
else
print
"zsh virtualenvwrapper plugin: Cannot find
${
virtualenvwrapper
}
. Please install with
\`
pip install virtualenvwrapper
\`
."
fi
plugins/web-search/web-search.plugin.zsh
View file @
3b6a695b
# web_search from terminal
function
web_search
()
{
# get the open command
local
open_cmd
if
[[
"
$OSTYPE
"
=
darwin
*
]]
;
then
open_cmd
=
'open'
else
open_cmd
=
'xdg-open'
fi
emulate
-L
zsh
# define search engine URLS
typeset
-A
urls
urls
=(
google
"https://www.google.com/search?q="
bing
"https://www.bing.com/search?q="
yahoo
"https://search.yahoo.com/search?p="
duckduckgo
"https://www.duckduckgo.com/?q="
yandex
"https://yandex.ru/yandsearch?text="
)
# define the open command
case
"
$OSTYPE
"
in
darwin
*
)
open_cmd
=
"open"
;;
cygwin
*
)
open_cmd
=
"cygstart"
;;
linux
*
)
open_cmd
=
"xdg-open"
;;
*
)
echo
"Platform
$OSTYPE
not supported"
return
1
;;
esac
# check whether the search engine is supported
if
[[
!
$1
=
~
'(google|bing|yahoo|duckduckgo)'
]]
;
then
if
[[
-z
"
$urls
[
$1
]"
]]
;
then
echo
"Search engine
$1
not supported."
return
1
fi
local
url
=
"http://www.
$1
.com"
# no keyword provided, simply open the search engine homepage
if
[[
$#
-le
1
]]
;
then
$open_cmd
"
$url
"
return
fi
if
[[
$1
==
'duckduckgo'
]]
;
then
#slightly different search syntax for DDG
url
=
"
${
url
}
/?q="
# search or go to main page depending on number of arguments passed
if
[[
$#
-gt
1
]]
;
then
# build search url:
# join arguments passed with '+', then append to search engine URL
url
=
"
${
urls
[
$1
]
}${
(j
:+:
)@[2,-1]
}
"
else
url
=
"
${
url
}
/search?q="
# build main page url:
# split by '/', then rejoin protocol (1) and domain (2) parts with '//'
url
=
"
${
(j
://:
)
${
(s
:/:
)urls[
$1
]
}
[1,2]
}
"
fi
shift
# shift out $1
while
[[
$#
-gt
0
]]
;
do
url
=
"
${
url
}
$1
+"
shift
done
url
=
"
${
url
%?
}
"
# remove the last '+'
nohup
$open_cmd
"
$url
"
>
/dev/null 2&>1
nohup
$open_cmd
"
$url
"
&>/dev/null
}
...
...
@@ -45,6 +48,8 @@ alias bing='web_search bing'
alias
google
=
'web_search google'
alias
yahoo
=
'web_search yahoo'
alias
ddg
=
'web_search duckduckgo'
alias
yandex
=
'web_search yandex'
#add your own !bang searches here
alias
wiki
=
'web_search duckduckgo \!w'
alias
news
=
'web_search duckduckgo \!n'
...
...
themes/adben.zsh-theme
View file @
3b6a695b
...
...
@@ -99,10 +99,7 @@ prompt_context () {
set_prompt
()
{
# required for the prompt
setopt prompt_subst
autoload colors zsh/terminfo
if
[[
"
$terminfo
[colors]"
-gt
8
]]
;
then
colors
fi
autoload zsh/terminfo
# ######### PROMPT #########
PROMPT
=
'${PROMPT_HEAD}
...
...
themes/apple.zsh-theme
View file @
3b6a695b
...
...
@@ -7,7 +7,6 @@ get_git_dirty() {
}
autoload -Uz vcs_info
autoload -U colors && colors
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' unstagedstr '%F{red}*' # display this when there are unstaged changes
zstyle ':vcs_info:*' stagedstr '%F{yellow}+' # display this when there are staged changes
...
...
themes/gnzh.zsh-theme
View file @
3b6a695b
...
...
@@ -2,8 +2,7 @@
# Based on bira theme
# load some modules
autoload -U colors zsh/terminfo # Used in the colour alias below
colors
autoload -U zsh/terminfo # Used in the colour alias below
setopt prompt_subst
# make some aliases for the colours: (could use normal escape sequences too)
...
...
themes/half-life.zsh-theme
View file @
3b6a695b
...
...
@@ -13,8 +13,6 @@ function virtualenv_info {
PR_GIT_UPDATE=1
setopt prompt_subst
autoload colors
colors
autoload -U add-zsh-hook
autoload -Uz vcs_info
...
...
themes/jonathan.zsh-theme
View file @
3b6a695b
...
...
@@ -44,10 +44,7 @@ setprompt () {
###
# See if we can use colors.
autoload colors zsh/terminfo
if [[ "$terminfo[colors]" -ge 8 ]]; then
colors
fi
autoload zsh/terminfo
for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE GREY; do
eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
eval PR_LIGHT_$color='%{$fg[${(L)color}]%}'
...
...
themes/kolo.zsh-theme
View file @
3b6a695b
autoload -U colors && colors
autoload -Uz vcs_info
zstyle ':vcs_info:*' stagedstr '%F{green}●'
...
...
themes/linuxonly.zsh-theme
View file @
3b6a695b
...
...
@@ -13,7 +13,6 @@ local c7=$(printf "\033[38;5;149m")
local
c8
=
$(
printf
"
\0
33[38;5;126m"
)
local
c9
=
$(
printf
"
\0
33[38;5;162m"
)
local
foopath
=
$(
perl /home/scp1/bin/foopath
)
if
[
"
$TERM
"
=
"linux"
]
;
then
c1
=
$(
printf
"
\0
33[34;1m"
)
...
...
themes/mikeh.zsh-theme
View file @
3b6a695b
setopt prompt_subst
autoload colors
colors
autoload -U add-zsh-hook
autoload -Uz vcs_info
...
...
themes/rkj-repos.zsh-theme
View file @
3b6a695b
...
...
@@ -16,13 +16,15 @@ ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}✗"
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%}➦"
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%}✂"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%}✈"
ZSH_THEME_GIT_PROMPT_SHA_BEFORE=" %{$fg[grey]%}"
ZSH_THEME_GIT_PROMPT_SHA_AFTER="%{$reset_color%}"
function mygit() {
ref1=$(git symbolic-ref HEAD 2> /dev/null) || retur
n
ref2=$(git rev-parse HEAD | head -c 6) || return
ref="$ref1 %{$fg[grey]%}$ref2"
#ref=$(git symbolic-ref HEAD 2> /dev/null) $(git rev-parse HEAD | head -c 6) || return
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$( git_prompt_status )%{$reset_color%}$ZSH_THEME_GIT_PROMPT_SUFFIX "
if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; the
n
ref=$(command git symbolic-ref HEAD 2> /dev/null) || \
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(git_prompt_short_sha)$( git_prompt_status )%{$reset_color%}$ZSH_THEME_GIT_PROMPT_SUFFIX "
fi
}
function retcode() {}
...
...
themes/simonoff.zsh-theme
View file @
3b6a695b
...
...
@@ -63,10 +63,7 @@ setprompt () {
###
# See if we can use colors.
autoload colors zsh/terminfo
if [[ "$terminfo[colors]" -ge 8 ]]; then
colors
fi
autoload zsh/terminfo
for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
eval PR_LIGHT_$color='%{$fg[${(L)color}]%}'
...
...
themes/steeef.zsh-theme
View file @
3b6a695b
...
...
@@ -15,8 +15,6 @@ function virtualenv_info {
PR_GIT_UPDATE=1
setopt prompt_subst
autoload colors
colors
autoload -U add-zsh-hook
autoload -Uz vcs_info
...
...
themes/zhann.zsh-theme
View file @
3b6a695b
autoload -U colors && colors
autoload -Uz vcs_info
zstyle ':vcs_info:*' stagedstr '%F{green}●'
...
...
tools/install.sh
View file @
3b6a695b
...
...
@@ -23,8 +23,8 @@ fi
echo
"
\0
33[0;34mUsing the Oh My Zsh template file and adding it to ~/.zshrc
\0
33[0m"
cp
$ZSH
/templates/zshrc.zsh-template ~/.zshrc
sed
-i
-e
"/^ZSH=/ c
\\
ZSH=
$ZSH
sed
-i
-e
"/^
export
ZSH=/ c
\\
export
ZSH=
$ZSH
"
~/.zshrc
echo
"
\0
33[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.
\0
33[0m"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment