mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-09 02:24:03 +01:00
Merge branch 'master' of https://github.com/robbyrussell/oh-my-zsh
This commit is contained in:
commit
423459e269
7 changed files with 67 additions and 25 deletions
21
MIT-LICENSE.txt
Normal file
21
MIT-LICENSE.txt
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
The MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2009-2013 Robby Russell and contributors (see https://github.com/robbyrussell/oh-my-zsh/contributors)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
16
lib/git.zsh
16
lib/git.zsh
|
|
@ -9,13 +9,15 @@ function git_prompt_info() {
|
||||||
# Checks if working tree is dirty
|
# Checks if working tree is dirty
|
||||||
parse_git_dirty() {
|
parse_git_dirty() {
|
||||||
local SUBMODULE_SYNTAX=''
|
local SUBMODULE_SYNTAX=''
|
||||||
if [[ $POST_1_7_2_GIT -gt 0 ]]; then
|
if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then
|
||||||
SUBMODULE_SYNTAX="--ignore-submodules=dirty"
|
if [[ $POST_1_7_2_GIT -gt 0 ]]; then
|
||||||
fi
|
SUBMODULE_SYNTAX="--ignore-submodules=dirty"
|
||||||
if [[ -n $(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null) ]]; then
|
fi
|
||||||
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
|
if [[ -n $(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null) ]]; then
|
||||||
else
|
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
|
||||||
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
|
else
|
||||||
|
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,4 @@
|
||||||
encode64(){ echo -n $1 | base64 }
|
encode64(){ echo -n $1 | base64 }
|
||||||
decode64(){ echo -n $1 | base64 -D }
|
decode64(){ echo -n $1 | base64 -D }
|
||||||
|
alias e64=encode64
|
||||||
|
alias d64=decode64
|
||||||
|
|
|
||||||
|
|
@ -5,15 +5,29 @@ function _lein_commands() {
|
||||||
case $state in
|
case $state in
|
||||||
subcommand)
|
subcommand)
|
||||||
subcommands=(
|
subcommands=(
|
||||||
|
"classpath:print the classpath of the current project"
|
||||||
"clean:remove compiled files and dependencies from project"
|
"clean:remove compiled files and dependencies from project"
|
||||||
"compile:ahead-of-time compile the project"
|
"compile:ahead-of-time compile the project"
|
||||||
|
"deploy:build jar and deploy to remote repository"
|
||||||
"deps:download and install all dependencies"
|
"deps:download and install all dependencies"
|
||||||
"help:display a list of tasks or help for a given task"
|
"help:display a list of tasks or help for a given task"
|
||||||
"install:install the project and its dependencies in your local repository"
|
"install:install the project and its dependencies in your local repository"
|
||||||
|
"int:enter an interactive task shell"
|
||||||
|
"interactive:enter an interactive task shell"
|
||||||
|
"jack-in:jack in to a clojure slime session from emacs."
|
||||||
"jar:create a jar file containing the compiled .class files"
|
"jar:create a jar file containing the compiled .class files"
|
||||||
|
"javac:compile java source files"
|
||||||
"new:create a new project skeleton"
|
"new:create a new project skeleton"
|
||||||
|
"plugin:manage user-level plugins"
|
||||||
"pom:write a pom.xml file to disk for maven interop"
|
"pom:write a pom.xml file to disk for maven interop"
|
||||||
|
"repl:start a repl session either with the current project or standalone"
|
||||||
|
"retest:run only the test namespaces which failed last time around"
|
||||||
|
"run:run the project's -main function"
|
||||||
|
"search:search remote maven repositories for matching jars"
|
||||||
|
"swank:launch swank server for Emacs to connect"
|
||||||
"test:run the project's tests"
|
"test:run the project's tests"
|
||||||
|
"test!:run a project's tests after cleaning and fetching dependencies"
|
||||||
|
"trampoline:run a task without nesting the project's JVM inside Leiningen's."
|
||||||
"uberjar:Create a jar including the contents of each of deps"
|
"uberjar:Create a jar including the contents of each of deps"
|
||||||
"upgrade:upgrade leiningen to the latest stable release"
|
"upgrade:upgrade leiningen to the latest stable release"
|
||||||
"version:print leiningen's version"
|
"version:print leiningen's version"
|
||||||
|
|
|
||||||
|
|
@ -57,8 +57,6 @@ sprunge() {
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo Using input from a pipe or STDIN redirection... >&2
|
echo Using input from a pipe or STDIN redirection... >&2
|
||||||
while read -r line ; do
|
curl -F 'sprunge=<-' http://sprunge.us
|
||||||
echo $line
|
|
||||||
done | curl -F 'sprunge=<-' http://sprunge.us
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,18 +3,13 @@
|
||||||
function zle-keymap-select zle-line-init zle-line-finish {
|
function zle-keymap-select zle-line-init zle-line-finish {
|
||||||
# The terminal must be in application mode when ZLE is active for $terminfo
|
# The terminal must be in application mode when ZLE is active for $terminfo
|
||||||
# values to be valid.
|
# values to be valid.
|
||||||
if (( $+terminfo[smkx] && $+terminfo[rmkx] )); then
|
if (( ${+terminfo[smkx]} )); then
|
||||||
case "$0" in
|
printf '%s' ${terminfo[smkx]}
|
||||||
(zle-line-init)
|
|
||||||
# Enable terminal application mode.
|
|
||||||
echoti smkx
|
|
||||||
;;
|
|
||||||
(zle-line-finish)
|
|
||||||
# Disable terminal application mode.
|
|
||||||
echoti rmkx
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
fi
|
||||||
|
if (( ${+terminfo[rmkx]} )); then
|
||||||
|
printf '%s' ${terminfo[rmkx]}
|
||||||
|
fi
|
||||||
|
|
||||||
zle reset-prompt
|
zle reset-prompt
|
||||||
zle -R
|
zle -R
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,13 +8,23 @@ function _prompt_char() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# This theme works with both the "dark" and "light" variants of the
|
||||||
|
# Solarized color schema. Set the SOLARIZED_THEME variable to one of
|
||||||
|
# these two values to choose. If you don't specify, we'll assume you're
|
||||||
|
# using the "dark" variant.
|
||||||
|
|
||||||
|
case ${SOLARIZED_THEME:-dark} in
|
||||||
|
light) bkg=white;;
|
||||||
|
*) bkg=black;;
|
||||||
|
esac
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX=" [%{%B%F{blue}%}"
|
ZSH_THEME_GIT_PROMPT_PREFIX=" [%{%B%F{blue}%}"
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{%f%k%b%K{black}%B%F{green}%}]"
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{%f%k%b%K{${bkg}}%B%F{green}%}]"
|
||||||
ZSH_THEME_GIT_PROMPT_DIRTY=" %{%F{red}%}*%{%f%k%b%}"
|
ZSH_THEME_GIT_PROMPT_DIRTY=" %{%F{red}%}*%{%f%k%b%}"
|
||||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||||
|
|
||||||
PROMPT='%{%f%k%b%}
|
PROMPT='%{%f%k%b%}
|
||||||
%{%K{black}%B%F{green}%}%n%{%B%F{blue}%}@%{%B%F{cyan}%}%m%{%B%F{green}%} %{%b%F{yellow}%K{black}%}%~%{%B%F{green}%}$(git_prompt_info)%E%{%f%k%b%}
|
%{%K{${bkg}}%B%F{green}%}%n%{%B%F{blue}%}@%{%B%F{cyan}%}%m%{%B%F{green}%} %{%b%F{yellow}%K{${bkg}}%}%~%{%B%F{green}%}$(git_prompt_info)%E%{%f%k%b%}
|
||||||
%{%K{black}%}$(_prompt_char)%{%K{black}%} %#%{%f%k%b%} '
|
%{%K{${bkg}}%}$(_prompt_char)%{%K{${bkg}}%} %#%{%f%k%b%} '
|
||||||
|
|
||||||
RPROMPT='!%{%B%F{cyan}%}%!%{%f%k%b%}'
|
RPROMPT='!%{%B%F{cyan}%}%!%{%f%k%b%}'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue