mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-04-24 04:29:25 +02:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
dbe8c470ce
19 changed files with 300 additions and 88 deletions
|
|
@ -12,9 +12,9 @@ To learn more, visit [ohmyz.sh](http://ohmyz.sh) and follow [@ohmyzsh](https://t
|
|||
|
||||
### Prerequisites
|
||||
|
||||
__Disclaimer:__ _Oh My Zsh works best on Mac OS X and Linux._
|
||||
__Disclaimer:__ _Oh My Zsh works best on OS X and Linux._
|
||||
|
||||
* Unix-based operating system (Mac OS X or Linux)
|
||||
* Unix-based operating system (OS X or Linux)
|
||||
* [Zsh](http://www.zsh.org) should be installed (v4.3.9 or more recent). If not pre-installed (`zsh --version` to confirm), check the following instruction here: [Installing ZSH](https://github.com/robbyrussell/oh-my-zsh/wiki/Installing-ZSH)
|
||||
* `curl` or `wget` should be installed
|
||||
* `git` should be installed
|
||||
|
|
@ -26,13 +26,13 @@ Oh My Zsh is installed by running one of the following commands in your terminal
|
|||
#### via curl
|
||||
|
||||
```shell
|
||||
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
|
||||
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
|
||||
```
|
||||
|
||||
#### via wget
|
||||
|
||||
```shell
|
||||
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
|
||||
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
|
||||
```
|
||||
|
||||
## Using Oh My Zsh
|
||||
|
|
@ -104,7 +104,7 @@ The default location is `~/.oh-my-zsh` (hidden in your home directory)
|
|||
If you'd like to change the install directory with the `ZSH` environment variable, either by running `export ZSH=/your/path` before installing, or by setting it before the end of the install pipeline like this:
|
||||
|
||||
```shell
|
||||
export ZSH="$HOME/.dotfiles/oh-my-zsh"; sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
|
||||
export ZSH="$HOME/.dotfiles/oh-my-zsh"; sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
|
||||
```
|
||||
|
||||
#### Manual Installation
|
||||
|
|
|
|||
12
lib/git.zsh
12
lib/git.zsh
|
|
@ -216,6 +216,18 @@ function git_compare_version() {
|
|||
echo 0
|
||||
}
|
||||
|
||||
# Outputs the name of the current user
|
||||
# Usage example: $(git_current_user_name)
|
||||
function git_current_user_name() {
|
||||
command git config user.name 2>/dev/null
|
||||
}
|
||||
|
||||
# Outputs the email of the current user
|
||||
# Usage example: $(git_current_user_email)
|
||||
function git_current_user_email() {
|
||||
command git config user.email 2>/dev/null
|
||||
}
|
||||
|
||||
# This is unlikely to change so make it all statically assigned
|
||||
POST_1_7_2_GIT=$(git_compare_version "1.7.2")
|
||||
# Clean up the namespace slightly by removing the checker function
|
||||
|
|
|
|||
27
plugins/asdf/README.md
Normal file
27
plugins/asdf/README.md
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
## asdf
|
||||
|
||||
**Maintainer:** [@RobLoach](https://github.com/RobLoach)
|
||||
|
||||
Adds integration with [asdf](https://github.com/asdf-vm/asdf), the extendable version manager, with support for Ruby, Node.js, Elixir, Erlang and more.
|
||||
|
||||
### Installation
|
||||
|
||||
1. Enable the plugin by adding it to your `plugins` definition in `~/.zshrc`.
|
||||
|
||||
```
|
||||
plugins=(asdf)
|
||||
```
|
||||
|
||||
2. [Install asdf](https://github.com/asdf-vm/asdf#setup) by running the following:
|
||||
```
|
||||
git clone https://github.com/asdf-vm/asdf.git ~/.asdf
|
||||
```
|
||||
|
||||
### Usage
|
||||
|
||||
See the [asdf usage documentation](https://github.com/asdf-vm/asdf#usage) for information on how to use asdf:
|
||||
|
||||
```
|
||||
asdf plugin-add nodejs git@github.com:asdf-vm/asdf-nodejs.git
|
||||
asdf install nodejs 5.9.1
|
||||
```
|
||||
7
plugins/asdf/asdf.plugin.zsh
Normal file
7
plugins/asdf/asdf.plugin.zsh
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# Find where asdf should be installed.
|
||||
ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}"
|
||||
|
||||
# Load asdf, if found.
|
||||
if [ -f $ASDF_DIR/asdf.sh ]; then
|
||||
. $ASDF_DIR/asdf.sh
|
||||
fi
|
||||
|
|
@ -6,6 +6,7 @@
|
|||
- `bl` aliased to `bundle list`
|
||||
- `bp` aliased to `bundle package`
|
||||
- `bo` aliased to `bundle open`
|
||||
- `bout` aliased to `bundle outdated`
|
||||
- `bu` aliased to `bundle update`
|
||||
- `bi` aliased to `bundle install --jobs=<cpu core count>` (only for bundler `>= 1.4.0`)
|
||||
- adds a wrapper for common gems:
|
||||
|
|
|
|||
12
plugins/geeknote/README.md
Normal file
12
plugins/geeknote/README.md
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
## ZSH-Geeknote
|
||||
|
||||
[Geeknote](https://github.com/VitaliyRodnenko/geeknote) plugin for [oh-my-zsh framework](http://github.com/robbyrussell/oh-my-zsh).
|
||||
|
||||
Plugins provides:
|
||||
|
||||
- auto completion of commands and their options
|
||||
- alias `gn`
|
||||
|
||||
You can find information how to install Geeknote and it's available commands on the [project website](http://www.geeknote.me/).
|
||||
|
||||
Maintainer : Ján Koščo ([@s7anley](https://twitter.com/s7anley))
|
||||
136
plugins/geeknote/_geeknote
Normal file
136
plugins/geeknote/_geeknote
Normal file
|
|
@ -0,0 +1,136 @@
|
|||
#compdef geeknote
|
||||
# --------------- ------------------------------------------------------------
|
||||
# Name : _geeknote
|
||||
# Synopsis : zsh completion for geeknote
|
||||
# Author : Ján Koščo <3k.stanley@gmail.com>
|
||||
# HomePage : http://www.geeknote.me
|
||||
# Version : 0.1
|
||||
# Tag : [ shell, zsh, completion, evernote ]
|
||||
# Copyright : © 2014 by Ján Koščo,
|
||||
# Released under current GPL license.
|
||||
# --------------- ------------------------------------------------------------
|
||||
|
||||
local -a _1st_arguments
|
||||
_1st_arguments=(
|
||||
'login'
|
||||
'logout'
|
||||
'settings'
|
||||
'create'
|
||||
'edit'
|
||||
'find'
|
||||
'show'
|
||||
'remove'
|
||||
'notebook-list'
|
||||
'notebook-create'
|
||||
'notebook-edit'
|
||||
'tag-list'
|
||||
'tag-create'
|
||||
'tag-edit'
|
||||
'tag-remove'
|
||||
'gnsync'
|
||||
'user'
|
||||
)
|
||||
|
||||
_arguments '*:: :->command'
|
||||
|
||||
if (( CURRENT == 1 )); then
|
||||
_describe -t commands "geeknote command" _1st_arguments
|
||||
return
|
||||
fi
|
||||
|
||||
local -a _command_args
|
||||
case "$words[1]" in
|
||||
user)
|
||||
_command_args=(
|
||||
'(--full)--full' \
|
||||
)
|
||||
;;
|
||||
logout)
|
||||
_command_args=(
|
||||
'(--force)--force' \
|
||||
)
|
||||
;;
|
||||
settings)
|
||||
_command_args=(
|
||||
'(--editor)--editor' \
|
||||
)
|
||||
;;
|
||||
create)
|
||||
_command_args=(
|
||||
'(-t|--title)'{-t,--title}'[note title]' \
|
||||
'(-c|--content)'{-c,--content}'[note content]' \
|
||||
'(-tg|--tags)'{-tg,--tags}'[one tag or the list of tags which will be added to the note]' \
|
||||
'(-nb|--notebook)'{-nb,--notebook}'[name of notebook where to save note]' \
|
||||
)
|
||||
;;
|
||||
edit)
|
||||
_command_args=(
|
||||
'(-n|--note)'{-n,--note}'[name or ID from the previous search of a note to edit]' \
|
||||
'(-t|--title)'{-t,--title}'[note title]' \
|
||||
'(-c|--content)'{-c,--content}'[note content]' \
|
||||
'(-tg|--tags)'{-tg,--tags}'[one tag or the list of tags which will be added to the note]' \
|
||||
'(-nb|--notebook)'{-nb,--notebook}'[name of notebook where to save note]' \
|
||||
)
|
||||
;;
|
||||
remove)
|
||||
_command_args=(
|
||||
'(-n|--note)'{-n,--note}'[name or ID from the previous search of a note to edit]' \
|
||||
'(--force)--force' \
|
||||
)
|
||||
;;
|
||||
show)
|
||||
_command_args=(
|
||||
'(-n|--note)'{-n,--note}'[name or ID from the previous search of a note to edit]' \
|
||||
)
|
||||
;;
|
||||
find)
|
||||
_command_args=(
|
||||
'(-s|--search)'{-s,--search}'[text to search]' \
|
||||
'(-tg|--tags)'{-tg,--tags}'[notes with which tag/tags to search]' \
|
||||
'(-nb|--notebook)'{-nb,--notebook}'[in which notebook search the note]' \
|
||||
'(-d|--date)'{-d,--date}'[date in format dd.mm.yyyy or date range dd.mm.yyyy-dd.mm.yyyy]' \
|
||||
'(-cn|--count)'{-cn,--count}'[how many notes show in the result list]' \
|
||||
'(-uo|--url-only)'{-uo,--url-only}'[add direct url of each note in results to Evernote web-version]' \
|
||||
'(-ee|--exact-entry)'{-ee,--exact-entry}'[search for exact entry of the request]' \
|
||||
'(-cs|--content-search)'{-cs,--content-search}'[search by content, not by title]' \
|
||||
)
|
||||
;;
|
||||
notebook-create)
|
||||
_command_args=(
|
||||
'(-t|--title)'{-t,--title}'[notebook title]' \
|
||||
)
|
||||
;;
|
||||
notebook-edit)
|
||||
_command_args=(
|
||||
'(-nb|--notebook)'{-nb,--notebook}'[name of notebook to rename]' \
|
||||
'(-t|--title)'{-t,--title}'[new notebook title]' \
|
||||
)
|
||||
;;
|
||||
notebook-remove)
|
||||
_command_args=(
|
||||
'(-nb|--notebook)'{-nb,--notebook}'[name of notebook to remove]' \
|
||||
'(--force)--force' \
|
||||
)
|
||||
;;
|
||||
tag-create)
|
||||
_command_args=(
|
||||
'(-t|--title)'{-t,--title}'[title of tag]' \
|
||||
)
|
||||
;;
|
||||
tag-edit)
|
||||
_command_args=(
|
||||
'(-tgn|--tagname)'{-tgn,--tagname}'[tag to edit]' \
|
||||
'(-t|--title)'{-t,--title}'[new tag name]' \
|
||||
)
|
||||
;;
|
||||
tag-remove)
|
||||
_command_args=(
|
||||
'(-tgn|--tagname)'{-tgn,--tagname}'[tag to remove]' \
|
||||
'(--force)--force' \
|
||||
)
|
||||
;;
|
||||
esac
|
||||
|
||||
_arguments \
|
||||
$_command_args \
|
||||
&& return 0
|
||||
2
plugins/geeknote/geeknote.plugin.zsh
Normal file
2
plugins/geeknote/geeknote.plugin.zsh
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
#Alias
|
||||
alias gn='geeknote'
|
||||
|
|
@ -146,15 +146,15 @@ alias gke='\gitk --all $(git log -g --pretty=format:%h)'
|
|||
compdef _git gke='gitk'
|
||||
|
||||
alias gl='git pull'
|
||||
alias glg='git log --stat --color'
|
||||
alias glgp='git log --stat --color -p'
|
||||
alias glgg='git log --graph --color'
|
||||
alias glg='git log --stat'
|
||||
alias glgp='git log --stat -p'
|
||||
alias glgg='git log --graph'
|
||||
alias glgga='git log --graph --decorate --all'
|
||||
alias glgm='git log --graph --max-count=10'
|
||||
alias glo='git log --oneline --decorate --color'
|
||||
alias glo='git log --oneline --decorate'
|
||||
alias glol="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
|
||||
alias glola="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --all"
|
||||
alias glog='git log --oneline --decorate --color --graph'
|
||||
alias glog='git log --oneline --decorate --graph'
|
||||
alias glp="_git_log_prettily"
|
||||
compdef _git glp=git-log
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# github
|
||||
|
||||
This plugin supports working with GitHub the command line. It provides a few things:
|
||||
This plugin supports working with GitHub from the command line. It provides a few things:
|
||||
|
||||
* Sets up the `hub` wrapper and completions for the `git` command if you have `hub` installed.
|
||||
* Completion for the `github` Ruby gem.
|
||||
|
|
@ -37,7 +37,7 @@ See `man hub` for more details.
|
|||
|
||||
### Homebrew installation note
|
||||
|
||||
If you have installed `hub` using Homebrew, its completions may not be on your `$FPATH` if you are using the system `zsh`. Homebrew installs `zsh` completion definitions to `/usr/local/share/zsh/site-functions`, which on `$FPATH` for the Homebrew-installed `zsh`, but not for the system `zsh`. If you want it to work with the system `zsh`, add this to your `~/.zshrc` before it sources `oh-my-zsh.sh`.
|
||||
If you have installed `hub` using Homebrew, its completions may not be on your `$FPATH` if you are using the system `zsh`. Homebrew installs `zsh` completion definitions to `/usr/local/share/zsh/site-functions`, which will be on `$FPATH` for the Homebrew-installed `zsh`, but not for the system `zsh`. If you want it to work with the system `zsh`, add this to your `~/.zshrc` before it sources `oh-my-zsh.sh`.
|
||||
|
||||
```zsh
|
||||
if (( ! ${fpath[(I)/usr/local/share/zsh/site-functions]} )); then
|
||||
|
|
|
|||
|
|
@ -17,3 +17,6 @@ alias npmD="npm i -D "
|
|||
# Execute command from node_modules folder based on current directory
|
||||
# i.e npmE gulp
|
||||
alias npmE='PATH="$(npm bin)":"$PATH"'
|
||||
|
||||
# Check which npm modules are outdated
|
||||
alias npmO="npm outdated"
|
||||
|
|
|
|||
|
|
@ -25,3 +25,5 @@ alias sfcw='sf cache:warmup'
|
|||
alias sfroute='sf router:debug'
|
||||
alias sfcontainer='sf container:debug'
|
||||
alias sfgb='sf generate:bundle'
|
||||
alias sfdev='sf --env=dev'
|
||||
alias sfprod='sf --env=prod'
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
# If the tm command is called without an argument, open TextMate in the current directory
|
||||
# If tm is passed a directory, cd to it and open it in TextMate
|
||||
# If tm is passed a file, open it in TextMate
|
||||
# If tm is passed anything else (i.e., a list of files and/or options), pass them all along
|
||||
# This allows easy opening of multiple files.
|
||||
function tm() {
|
||||
if [[ -z $1 ]]; then
|
||||
mate .
|
||||
else
|
||||
elif [[ -d $1 ]]; then
|
||||
mate $1
|
||||
if [[ -d $1 ]]; then
|
||||
cd $1
|
||||
fi
|
||||
cd $1
|
||||
else
|
||||
mate "$@"
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,16 +2,25 @@
|
|||
|
||||
PROMPT='
|
||||
$(_user_host)${_current_dir} $(git_prompt_info) $(_ruby_version)
|
||||
▶ '
|
||||
%{$fg[$CARETCOLOR]%}▶%{$resetcolor%} '
|
||||
|
||||
PROMPT2='%{$fg[grey]%}◀%{$reset_color%} '
|
||||
PROMPT2='%{$fg[$CARETCOLOR]%}◀%{$reset_color%} '
|
||||
|
||||
RPROMPT='$(_vi_status)%{$(echotc UP 1)%}$(_git_time_since_commit) $(git_prompt_status) ${_return_status}%{$(echotc DO 1)%}'
|
||||
|
||||
local _current_dir="%{$fg[blue]%}%3~%{$reset_color%} "
|
||||
local _return_status="%{$fg[red]%}%(?..⍉)%{$reset_color%}"
|
||||
local _current_dir="%{$fg_bold[blue]%}%3~%{$reset_color%} "
|
||||
local _return_status="%{$fg_bold[red]%}%(?..⍉)%{$reset_color%}"
|
||||
local _hist_no="%{$fg[grey]%}%h%{$reset_color%}"
|
||||
|
||||
function _current_dir() {
|
||||
local _max_pwd_length="65"
|
||||
if [[ $(echo -n $PWD | wc -c) -gt ${_max_pwd_length} ]]; then
|
||||
echo "%{$fg_bold[blue]%}%-2~ ... %3~%{$reset_color%} "
|
||||
else
|
||||
echo "%{$fg_bold[blue]%}%~%{$reset_color%} "
|
||||
fi
|
||||
}
|
||||
|
||||
function _user_host() {
|
||||
if [[ -n $SSH_CONNECTION ]]; then
|
||||
me="%n@%m"
|
||||
|
|
@ -85,13 +94,13 @@ ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%}⚑ "
|
|||
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%}✖ "
|
||||
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%}▴ "
|
||||
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[cyan]%}§ "
|
||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%}◒ "
|
||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[white]%}◒ "
|
||||
|
||||
# Colors vary depending on time lapsed.
|
||||
ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}"
|
||||
ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}"
|
||||
ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}"
|
||||
ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[grey]%}"
|
||||
ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[white]%}"
|
||||
|
||||
# LS colors, made with http://geoff.greer.fm/lscolors/
|
||||
export LSCOLORS="exfxcxdxbxegedabagacad"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,13 @@
|
|||
# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png
|
||||
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
||||
|
||||
local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
|
||||
|
||||
if [[ $UID -eq 0 ]]; then
|
||||
local user_host='%{$terminfo[bold]$fg[red]%}%n@%m%{$reset_color%}'
|
||||
else
|
||||
local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
|
||||
fi
|
||||
|
||||
local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}'
|
||||
local rvm_ruby=''
|
||||
if which rvm-prompt &> /dev/null; then
|
||||
|
|
|
|||
|
|
@ -23,31 +23,35 @@ bureau_git_branch () {
|
|||
}
|
||||
|
||||
bureau_git_status () {
|
||||
_INDEX=$(command git status --porcelain -b 2> /dev/null)
|
||||
_STATUS=""
|
||||
if $(echo "$_INDEX" | grep '^[AMRD]. ' &> /dev/null); then
|
||||
_STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_STAGED"
|
||||
fi
|
||||
if $(echo "$_INDEX" | grep '^.[MTD] ' &> /dev/null); then
|
||||
_STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNSTAGED"
|
||||
fi
|
||||
if $(echo "$_INDEX" | command grep -E '^\?\? ' &> /dev/null); then
|
||||
_STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNTRACKED"
|
||||
fi
|
||||
if $(echo "$_INDEX" | grep '^UU ' &> /dev/null); then
|
||||
_STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNMERGED"
|
||||
fi
|
||||
if $(command git rev-parse --verify refs/stash >/dev/null 2>&1); then
|
||||
_STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_STASHED"
|
||||
fi
|
||||
if $(echo "$_INDEX" | grep '^## .*ahead' &> /dev/null); then
|
||||
_STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_AHEAD"
|
||||
fi
|
||||
if $(echo "$_INDEX" | grep '^## .*behind' &> /dev/null); then
|
||||
_STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_BEHIND"
|
||||
fi
|
||||
if $(echo "$_INDEX" | grep '^## .*diverged' &> /dev/null); then
|
||||
_STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_DIVERGED"
|
||||
if [[ $(command git status --short 2> /dev/null) != "" ]]; then
|
||||
_INDEX=$(command git status --porcelain -b 2> /dev/null)
|
||||
if $(echo "$_INDEX" | command grep '^[AMRD]. ' &> /dev/null); then
|
||||
_STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_STAGED"
|
||||
fi
|
||||
if $(echo "$_INDEX" | command grep '^.[MTD] ' &> /dev/null); then
|
||||
_STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNSTAGED"
|
||||
fi
|
||||
if $(echo "$_INDEX" | command grep -E '^\?\? ' &> /dev/null); then
|
||||
_STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNTRACKED"
|
||||
fi
|
||||
if $(echo "$_INDEX" | command grep '^UU ' &> /dev/null); then
|
||||
_STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_UNMERGED"
|
||||
fi
|
||||
if $(command git rev-parse --verify refs/stash >/dev/null 2>&1); then
|
||||
_STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_STASHED"
|
||||
fi
|
||||
if $(echo "$_INDEX" | command grep '^## .*ahead' &> /dev/null); then
|
||||
_STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_AHEAD"
|
||||
fi
|
||||
if $(echo "$_INDEX" | command grep '^## .*behind' &> /dev/null); then
|
||||
_STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_BEHIND"
|
||||
fi
|
||||
if $(echo "$_INDEX" | command grep '^## .*diverged' &> /dev/null); then
|
||||
_STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_DIVERGED"
|
||||
fi
|
||||
else
|
||||
_STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_CLEAN"
|
||||
fi
|
||||
|
||||
echo $_STATUS
|
||||
|
|
@ -84,10 +88,10 @@ _LIBERTY="$_LIBERTY%{$reset_color%}"
|
|||
get_space () {
|
||||
local STR=$1$2
|
||||
local zero='%([BSUbfksu]|([FB]|){*})'
|
||||
local LENGTH=${#${(S%%)STR//$~zero/}}
|
||||
local LENGTH=${#${(S%%)STR//$~zero/}}
|
||||
local SPACES=""
|
||||
(( LENGTH = ${COLUMNS} - $LENGTH - 1))
|
||||
|
||||
|
||||
for i in {0..$LENGTH}
|
||||
do
|
||||
SPACES="$SPACES "
|
||||
|
|
@ -101,7 +105,7 @@ _1RIGHT="[%*] "
|
|||
|
||||
bureau_precmd () {
|
||||
_1SPACES=`get_space $_1LEFT $_1RIGHT`
|
||||
print
|
||||
print
|
||||
print -rP "$_1LEFT$_1SPACES$_1RIGHT"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
PROMPT=$'%{$fg_bold[green]%}%n@%m %{$fg[blue]%}%D{[%I:%M:%S]} %{$reset_color%}%{$fg[white]%}[%~]%{$reset_color%} $(git_prompt_info)\
|
||||
PROMPT=$'%{$fg_bold[green]%}%n@%m %{$fg[blue]%}%D{[%X]} %{$reset_color%}%{$fg[white]%}[%~]%{$reset_color%} $(git_prompt_info)\
|
||||
%{$fg[blue]%}->%{$fg_bold[blue]%} %#%{$reset_color%} '
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}["
|
||||
|
|
|
|||
|
|
@ -1,13 +1,15 @@
|
|||
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
||||
|
||||
PROMPT='%{$fg[green]%}%c \
|
||||
PROMPT='$(virtualenv_prompt_info)%{[03m%}%{$fg[green]%}%c \
|
||||
$(git_prompt_info)\
|
||||
\
|
||||
%{$fg[red]%}%(!.#.»)%{$reset_color%} '
|
||||
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
|
||||
RPS1='%{$fg[blue]%}%~%{$reset_color%} ${return_code} '
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}:: %{$fg[yellow]%}("
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[yellow]%}("
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%} "
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$fg[yellow]%}"
|
||||
|
||||
ZSH_THEME_VIRTUAL_ENV_PROMPT_PREFIX="%{$reset_color%}%{[03m%}%{$fg[blue]%}"
|
||||
ZSH_THEME_VIRTUAL_ENV_PROMPT_SUFFIX="!%{$reset_color%} "
|
||||
|
|
@ -1,18 +1,9 @@
|
|||
# Clean, simple, compatible and meaningful.
|
||||
# Tested on Linux, Unix and Windows under ANSI colors.
|
||||
# It is recommended to use with a dark background and the font Inconsolata.
|
||||
# It is recommended to use with a dark background.
|
||||
# Colors: black, red, green, yellow, *blue, magenta, cyan, and white.
|
||||
#
|
||||
# http://ysmood.org/wp/2013/03/my-ys-terminal-theme/
|
||||
# Mar 2013 ys
|
||||
|
||||
# Machine name.
|
||||
function box_name {
|
||||
[ -f ~/.box-name ] && cat ~/.box-name || echo $HOST
|
||||
}
|
||||
|
||||
# Directory info.
|
||||
local current_dir='${PWD/#$HOME/~}'
|
||||
#
|
||||
# Mar 2013 Yad Smood
|
||||
|
||||
# VCS
|
||||
YS_VCS_PROMPT_PREFIX1=" %{$fg[white]%}on%{$reset_color%} "
|
||||
|
|
@ -21,7 +12,7 @@ YS_VCS_PROMPT_SUFFIX="%{$reset_color%}"
|
|||
YS_VCS_PROMPT_DIRTY=" %{$fg[red]%}x"
|
||||
YS_VCS_PROMPT_CLEAN=" %{$fg[green]%}o"
|
||||
|
||||
# Git info.
|
||||
# Git info
|
||||
local git_info='$(git_prompt_info)'
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="${YS_VCS_PROMPT_PREFIX1}git${YS_VCS_PROMPT_PREFIX2}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="$YS_VCS_PROMPT_SUFFIX"
|
||||
|
|
@ -44,29 +35,26 @@ ys_hg_prompt_info() {
|
|||
fi
|
||||
}
|
||||
|
||||
# Prompt format: \n # USER at MACHINE in DIRECTORY on git:BRANCH STATE [TIME] \n $
|
||||
PROMPT="
|
||||
%{$terminfo[bold]$fg[blue]%}#%{$reset_color%} \
|
||||
%{$fg[cyan]%}%n \
|
||||
%{$fg[white]%}at \
|
||||
%{$fg[green]%}$(box_name) \
|
||||
%{$fg[white]%}in \
|
||||
%{$terminfo[bold]$fg[yellow]%}${current_dir}%{$reset_color%}\
|
||||
${hg_info}\
|
||||
${git_info} \
|
||||
%{$fg[white]%}[%*]
|
||||
%{$terminfo[bold]$fg[red]%}$ %{$reset_color%}"
|
||||
local exit_code="%(?,,C:%{$fg[red]%}%?%{$reset_color%})"
|
||||
|
||||
if [[ "$USER" == "root" ]]; then
|
||||
# Prompt format:
|
||||
#
|
||||
# PRIVILEGES USER @ MACHINE in DIRECTORY on git:BRANCH STATE [TIME] C:LAST_EXIT_CODE
|
||||
# $ COMMAND
|
||||
#
|
||||
# For example:
|
||||
#
|
||||
# % ys @ ys-mbp in ~/.oh-my-zsh on git:master x [21:47:42] C:0
|
||||
# $
|
||||
PROMPT="
|
||||
%{$terminfo[bold]$fg[blue]%}#%{$reset_color%} \
|
||||
%{$bg[yellow]%}%{$fg[cyan]%}%n%{$reset_color%} \
|
||||
%{$fg[white]%}at \
|
||||
%{$fg[green]%}$(box_name) \
|
||||
%(#,%{$bg[yellow]%}%{$fg[black]%}%n%{$reset_color%},%{$fg[cyan]%}%n) \
|
||||
%{$fg[white]%}@ \
|
||||
%{$fg[green]%}%m \
|
||||
%{$fg[white]%}in \
|
||||
%{$terminfo[bold]$fg[yellow]%}${current_dir}%{$reset_color%}\
|
||||
%{$terminfo[bold]$fg[yellow]%}%~%{$reset_color%}\
|
||||
${hg_info}\
|
||||
${git_info} \
|
||||
%{$fg[white]%}[%*]
|
||||
${git_info}\
|
||||
\
|
||||
%{$fg[white]%}[%*] $exit_code
|
||||
%{$terminfo[bold]$fg[red]%}$ %{$reset_color%}"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue