Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 93 lines (66 sloc) 2.294 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
# By default, all created elements are rwx______
#umask 077
autoload -Uz vcs_info

autoload -Uz zfinit
zfinit

autoload -U zmv

# Allow for functions in the prompt.
setopt PROMPT_SUBST

local mydir=`dirname $0`
source $mydir/path

# Tmux stuff
# force 256 color mode
#alias tmux='tmux -2'
#alias screen='TERM=xterm-color && /opt/local/bin/screen'
#alias todo='gvim ~/vimwiki/ToDo.wiki'


# https://github.com/sjl/z-zsh
#source $HOME/.zshkit/z-zsh/z.sh
#function precmd () {
# z --add "$(pwd -P)"
#}



# Change hostname color on known hosts
# I put this here, because host doesn't change during a session
case ${HOST%%.*} in
    my-Desktop) local host_color="${fg[yellow]}" ;;
    my-Laptop) local host_color="${fg[yellow]}" ;;
    ensi-vpn-*) local host_color="${fg_bold[yellow]}" ;;
    *) local host_color="${fg_bold[red]}" ;;
esac

# Color for decorations
local deco="%{${fg_bold[black]}%}"

# Change path color gieven user rights on it
if [[ -O "${PWD}" ]]; then # owner
    local path_color="${fg_no_bold[default]}"
elif [[ -w "${PWD}" ]]; then # can write
    local path_color="${fg_no_bold[blue]}"
else # other
    local path_color="${fg_no_bold[red]}"
fi

# No coloration
#local nc="%{$reset_color%}"


# zgitinit and prompt_wunjo_setup must be somewhere in your $fpath, see README for more.

#setopt promptsubst

## Load the prompt theme system
#autoload -U promptinit
#promptinit

## Use the git-zsh prompt theme
#prompt zsh-git



function precmd
{
# vcs_info;
# PS1="%{${fg[magenta]}%}%n ${nc}at %{${host_color}%}%m${nc} in %{$fg[green]%}%~${nc} ${vcs_info_msg_0_} "
vcs_info;


  # Display return code when not 0
  local return_code="%(?..${deco}!%{${fg_no_bold[red]}%}%?${deco}! )"
  # user@host
  local user_at_host="%{${fg_bold[default]}%}%n${deco}@%{${host_color}%}%m"
  # Red # for root, plain % for user
  local sign="%(!.%{${fg_bold[red]}%}.${deco})%#"

  # Set the prompt
  #PS1="${return_code}${deco}[${user_at_host} ${cwd}${deco}] ${sign}%{${reset_color}%} "
#PS1="%# '${vcs_info_msg_0_}'"
  #PS1="%T%B[%~]%b${return_code}${deco}[${user_at_host} ${deco}] ${sign}%{${reset_color}%} "
  #PS1="%T%B[%~]%b${return_code}${deco}[${user_at_host} ${deco}] `git-prompt` ${sign}%{${reset_color}%} "

#%B[%n:%l]%b %(0?##%S{%?}%s )%S%m%s%# "

  PS1="%m ⚡ %$"

}
Something went wrong with that request. Please try again.