mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-13 03:12:21 +01:00
Merge branch 'master' of github.com:robbyrussell/oh-my-zsh
This commit is contained in:
commit
00e64afab0
8 changed files with 40 additions and 20 deletions
|
|
@ -38,7 +38,7 @@ cdpath=(.)
|
||||||
|
|
||||||
# Use caching so that commands like apt and dpkg complete are useable
|
# Use caching so that commands like apt and dpkg complete are useable
|
||||||
zstyle ':completion::complete:*' use-cache 1
|
zstyle ':completion::complete:*' use-cache 1
|
||||||
zstyle ':completion::complete:*' cache-path $ZSH/cache/
|
zstyle ':completion::complete:*' cache-path $ZSH_CACHE_DIR
|
||||||
|
|
||||||
# Don't complete uninteresting users
|
# Don't complete uninteresting users
|
||||||
zstyle ':completion:*:*:*:users' ignored-patterns \
|
zstyle ':completion:*:*:*:users' ignored-patterns \
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
#usage: title short_tab_title looooooooooooooooooooooggggggg_windows_title
|
#usage: title short_tab_title looooooooooooooooooooooggggggg_windows_title
|
||||||
#http://www.faqs.org/docs/Linux-mini/Xterm-Title.html#ss3.1
|
#http://www.faqs.org/docs/Linux-mini/Xterm-Title.html#ss3.1
|
||||||
#Fully support screen, iterm, and probably most modern xterm and rxvt
|
#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 {
|
function title {
|
||||||
if [[ "$DISABLE_AUTO_TITLE" == "true" ]] || [[ "$EMACS" == *term* ]]; then
|
if [[ "$DISABLE_AUTO_TITLE" == "true" ]] || [[ "$EMACS" == *term* ]]; then
|
||||||
return
|
return
|
||||||
|
|
@ -10,7 +9,7 @@ function title {
|
||||||
print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
|
print -Pn "\ek$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]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)
|
print -Pn "\e]1;$1:q\a" #set icon (=tab) name
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -34,5 +33,18 @@ function omz_termsupport_preexec {
|
||||||
title '$CMD' '%100>...>$LINE%<<'
|
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)
|
precmd_functions+=(omz_termsupport_precmd)
|
||||||
preexec_functions+=(omz_termsupport_preexec)
|
preexec_functions+=(omz_termsupport_preexec)
|
||||||
|
chpwd_functions+=(omz_termsupport_chpwd)
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,13 @@ if [[ -z "$ZSH_CUSTOM" ]]; then
|
||||||
ZSH_CUSTOM="$ZSH/custom"
|
ZSH_CUSTOM="$ZSH/custom"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Set ZSH_CACHE_DIR to the path where cache files sould be created
|
||||||
|
# or else we will use the default cache/
|
||||||
|
if [[ -z "$ZSH_CACHE_DIR" ]]; then
|
||||||
|
ZSH_CACHE_DIR="$ZSH/cache/"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Load all of the config files in ~/oh-my-zsh that end in .zsh
|
# Load all of the config files in ~/oh-my-zsh that end in .zsh
|
||||||
# TIP: Add files you don't want in git to .gitignore
|
# TIP: Add files you don't want in git to .gitignore
|
||||||
for config_file ($ZSH/lib/*.zsh); do
|
for config_file ($ZSH/lib/*.zsh); do
|
||||||
|
|
|
||||||
|
|
@ -236,5 +236,6 @@ _managepy() {
|
||||||
|
|
||||||
compdef _managepy manage.py
|
compdef _managepy manage.py
|
||||||
compdef _managepy django
|
compdef _managepy django
|
||||||
|
compdef _managepy django-admin
|
||||||
compdef _managepy django-admin.py
|
compdef _managepy django-admin.py
|
||||||
compdef _managepy django-manage
|
compdef _managepy django-manage
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@
|
||||||
|
|
||||||
# Flag indicating if we've previously jumped to last directory.
|
# Flag indicating if we've previously jumped to last directory.
|
||||||
typeset -g ZSH_LAST_WORKING_DIRECTORY
|
typeset -g ZSH_LAST_WORKING_DIRECTORY
|
||||||
mkdir -p "$ZSH/cache"
|
mkdir -p $ZSH_CACHE_DIR
|
||||||
local cache_file="$ZSH/cache/last-working-dir"
|
local cache_file="$ZSH_CACHE_DIR/last-working-dir"
|
||||||
|
|
||||||
# Updates the last directory once directory is changed.
|
# Updates the last directory once directory is changed.
|
||||||
function chpwd() {
|
function chpwd() {
|
||||||
|
|
|
||||||
|
|
@ -52,19 +52,19 @@ alias wpmlo='wp menu location'
|
||||||
# Option
|
# Option
|
||||||
|
|
||||||
# Plugin
|
# Plugin
|
||||||
alias wppa='activate'
|
alias wppa='wp plugin activate'
|
||||||
alias wppda='deactivate'
|
alias wppda='wp plugin deactivate'
|
||||||
alias wppd='delete'
|
alias wppd='wp plugin delete'
|
||||||
alias wppg='get'
|
alias wppg='wp plugin get'
|
||||||
alias wppi='install'
|
alias wppi='wp plugin install'
|
||||||
alias wppis='is-installed'
|
alias wppis='wp plugin is-installed'
|
||||||
alias wppl='list'
|
alias wppl='wp plugin list'
|
||||||
alias wppp='path'
|
alias wppp='wp plugin path'
|
||||||
alias wpps='search'
|
alias wpps='wp plugin search'
|
||||||
alias wppst='status'
|
alias wppst='wp plugin status'
|
||||||
alias wppt='toggle'
|
alias wppt='wp plugin toggle'
|
||||||
alias wppu='uninstall'
|
alias wppu='wp plugin uninstall'
|
||||||
alias wppu='update'
|
alias wppu='wp plugin update'
|
||||||
|
|
||||||
# Post
|
# Post
|
||||||
alias wppoc='wp post create'
|
alias wppoc='wp post create'
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
# reload zshrc
|
# reload zshrc
|
||||||
function src()
|
function src()
|
||||||
{
|
{
|
||||||
local cache="$ZSH/cache"
|
local cache=$ZSH_CACHE_DIR
|
||||||
autoload -U compinit zrecompile
|
autoload -U compinit zrecompile
|
||||||
compinit -d "$cache/zcomp-$HOST"
|
compinit -d "$cache/zcomp-$HOST"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ if [ -d "$ZSH" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "\033[0;34mCloning Oh My Zsh...\033[0m"
|
echo "\033[0;34mCloning Oh My Zsh...\033[0m"
|
||||||
hash git >/dev/null 2>&1 && env git clone https://github.com/robbyrussell/oh-my-zsh.git $ZSH || {
|
hash git >/dev/null 2>&1 && env git clone --depth=1 https://github.com/robbyrussell/oh-my-zsh.git $ZSH || {
|
||||||
echo "git not installed"
|
echo "git not installed"
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue