mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-30 02:44:42 +01:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
9c1183bb17
11 changed files with 185 additions and 6 deletions
|
|
@ -7,7 +7,13 @@ export LSCOLORS="Gxfxcxdxbxegedabagacad"
|
|||
if [ "$DISABLE_LS_COLORS" != "true" ]
|
||||
then
|
||||
# Find the option for using colors in ls, depending on the version: Linux or BSD
|
||||
ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
|
||||
if [[ "$(uname -s)" == "NetBSD" ]]; then
|
||||
# On NetBSD, test if "gls" (GNU ls) is installed (this one supports colors);
|
||||
# otherwise, leave ls as is, because NetBSD's ls doesn't support -G
|
||||
gls --color -d . &>/dev/null 2>&1 && alias ls='gls --color=tty'
|
||||
else
|
||||
ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
|
||||
fi
|
||||
fi
|
||||
|
||||
#setopt no_beep
|
||||
|
|
|
|||
3
plugins/copydir/copydir.plugin.zsh
Normal file
3
plugins/copydir/copydir.plugin.zsh
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
function copydir {
|
||||
pwd | tr -d "\r\n" | pbcopy
|
||||
}
|
||||
60
plugins/fabric/_fab
Normal file
60
plugins/fabric/_fab
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
#compdef fab
|
||||
#autoload
|
||||
|
||||
local curcontext=$curcontext state line
|
||||
declare -A opt_args
|
||||
|
||||
declare target_list
|
||||
target_list=(`fab --shortlist 2>/dev/null`)
|
||||
|
||||
_targets() {
|
||||
_describe -t commands "fabric targets" target_list
|
||||
}
|
||||
|
||||
output_levels=(
|
||||
'status: Status messages, i.e. noting when Fabric is done running, if the user used a keyboard interrupt, or when servers are disconnected from. These messages are almost always relevant and rarely verbose.'
|
||||
'aborts: Abort messages. Like status messages, these should really only be turned off when using Fabric as a library, and possibly not even then. Note that even if this output group is turned off, aborts will still occur – there just won’t be any output about why Fabric aborted!'
|
||||
'warnings: Warning messages. These are often turned off when one expects a given operation to fail, such as when using grep to test existence of text in a file. If paired with setting env.warn_only to True, this can result in fully silent warnings when remote programs fail. As with aborts, this setting does not control actual warning behavior, only whether warning messages are printed or hidden.'
|
||||
'running: Printouts of commands being executed or files transferred, e.g. [myserver] run: ls /var/www. Also controls printing of tasks being run, e.g. [myserver] Executing task ''foo''.'
|
||||
'stdout: Local, or remote, stdout, i.e. non-error output from commands.'
|
||||
'stderr: Local, or remote, stderr, i.e. error-related output from commands.'
|
||||
'user: User-generated output, i.e. local output printed by fabfile code via use of the fastprint or puts functions.'
|
||||
)
|
||||
|
||||
_arguments -w -S -C \
|
||||
'(-)'{-h,--help}'[show this help message and exit]: :->noargs' \
|
||||
'(-)'{-V,--version}'[show program''s version number and exit]: :->noargs' \
|
||||
'(-)--list[print list of possible commands and exit]: :->noargs' \
|
||||
'(-)--shortlist[print non-verbose list of possible commands and exit]: :->noargs' \
|
||||
'(--reject-unknown-hosts)--reject-unknown-hosts[reject unknown hosts]' \
|
||||
'(--no-pty)--no-pty[do not use pseudo-terminal in run/sudo]' \
|
||||
"(-d+ --display=-)"{-d+,--display=-}"[print detailed info about a given command]: :_targets" \
|
||||
'(-D --disable-known-hosts)'{-D,--disable-known-hosts}'[do not load user known_hosts file]' \
|
||||
'(-r --reject-unknown-hosts)'{-r,--reject-unknown-hosts}'[reject unknown hosts]' \
|
||||
'(-u+ --user=-)'{-u+,--user=-}'[username to use when connecting to remote hosts]: :' \
|
||||
'(-p+ --password=-)'{-p+,--password=-}'[password for use with authentication and/or sudo]: :' \
|
||||
'(-H+ --hosts=-)'{-H+,--hosts=-}'[comma separated list of hosts to operate on]: :' \
|
||||
'(-R+ --roles=-)'{-R+,--roles=-}'[comma separated list of roles to operate on]: :' \
|
||||
'(-a --no-agent)'{-a,--no-agent}'[don''t use the running SSH agent]' \
|
||||
'(-k --no-keys)'{-k,--no-keys}'[don''t load private key files from ~/.ssh/]' \
|
||||
'(-w --warn-only)'{-w,--warn-only}'[warn instead of abort, when commands fail]' \
|
||||
'-i+[path to SSH private key file. May be repeated]: :_files' \
|
||||
"(-f+ --fabfile=)"{-f+,--fabfile=}"[Python module file to import]: :_files -g *.py" \
|
||||
'(-c+ --config=-)'{-c+,--config=-}'[specify location of config file to use]: :_files' \
|
||||
'(-s+ --shell=-)'{-s+,--shell=-}'[specify a new shell, defaults to ''/bin/bash -l -c'']: :' \
|
||||
'(--hide=-)--hide=-[comma-separated list of output levels to hide]: :->levels' \
|
||||
'(--show=-)--show=-[comma-separated list of output levels to show]: :->levels' \
|
||||
'*::: :->subcmds' && return 0
|
||||
|
||||
if [[ CURRENT -ge 1 ]]; then
|
||||
case $state in
|
||||
noargs)
|
||||
_message "nothing to complete";;
|
||||
levels)
|
||||
_describe -t commands "output levels" output_levels;;
|
||||
*)
|
||||
_targets;;
|
||||
esac
|
||||
|
||||
return
|
||||
fi
|
||||
1
plugins/fabric/fabric.plugin.zsh
Normal file
1
plugins/fabric/fabric.plugin.zsh
Normal file
|
|
@ -0,0 +1 @@
|
|||
# DECLARION: This plugin was created by vhbit. What I did is just making a portal from https://github.com/vhbit/fabric-zsh-autocomplete.
|
||||
|
|
@ -275,7 +275,7 @@ __git_ps1 ()
|
|||
|
||||
if [ -n "${GIT_PS1_SHOWUNTRACKEDFILES-}" ]; then
|
||||
if [ -n "$(git ls-files --others --exclude-standard)" ]; then
|
||||
u="%"
|
||||
u="%%"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
|||
79
plugins/rebar/_rebar
Normal file
79
plugins/rebar/_rebar
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
#compdef rebar
|
||||
|
||||
local curcontext=$curcontext state ret=1
|
||||
typeset -ga _rebar_global_opts
|
||||
|
||||
_rebar_global_opts=(
|
||||
'(--help -h)'{--help,-h}'[Show the program options]'
|
||||
'(--commands -c)'{--commands,-c}'[Show available commands]'
|
||||
'(--version -V)'{--version,-V}'[Show version information]'
|
||||
'(-vvv -vv -v)'--verbose+'[Verbosity level. Default: 0]:verbosity level:(0 1 2 3)'
|
||||
'(-vvv)-v[Slightly more verbose output]'
|
||||
'(-vvv)-vv[More verbose output]'
|
||||
'(-v -vv)-vvv[Most verbose output]'
|
||||
'(--force -f)'{--force,-f}'[Force]'
|
||||
'-D+[Define compiler macro]'
|
||||
'(--jobs -j)'{--jobs+,-j+}'[Number of concurrent workers a command may use. Default: 3]:workers:(1 2 3 4 5 6 7 8 9)'
|
||||
'(--config -C)'{--config,-C}'[Rebar config file to use]:files:_files'
|
||||
'(--profile -p)'{--profile,-p}'[Profile this run of rebar]'
|
||||
'(--keep-going -k)'{--keep-going,-k}'[Keep running after a command fails]'
|
||||
)
|
||||
|
||||
_rebar () {
|
||||
_arguments -C $_rebar_global_opts \
|
||||
'*::command and variable:->cmd_and_var' \
|
||||
&& return
|
||||
|
||||
case $state in
|
||||
cmd_and_var)
|
||||
_values -S = 'variables' \
|
||||
'clean[Clean]' \
|
||||
'compile[Compile sources]' \
|
||||
'create[Create skel based on template and vars]' \
|
||||
'create-app[Create simple app skel]' \
|
||||
'create-node[Create simple node skel]' \
|
||||
'list-template[List avaiavle templates]' \
|
||||
'doc[Generate Erlang program documentation]' \
|
||||
'check-deps[Display to be fetched dependencies]' \
|
||||
'get-deps[Fetch dependencies]' \
|
||||
'update-deps[Update fetched dependencies]' \
|
||||
'delete-deps[Delete fetched dependencies]' \
|
||||
'list-deps[List dependencies]' \
|
||||
'generate[Build release with reltool]' \
|
||||
'overlay[Run reltool overlays only]' \
|
||||
'generate-appups[Generate appup files]' \
|
||||
'generate-upgrade[Build an upgrade package]' \
|
||||
'eunit[Run eunit tests]' \
|
||||
'ct[Run common_test suites]' \
|
||||
'qc[Test QuickCheck properties]' \
|
||||
'xref[Run cross reference analysis]' \
|
||||
'help[Show the program options]' \
|
||||
'version[Show version information]' \
|
||||
'apps[Application names to process]:' \
|
||||
'case[Common Test case]:' \
|
||||
'dump_spec[Dump reltool spec]:' \
|
||||
'jobs[Number of workers]::workers:(0 1 2 3 4 5 6 7 8 9)' \
|
||||
'suites[Common Test suites]::suite name:_path_files -W "(src test)" -g "*.erl(:r)"' \
|
||||
'verbose[Verbosity level]::verbosity level:(0 1 2 3)' \
|
||||
'appid[Application id]:' \
|
||||
'previous_release[Previous release path]:' \
|
||||
'nodeid[Node id]:' \
|
||||
'root_dir[Reltool config root directory]::directory:_files -/' \
|
||||
'skip_deps[Skip deps]::flag:(true false)' \
|
||||
'skip_apps[Application names to not process]::flag:(true false)' \
|
||||
'template[Template name]:' \
|
||||
'template_dir[Template directory]::directory:_files -/' \
|
||||
&& ret=0
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_rebar
|
||||
|
||||
# Local variables:
|
||||
# mode: shell-script
|
||||
# sh-basic-offset: 2
|
||||
# sh-indent-comment: t
|
||||
# indent-tabs-mode: nil
|
||||
# End:
|
||||
# ex: sw=2 ts=2 et filetype=sh
|
||||
17
plugins/torrent/torrent.plugin.zsh
Normal file
17
plugins/torrent/torrent.plugin.zsh
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#
|
||||
# Algorithm borrowed from http://wiki.rtorrent.org/MagnetUri and adapted to work with zsh.
|
||||
#
|
||||
|
||||
function magnet_to_torrent() {
|
||||
[[ "$1" =~ xt=urn:btih:([^\&/]+) ]] || return 1
|
||||
|
||||
hashh=${match[1]}
|
||||
|
||||
if [[ "$1" =~ dn=([^\&/]+) ]];then
|
||||
filename=${match[1]}
|
||||
else
|
||||
filename=$hashh
|
||||
fi
|
||||
|
||||
echo "d10:magnet-uri${#1}:${1}e" > "$filename.torrent"
|
||||
}
|
||||
|
|
@ -16,8 +16,12 @@ function vundle () {
|
|||
vim -c "execute \"BundleInstall\" | q | q"
|
||||
}
|
||||
|
||||
|
||||
function vundle-update () {
|
||||
vundle-init
|
||||
vim -c "execute \"BundleInstall!\" | q | q"
|
||||
}
|
||||
|
||||
function vundle-clean () {
|
||||
vundle-init
|
||||
vim -c "execute \"BundleClean!\" | q | q"
|
||||
}
|
||||
|
|
|
|||
8
themes/crcandy.zsh-theme
Normal file
8
themes/crcandy.zsh-theme
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
PROMPT=$'
|
||||
%{$fg_bold[green]%}%n@%m %{$fg[blue]%}%D{[%I:%M:%S]} %{$reset_color%}%{$fg[white]%}[%~]%{$reset_color%} $(git_prompt_info)\
|
||||
%{$fg[blue]%}->%{$fg_bold[blue]%} %#%{$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=""
|
||||
|
|
@ -21,7 +21,7 @@ echo "\033[0;34mUsing the Oh My Zsh template file and adding it to ~/.zshrc\033[
|
|||
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
|
||||
|
||||
echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m"
|
||||
echo "export PATH=$PATH" >> ~/.zshrc
|
||||
echo "export PATH=\$PATH:$PATH" >> ~/.zshrc
|
||||
|
||||
echo "\033[0;34mTime to change your default shell to zsh!\033[0m"
|
||||
chsh -s `which zsh`
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
current_path=`pwd`
|
||||
current_path=${current_path/ /\\ }
|
||||
printf '\033[0;34m%s\033[0m\n' "Upgrading Oh My Zsh"
|
||||
cd $ZSH
|
||||
cd "$ZSH"
|
||||
|
||||
if git pull origin master
|
||||
then
|
||||
|
|
@ -16,4 +17,4 @@ else
|
|||
printf '\033[0;31m%s\033[0m\n' 'There was an error updating. Try again later?'
|
||||
fi
|
||||
|
||||
cd "$current_path"
|
||||
cd "$current_path"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue