Unverified Commit 8c95c523 authored by Kozlov Alexander's avatar Kozlov Alexander Committed by GitHub
Browse files

Merge branch 'master' into master

parents dd30cf10 3d8f2bda
......@@ -22,6 +22,9 @@ OPTIONS
\fB\-c\fR
restrict matches to subdirectories of the current directory
.TP
\fB\-e\fR
echo the best match, don't cd
.TP
\fB\-h\fR
show a brief help message
.TP
......@@ -90,7 +93,8 @@ Set \fB$_Z_OWNER\fR to allow usage when in 'sudo -s' mode.
(These settings should go in .bashrc/.zshrc before the line added above.)
.RE
.RS
Install the provided man page \fBz.1\fR somewhere like \fB/usr/local/man/man1\fR.
Install the provided man page \fBz.1\fR somewhere in your \f$MANPATH, like
\fB/usr/local/man/man1\fR.
.RE
.SS
Aging:
......
# Copyright (c) 2009 rupa deadwyler under the WTFPL license
# Copyright (c) 2009 rupa deadwyler. Licensed under the WTFPL license, Version 2
# maintains a jump-list of the directories you actually use
#
......@@ -21,6 +21,7 @@
# * z -r foo # cd to highest ranked dir matching foo
# * z -t foo # cd to most recently accessed dir matching foo
# * z -l foo # list matches instead of cd
# * z -e foo # echo the best match, don't cd
# * z -c foo # restrict matches to subdirs of $PWD
[ -d "${_Z_DATA:-$HOME/.z}" ] && {
......@@ -31,9 +32,21 @@ _z() {
local datafile="${_Z_DATA:-$HOME/.z}"
# if symlink, dereference
[ -h "$datafile" ] && datafile=$(readlink "$datafile")
# bail if we don't own ~/.z and $_Z_OWNER not set
[ -z "$_Z_OWNER" -a -f "$datafile" -a ! -O "$datafile" ] && return
_z_dirs () {
local line
while read line; do
# only count directories
[ -d "${line%%\|*}" ] && echo "$line"
done < "$datafile"
return 0
}
# add entries
if [ "$1" = "--add" ]; then
shift
......@@ -49,10 +62,7 @@ _z() {
# maintain the data file
local tempfile="$datafile.$RANDOM"
while read line; do
# only count directories
[ -d "${line%%\|*}" ] && echo $line
done < "$datafile" | awk -v path="$*" -v now="$(date +%s)" -F"|" '
_z_dirs | awk -v path="$*" -v now="$(date +%s)" -F"|" '
BEGIN {
rank[path] = 1
time[path] = now
......@@ -75,7 +85,7 @@ _z() {
} else for( x in rank ) print x "|" rank[x] "|" time[x]
}
' 2>/dev/null >| "$tempfile"
# do our best to avoid clobbering the datafile in a race condition
# do our best to avoid clobbering the datafile in a race condition.
if [ $? -ne 0 -a -f "$datafile" ]; then
env rm -f "$tempfile"
else
......@@ -85,17 +95,15 @@ _z() {
# tab completion
elif [ "$1" = "--complete" -a -s "$datafile" ]; then
while read line; do
[ -d "${line%%\|*}" ] && echo $line
done < "$datafile" | awk -v q="$2" -F"|" '
_z_dirs | awk -v q="$2" -F"|" '
BEGIN {
if( q == tolower(q) ) imatch = 1
q = substr(q, 3)
gsub(" ", ".*", q)
if( q == tolower(q) ) imatch = 1
gsub(/ /, ".*", q)
}
{
if( imatch ) {
if( tolower($1) ~ tolower(q) ) print $1
if( tolower($1) ~ q ) print $1
} else if( $1 ~ q ) print $1
}
' 2>/dev/null
......@@ -106,11 +114,12 @@ _z() {
--) while [ "$1" ]; do shift; local fnd="$fnd${fnd:+ }$1";done;;
-*) local opt=${1:1}; while [ "$opt" ]; do case ${opt:0:1} in
c) local fnd="^$PWD $fnd";;
h) echo "${_Z_CMD:-z} [-chlrtx] args" >&2; return;;
x) sed -i -e "\:^${PWD}|.*:d" "$datafile";;
e) local echo=1;;
h) echo "${_Z_CMD:-z} [-cehlrtx] args" >&2; return;;
l) local list=1;;
r) local typ="rank";;
t) local typ="recent";;
x) sed -i -e "\:^${PWD}|.*:d" "$datafile";;
esac; opt=${opt:1}; done;;
*) local fnd="$fnd${fnd:+ }$1";;
esac; local last=$1; [ "$#" -gt 0 ] && shift; done
......@@ -119,16 +128,14 @@ _z() {
# if we hit enter on a completion just go there
case "$last" in
# completions will always start with /
/*) [ -z "$list" -a -d "$last" ] && cd "$last" && return;;
/*) [ -z "$list" -a -d "$last" ] && builtin cd "$last" && return;;
esac
# no file yet
[ -f "$datafile" ] || return
local cd
cd="$(while read line; do
[ -d "${line%%\|*}" ] && echo $line
done < "$datafile" | awk -v t="$(date +%s)" -v list="$list" -v typ="$typ" -v q="$fnd" -F"|" '
cd="$( < <( _z_dirs ) awk -v t="$(date +%s)" -v list="$list" -v typ="$typ" -v q="$fnd" -F"|" '
function frecent(rank, time) {
# relate frequency and time
dx = t - time
......@@ -137,19 +144,21 @@ _z() {
if( dx < 604800 ) return rank / 2
return rank / 4
}
function output(files, out, common) {
function output(matches, best_match, common) {
# list or return the desired directory
if( list ) {
cmd = "sort -n >&2"
for( x in files ) {
if( files[x] ) printf "%-10s %s\n", files[x], x | cmd
for( x in matches ) {
if( matches[x] ) {
printf "%-10s %s\n", matches[x], x | cmd
}
}
if( common ) {
printf "%-10s %s\n", "common:", common > "/dev/stderr"
}
} else {
if( common ) out = common
print out
if( common ) best_match = common
print best_match
}
}
function common(matches) {
......@@ -160,11 +169,9 @@ _z() {
}
}
if( short == "/" ) return
# use a copy to escape special characters, as we want to return
# the original. yeah, this escaping is awful.
clean_short = short
gsub(/\[\(\)\[\]\|\]/, "\\\\&", clean_short)
for( x in matches ) if( matches[x] && x !~ clean_short ) return
for( x in matches ) if( matches[x] && index(x, short) != 1 ) {
return
}
return short
}
BEGIN {
......@@ -197,8 +204,10 @@ _z() {
}
}
')"
[ $? -gt 0 ] && return
[ "$cd" ] && cd "$cd"
[ $? -eq 0 ] && [ "$cd" ] && {
if [ "$echo" ]; then echo "$cd"; else builtin cd "$cd"; fi
}
fi
}
......@@ -212,11 +221,11 @@ if type compctl >/dev/null 2>&1; then
# populate directory list, avoid clobbering any other precmds.
if [ "$_Z_NO_RESOLVE_SYMLINKS" ]; then
_z_precmd() {
_z --add "${PWD:a}"
(_z --add "${PWD:a}" &)
}
else
_z_precmd() {
_z --add "${PWD:A}"
(_z --add "${PWD:A}" &)
}
fi
[[ -n "${precmd_functions[(r)_z_precmd]}" ]] || {
......@@ -237,7 +246,7 @@ elif type complete >/dev/null 2>&1; then
[ "$_Z_NO_PROMPT_COMMAND" ] || {
# populate directory list. avoid clobbering other PROMPT_COMMANDs.
grep "_z --add" <<< "$PROMPT_COMMAND" >/dev/null || {
PROMPT_COMMAND="$PROMPT_COMMAND"$'\n''_z --add "$(command pwd '$_Z_RESOLVE_SYMLINKS' 2>/dev/null)" 2>/dev/null;'
PROMPT_COMMAND="$PROMPT_COMMAND"$'\n''(_z --add "$(command pwd '$_Z_RESOLVE_SYMLINKS' 2>/dev/null)" 2>/dev/null &);'
}
}
fi
......@@ -2,33 +2,97 @@
#autoload
# in order to make this work, you will need to have the gem zeus installed
# zeus zsh completion, based on adb completion
# zeus zsh completion
local -a _1st_arguments
_1st_arguments=(
'console:Lets you interact with your Rails application from the command line. (alias = c)'
'cucumber:Runs cucumber.'
'dbconsole:Figures out which database you are using and drops you into whichever command line interface.'
'destroy:Figures out what generate did, and undoes it. (alias = d)'
'generate:Uses templates to create a whole lot of things. (alias = g)'
'rake:Execute rake tasks.'
'runner:Runs Ruby code in the context of Rails non-interactively. (alias = r)'
'server:Launches a small web server named WEBrick which comes bundled with Ruby. (alias = s)'
'start:Preloads the zeus environment'
'test:Runs RSpec tests. (alias = rspec, testrb)'
'version:Shows the version number.'
)
if [[ -e .zeus.sock ]]; then
_1st_arguments=(
'console:Lets you interact with your Rails application from the command line. (alias = c)'
'cucumber:Runs cucumber.'
'dbconsole:Figures out which database you are using and drops you into whichever command line interface.'
'destroy:Figures out what generate did, and undoes it. (alias = d)'
'generate:Uses templates to create a whole lot of things. (alias = g)'
'rake:Execute rake tasks.'
'runner:Runs Ruby code in the context of Rails non-interactively. (alias = r)'
'server:Launches a small web server named WEBrick which comes bundled with Ruby. (alias = s)'
'test:Runs RSpec tests. (alias = rspec, testrb)'
'version:Shows the version number.'
)
else
_1st_arguments=(
'start:Preloads the zeus environment'
'init:Generate a zeus.json file'
)
fi
_rails_generate_arguments() {
generate_arguments=(
controller
generator
helper
integration_test
mailer
migration
model
observer
performance_test
plugin
resource
scaffold
scaffold_controller
session_migration
stylesheets
)
}
_rake_does_task_list_need_generating () {
if [ ! -f .rake_tasks ]; then return 0;
else
accurate=$(stat -f%m .rake_tasks)
changed=$(stat -f%m Rakefile)
return $(expr $accurate '>=' $changed)
fi
}
_zrake ()
{
local expl
declare -a tasks
if [ -f Rakefile ]; then
if _rake_does_task_list_need_generating; then
echo "\nGenerating .rake_tasks..." > /dev/stderr
rake --silent --tasks | cut -d " " -f 2 > .rake_tasks
fi
tasks=(`cat .rake_tasks`)
_wanted tasks expl 'rake' compadd $tasks
fi
}
local expl
local -a pkgs installed_pkgs
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments \
'*:: :->subcmds' && return 0
_arguments -C \
':command:->command' \
'*::options:->options'
if (( CURRENT == 1 )); then
_describe -t commands "zeus subcommand" _1st_arguments
return
fi
_files
case $state in
(command)
_describe -t commands "zeus subcommand" _1st_arguments
return
;;
(options)
case $line[1] in
(rake)
_zrake
;;
(generate|g|destroy|d)
_rails_generate_arguments
_wanted generate_arguments expl 'all generate' compadd -a generate_arguments
;;
esac
;;
esac
......@@ -27,7 +27,7 @@ GPLv3 License
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
......@@ -671,7 +671,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
......@@ -690,11 +690,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
<https://www.gnu.org/philosophy/why-not-lgpl.html>.
File mode changed from 100755 to 100644
# zsh_reload plugin
The zsh_reload plugin defines a function to reload the zsh session with
just a few keystrokes.
To use it, add `zsh_reload` to the plugins array in your zshrc file:
```zsh
plugins=(... zsh_reload)
```
## Usage
To reload the zsh session, just run `src`:
```zsh
$ vim ~/.zshrc # enabled a plugin
$ src
re-compiling /home/user/.zshrc.zwc: succeeded
re-compiling /home/user/.oh-my-zsh/cache/zcomp-host.zwc: succeeded
# you now have a fresh zsh session. happy hacking!
```
# reload zshrc
function src()
{
local cache=$ZSH_CACHE_DIR
autoload -U compinit zrecompile
compinit -d "$cache/zcomp-$HOST"
src() {
local cache="$ZSH_CACHE_DIR"
autoload -U compinit zrecompile
compinit -i -d "$cache/zcomp-$HOST"
for f in ~/.zshrc "$cache/zcomp-$HOST"; do
zrecompile -p $f && command rm -f $f.zwc.old
done
for f in ~/.zshrc "$cache/zcomp-$HOST"; do
zrecompile -p $f && command rm -f $f.zwc.old
done
source ~/.zshrc
# Use $SHELL if available; remove leading dash if login shell
[[ -n "$SHELL" ]] && exec ${SHELL#-} || exec zsh
}
......@@ -4,23 +4,23 @@
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="robbyrussell"
# Set list of themes to load
# Setting this variable when ZSH_THEME=random
# cause zsh load theme from this variable instead of
# looking in ~/.oh-my-zsh/themes/
# An empty array have no effect
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
......@@ -48,13 +48,17 @@ ZSH_THEME="robbyrussell"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
......
......@@ -6,7 +6,7 @@
# # a) displaying a pseudo-random message from a database of quotations
# # (https://en.wikipedia.org/wiki/Fortune_%28Unix%29)
# # b) displaying randomly command line tips from The command line fu
# # (http://www.commandlinefu.com) community: in order to make use of this functionality
# # (https://www.commandlinefu.com) community: in order to make use of this functionality
# # you will need Internet connection.
# # This theme provides as well information for the current user's context, like;
# # branch and status for the current version control system (git and svn currently
......@@ -23,11 +23,11 @@
# # optionally:
# # -Oh-myzsh vcs plug-ins git and svn.
# # -Solarized theme (https://github.com/altercation/solarized/)
# # -OS X: iTerm 2 (http://www.iterm2.com/)
# # -OS X: iTerm 2 (https://iterm2.com/)
# # -font Source code pro (https://github.com/adobe/source-code-pro)
# #
# # This theme's look and feel is based on the Aaron Toponce's zsh theme, more info:
# # http://pthree.org/2008/11/23/727/
# # https://pthree.org/2008/11/23/727/
# # enjoy!
########## COLOR ###########
for COLOR in CYAN WHITE YELLOW MAGENTA BLACK BLUE RED DEFAULT GREEN GREY; do
......
......@@ -13,9 +13,13 @@
#
# In addition, I recommend the
# [Solarized theme](https://github.com/altercation/solarized/) and, if you're
# using it on Mac OS X, [iTerm 2](http://www.iterm2.com/) over Terminal.app -
# using it on Mac OS X, [iTerm 2](https://iterm2.com/) over Terminal.app -
# it has significantly better color fidelity.
#
# If using with "light" variant of the Solarized color schema, set
# SOLARIZED_THEME variable to "light". If you don't specify, we'll assume
# you're using the "dark" variant.
#
# # Goals
#
# The aim of this theme is to only show you *relevant* information. Like most
......@@ -30,6 +34,11 @@
CURRENT_BG='NONE'
case ${SOLARIZED_THEME:-dark} in
light) CURRENT_FG='white';;
*) CURRENT_FG='black';;
esac
# Special Powerline characters
() {
......@@ -80,28 +89,31 @@ prompt_end() {
# Context: user@hostname (who am I and where am I)
prompt_context() {
if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
prompt_segment black default "%(!.%{%F{yellow}%}.)$USER@%m"
prompt_segment black default "%(!.%{%F{yellow}%}.)%n@%m"
fi
}
# Git: branch/detached head, dirty status
prompt_git() {
(( $+commands[git] )) || return
if [[ "$(git config --get oh-my-zsh.hide-status 2>/dev/null)" = 1 ]]; then
return
fi
local PL_BRANCH_CHAR
() {
local LC_ALL="" LC_CTYPE="en_US.UTF-8"
PL_BRANCH_CHAR=$'\ue0a0' # 
}
local ref dirty mode repo_path
repo_path=$(git rev-parse --git-dir 2>/dev/null)
if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then
repo_path=$(git rev-parse --git-dir 2>/dev/null)
dirty=$(parse_git_dirty)
ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git rev-parse --short HEAD 2> /dev/null)"
if [[ -n $dirty ]]; then
prompt_segment yellow black
else
prompt_segment green black
prompt_segment green $CURRENT_FG
fi
if [[ -e "${repo_path}/BISECT_LOG" ]]; then
......@@ -151,7 +163,7 @@ prompt_bzr() {
prompt_hg() {
(( $+commands[hg] )) || return
local rev status
local rev st branch
if $(hg id >/dev/null 2>&1); then
if $(hg prompt >/dev/null 2>&1); then
if [[ $(hg prompt "{status|unknown}") = "?" ]]; then
......@@ -164,7 +176,7 @@ prompt_hg() {
st='±'
else
# if working copy is clean
prompt_segment green black
prompt_segment green $CURRENT_FG
fi
echo -n $(hg prompt "☿ {rev}@{branch}") $st
else
......@@ -178,7 +190,7 @@ prompt_hg() {
prompt_segment yellow black
st='±'
else
prompt_segment green black
prompt_segment green $CURRENT_FG
fi
echo -n "☿ $rev@$branch" $st
fi
......@@ -187,7 +199,7 @@ prompt_hg() {
# Dir: current working directory
prompt_dir() {
prompt_segment blue black '%~'
prompt_segment blue $CURRENT_FG '%~'
}
# Virtualenv: current working virtualenv
......@@ -203,8 +215,8 @@ prompt_virtualenv() {
# - am I root
# - are there background jobs?
prompt_status() {
local symbols
symbols=()
local -a symbols
[[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}✘"
[[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡"
[[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}⚙"
......
......@@ -9,7 +9,7 @@ rbenv_version() {
}
PROMPT='
%{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info) ⌚ %{$fg_bold[red]%}%*%{$reset_color%}
%{$fg_bold[green]%}%~%{$reset_color%}$(git_prompt_info) ⌚ %{$fg_bold[red]%}%*%{$reset_color%}
$ '
# Must use Powerline font, for \uE0A0 to render.
......
......@@ -8,7 +8,7 @@ ZSH_THEME_GIT_PROMPT_SUFFIX=""
ZSH_THEME_GIT_PROMPT_DIRTY="*"
ZSH_THEME_GIT_PROMPT_CLEAN=""
# See http://geoff.greer.fm/lscolors/
# See https://geoff.greer.fm/lscolors/
export LSCOLORS="exfxcxdxbxbxbxbxbxbxbx"
export LS_COLORS="di=34;40:ln=35;40:so=32;40:pi=33;40:ex=31;40:bd=31;40:cd=31;40:su=31;40:sg=31;40:tw=31;40:ow=31;40:"
......@@ -50,9 +50,7 @@ function _ruby_version() {
# use a neutral color, otherwise colors will vary according to time.
function _git_time_since_commit() {
# Only proceed if there is actually a commit.
if git log -1 > /dev/null 2>&1; then
# Get the last commit.
last_commit=$(git log --pretty=format:'%at' -1 2> /dev/null)
if last_commit=$(git log --pretty=format:'%at' -1 2> /dev/null); then
now=$(date +%s)
seconds_since_last_commit=$((now-last_commit))
......@@ -65,7 +63,7 @@ function _git_time_since_commit() {
sub_hours=$((hours % 24))
sub_minutes=$((minutes % 60))
if [ $hours -gt 24 ]; then
if [ $hours -ge 24 ]; then
commit_age="${days}d"
elif [ $minutes -gt 60 ]; then
commit_age="${sub_hours}h${sub_minutes}m"
......@@ -104,7 +102,7 @@ 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[white]%}"
# LS colors, made with http://geoff.greer.fm/lscolors/
# LS colors, made with https://geoff.greer.fm/lscolors/
export LSCOLORS="exfxcxdxbxegedabagacad"
export LS_COLORS='di=34;40:ln=35;40:so=32;40:pi=33;40:ex=31;40:bd=34;46:cd=34;43:su=0;41:sg=0;46:tw=0;42:ow=0;43:'
export GREP_COLOR='1;33'
# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png
# ZSH Theme - Preview: https://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
......
......@@ -17,7 +17,7 @@ function box_name {
}
PROMPT='
%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}$(box_name)%{$reset_color%}:%{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(hg_prompt_info)$(git_prompt_info)
%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[yellow]%}$(box_name)%{$reset_color%}:%{$fg_bold[green]%}%~%{$reset_color%}$(hg_prompt_info)$(git_prompt_info)
%(?,,%{${fg_bold[white]}%}[%?]%{$reset_color%} )$ '
ZSH_THEME_GIT_PROMPT_PREFIX=" (%{$fg[magenta]%}branch: "
......
......@@ -9,6 +9,6 @@ ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[blue]%})%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_CLEAN=""
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}✗"
# LS colors, made with http://geoff.greer.fm/lscolors/
# LS colors, made with https://geoff.greer.fm/lscolors/
export LSCOLORS="Gxfxcxdxbxegedabagacad"
export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:'
......@@ -6,5 +6,5 @@ PROMPT='%{$fg_bold[cyan]%}$ZSH_THEME_CLOUD_PREFIX %{$fg_bold[green]%}%p %{$fg[gr
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$fg[cyan]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}] %{$fg[yellow]%}⚡%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}]"
\ No newline at end of file
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}] %{$fg[yellow]%}⚡ %{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}]"
......@@ -9,7 +9,7 @@ function virtualenv_info {
}
PROMPT='
%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info)
%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}%~%{$reset_color%}$(git_prompt_info)
$(virtualenv_info)$(prompt_char) '
ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}"
......
# user, host, full path, and time/date
# on two lines for easier vgrepping
# entry in a nice long thread on the Arch Linux forums: http://bbs.archlinux.org/viewtopic.php?pid=521888#p521888
# entry in a nice long thread on the Arch Linux forums: https://bbs.archlinux.org/viewtopic.php?pid=521888#p521888
PROMPT=$'%{\e[0;34m%}%B┌─[%b%{\e[0m%}%{\e[1;32m%}%n%{\e[1;34m%}@%{\e[0m%}%{\e[0;36m%}%m%{\e[0;34m%}%B]%b%{\e[0m%} - %b%{\e[0;34m%}%B[%b%{\e[1;37m%}%~%{\e[0;34m%}%B]%b%{\e[0m%} - %{\e[0;34m%}%B[%b%{\e[0;33m%}%!%{\e[0;34m%}%B]%b%{\e[0m%}
%{\e[0;34m%}%B└─%B[%{\e[1;35m%}$%{\e[0;34m%}%B]%{\e[0m%}%b '
RPROMPT='[%*]'
......
......@@ -68,6 +68,10 @@ prompt_glyph="%{%(#.${root_prompt}.${user_prompt}) %2G%}"
setopt promptsubst
# Workaround for zsh 5.2 release (kudos to @timothybasanov)
autoload +X VCS_INFO_nvcsformats
functions[VCS_INFO_nvcsformats]=${functions[VCS_INFO_nvcsformats]/local -a msgs/}
autoload -U add-zsh-hook
autoload -Uz vcs_info
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment