Skip to content

Instantly share code, notes, and snippets.

@guneemwelloeux
Created January 24, 2018 10:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guneemwelloeux/34ee3943ac32847895dc4c57f74c5ff7 to your computer and use it in GitHub Desktop.
Save guneemwelloeux/34ee3943ac32847895dc4c57f74c5ff7 to your computer and use it in GitHub Desktop.
ZSH login traces
# set global options for all zsh shells here
export REPENV=/remote/tools/profiles_repository/zsh
# DO NOT EDIT THIS FILE !!!
# All your personal configuration should be done in .zshenv.<loginname>
# If for any reason you wish to bypass the standard process, you can create a
# .zshenv.override to set a custom environment, but DSP will not provide support
# in such a case.
if [ -e $HOME/.zshenv.override ]
then
file="$HOME/.zshenv.override"
else
file="$REPENV/buildenv"
fi
if [ -f $file ]
then
if tty -s
then
. $file
else
. $file > /dev/null
fi
fi
###############################
# -----------------------------
# This script is launched at user logon process so as to set up common development environment.
# Settings can be drawn up according to the following criteria :
#
# - settings shared by all Operating Systems or relating to a specific operating system (systems folder)
# - settings relating to a specific hostname
# - settings relating to common soft users
# - settings relating to a specific installed softs
# - settings relating to common (nas)tool users
# - settings relating to a specific installed (nas)tools
# - settings relating to common company users
# - settings relating to a specific group of users
# - settings relating to a specific group of projects
# - settings relating to a specific user
#
# Common server OS Settings
# -------------------------
if [ -f $REPENV/systems/zshenv.allsystems ]
then
. $REPENV/systems/zshenv.allsystems
fi
# Latest modification : 17/12/2k8 (DCC)
# Environment variables
# Update variables PATH, MANPATH and LD_LIBRARY_PATH
# ---------------------------------------------------
[[ -d /usr/local/bin ]] && export PATH=/usr/local/bin:$PATH
[[ -d /usr/share/man ]] && export MANPATH=$MANPATH:/usr/share/man
[[ -d /usr/local/man ]] && export MANPATH=$MANPATH:/usr/local/man
[[ -d /usr/local/lib ]] && export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
# ????? useless, these are system GLOBAL variables
# ------------------------------------------------
export USERNAME
export LOGNAME
export HOST
# Commented on : /etc/db_user_machine is not necessarilly up-to-date
# 17/12/2k8 and must be maintained on all boxes - DCC
# --------------------------------------------------------
#if [ "$DISPLAY" = "" ]
#then
# export DISPLAY=$(grep $USERNAME /etc/db_user_machine | awk '{print $2}'):0.0
#fi
TEST=`echo $DISPLAY | cut -f 1 -d:`
if [ "$TEST" != "localhost" ] # JFR March 2010 - For poeple who used X11 Forwarding with ssh tunneling
then
# New set of user DISPLAY - DCC 17/12/2k8
# The flaw is that STDIN taken is the hostname your are login from
# not necessarilly your WorkStation (bouncing from another dev server)
# --------------------------------------------------------------------
FROMBOX=`who -mu | sed 's/[()]//g' | awk '{print $8}'` # Associated user (STDIN)
DISPLAY=`echo $FROMBOX | cut -d. -f 1` # FROMBOX is shortened after the first . encountered
ALPHNUM=`echo $DISPLAY | sed -e 's/[^[:alpha:]]//g'` # If DISPLAY is an IP address, a null value is stored in ALPHNUM
# DISPLAY var is set according to the value of ALPHNUM
# ----------------------------------------------------
if [ "$ALPHNUM" ]
then
export DISPLAY=$DISPLAY:0.0 # STDIN is a name
else
export DISPLAY=$FROMBOX:0.0 # STDIN is an IP address
fi
fi
# Some global variables setting
# -----------------------------
if [ "$TERM" = "" ]
then
export TERM=xterm
fi
# PROMPT setting
# --------------
export PS1="%n@%m:%~) "
export RPS1="%t"
# Miscellaneous
# -------------
export DIRSTACKSIZE=50 # Keep the directory stack from getting too large
export HISTSIZE=500 # Keep the history stack from getting too large
export HISTFILE=$HOME/.histfile
export SAVEHIST=$HISTSIZE
# Built a user directory in /gctmp if not existing
# USERNAME replaced by LOGNAME - DCC 17/12/2k8
# $LOGNAME should be more secure in use due to long/short login name uncertain working
# ------------------------------------------------------------------------------------
if [ -d /gctmp ]
then
if [ ! -d /gctmp/$LOGNAME ]
then
mkdir /gctmp/$LOGNAME
chmod 755 /gctmp/$LOGNAME
fi
export TMPDIR=/gctmp/$LOGNAME
fi
# Default user editor
# -------------------
export FCEDIT=vi
export EDITOR=vi
# Europe/Paris setting
# --------------------
if [ -r /etc/TIMEZONE ]
then
. /etc/TIMEZONE
else
TZ=MET
export TZ
fi
# Divers
#
umask 022
# Specific server OS Settings
# SLES10.... : Linux.2.6.16.46-0
# SLES9..... : Linux.2.6.5-7
# Solaris 10 : SunOs.5.10
# Solaris 8 : SunOs.5.8
# HP-UX..... : HP-UX.B.11.11
# --------------------------
fullSysName=`uname -r`;
stripSysName=${fullSysName%.[0-9]*-smp} # Keep 2.6.5-7 instead of 2.6.5-7.244-smp
if [ -f $REPENV/systems/zshenv.$(uname -s).$stripSysName ]
then
. $REPENV/systems/zshenv.$(uname -s).$stripSysName
fi
#JFR Source zshenv.Linux or zshenv.SunOS files
# --------------------------
stripSysName=`uname`;
if [ -f $REPENV/systems/zshenv.$stripSysName ]
then
. $REPENV/systems/zshenv.$stripSysName
fi
export TERMINFO=/usr/share/terminfo
# Specific HOST settings
# ----------------------
###################################
##NOT USED 26/02/2010
##INC990430
#
##Start JFR alias gmake make and scons for all gcolnx servers
#
#gcoserver=`echo $HOST | egrep 'ncegcolnx|ncegcocsd|ncegcochecks|ncegcoreg01'`
#
#if [ $gcoserver ]
#then
# . $REPENV/hosts/zshenv.gclinux
#fi
##End JFR alias gmake make and scons for all gco servers
#
##Start PDO alias gmake make and scons for all tsplnx servers
#
#tspserver=`echo $HOST | grep ncetsplnx`
#
#if [ $tspserver ]
#then
# . $REPENV/hosts/zshenv.tsplinux
#fi
##End PDO alias gmake make and scons for all tsp servers
###################################
if [ -f $REPENV/hosts/zshenv.$HOST ]
then
. $REPENV/hosts/zshenv.$HOST
fi
# Specific installed SOFTS settings (in local /softntools/softs linux folder)
# ---------------------------------------------------------------------------
for i in `/bin/ls -d /softs/*(N)|sed 's/.*\/\([^\/]*\)$/\1/'`
do
if [ -f $REPENV/softs/zshenv.$i ]
then
. $REPENV/softs/zshenv.$i
fi
done
#
# Variables d'environnement
#
ORACLE_BASE=/softs/oracle
export ORACLE_BASE
#ORACLE_HOME=/softs/oracle/9.2.0.4
#export ORACLE_HOME
#PATH=$ORACLE_HOME/bin:$PATH
#export PATH
#LD_LIBRARY_PATH=$ORACLE_HOME/lib
#export LD_LIBRARY_PATH
#TNS_ADMIN=${ORACLE_HOME}/network/admin
#export TNS_ADMIN
# Specific installed TOOLS settings (in local /softntools/tools linux folder)
# ---------------------------------------------------------------------------
for i in `/bin/ls -d /tools/*(N)|sed 's/.*\/\([^\/]*\)$/\1/'`
do
if [ -f $REPENV/tools/zshenv.$i ]
then
. $REPENV/tools/zshenv.$i
fi
done
#
# Variables d'environnement
#
# Add to the PATH
export PATH=${PATH}:/tools/fileutils/bin
export MANPATH=${MANPATH}:/tools/fileutils/man
#
# Divers
#
# Specific optional tools settings (in local /softntools/opt folder) JFR 091116
# ---------------------------------------------------------------------
for i in `/bin/ls -d /opt/*(N) /opt/devsup/*(N) |sed 's/.*\/\([^\/]*\)$/\1/'`
do
if [ -f $REPENV/opt/zshenv.$i ]
then
. $REPENV/opt/zshenv.$i
fi
done
#
# Variables d'environnement
#
if [ -d /opt/devsup/bms/latest ];then
export PATH=/opt/devsup/bms/latest:$PATH
elif [ -d /remote/tools/Linux/GCO-TSP/OPT-TOOLS/localdevsuptool.noarch/devsup/bms/latest ];then
export PATH=/remote/tools/Linux/GCO-TSP/OPT-TOOLS/localdevsuptool.noarch/devsup/bms/latest:$PATH
fi
#
# Variables d'environnement
#
if [ -d /opt/devsup/cmk/latest ];then
export PATH=/opt/devsup/cmk/latest:/opt/devsup/dsm/latest:$PATH
elif [ -d /remote/tools/Linux/GCO-TSP/OPT-TOOLS/localdevsuptool.noarch/devsup/cmk/latest ];then
export PATH=/remote/tools/Linux/GCO-TSP/OPT-TOOLS/localdevsuptool.noarch/devsup/cmk/latest:/remote/tools/Linux/GCO-TSP/OPT-TOOLS/localdevsuptool.noarch/devsup/dsm/latest:$PATH
else
echo "dsp tools are not available on this machine"
fi
#
# Variables d'environnement
#
export PATH=/opt/devsup/ctm:$PATH
#
# Divers
#
#
# Variables d'environnement
#
if [ -f "/opt/python-2.6-64/bin/python" ]; then
export MERCURIAL_VERSION=2.2.3
else
export MERCURIAL_VERSION=1.6.4
fi
export MERCURIAL_BASE=/opt/devsup/mercurial
export MERCURIAL_PYTHONPATH=${MERCURIAL_BASE}/mercurial-${MERCURIAL_VERSION}/lib/python2.6/site-packages
export PATH=${MERCURIAL_BASE}/bin:${PATH}
if [ -z $PYTHONPATH ] ; then
export PYTHONPATH=${MERCURIAL_PYTHONPATH}
else
export PYTHONPATH=${PYTHONPATH}:${MERCURIAL_PYTHONPATH}
fi
#
# Divers
#
#
# Variables d'environnement
#
if [ -z $PLATINUM_CLIENT_HOME ] ; then
if [ -d /opt/devsup/platinum ] ; then
export PLATINUM_CLIENT_HOME=/opt/devsup/platinum
elif [ -d /remote/devsup/latest/platinum/commandline ] ; then
export PLATINUM_CLIENT_HOME=/remote/devsup/latest/platinum/commandline
else
echo "Sorry, cannot find any valid location to set PLATINUM_CLIENT_HOME !"
exit 1
fi
fi
if [[ "$PYTHONPATH" != *"$PLATINUM_CLIENT_HOME"* ]]; then
export PYTHONPATH=$PYTHONPATH:$PLATINUM_CLIENT_HOME:$PLATINUM_CLIENT_HOME/tools
fi
#
# Divers
#
#
# Variables d'environnement
#
if [ -z $POLONIUM_HOME ] ; then
if [ -d /opt/devsup/polonium ] ; then
export POLONIUM_HOME=/opt/devsup/polonium
elif [ -d /remote/devsup/latest/polonium ] ; then
export POLONIUM_HOME=/remote/devsup/latest/polonium
else
echo "Sorry, cannot find any valid location to set POLONIUM_HOME !"
exit 1
fi
fi
#
# Variables d'environnement
#
export PATH=/opt/gcc/bin:$PATH
export MANPATH=/opt/gcc/man:$MANPATH
#
# Divers
#
#
# Variables d'environnement
#
export PATH=/opt/python-2.6-64/bin:$PATH
export MANPATH=/opt/python-2.6-64/man:$MANPATH
export PYTHONHOME=/opt/python-2.6-64
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/python-2.6-64/lib
#
# Divers
#
# Specific NASTOOLS settings (in global /remote/tools/Linux/2.6 folder)
# ---------------------------------------------------------------------
for i in `/bin/ls -d /nastools/*(N)|sed 's/.*\/\([^\/]*\)$/\1/'`
do
if [ -f $REPENV/nastools/zshenv.$i ]
then
. $REPENV/nastools/zshenv.$i
fi
done
#
# Variables d'environnement
#
export PATH=$PATH:/nastools/ccache/bin
#
# Divers
#
#
# Variables d'environnement
#
export PATH=$PATH:/nastools/clewn/bin
#
# Divers
#
#
# Variables d'environnement
#
export PATH=$PATH:/nastools/cscope/bin
#
# Divers
#
#
# Variables d'environnement
#
export PATH=$PATH:/nastools/ctags/bin
#
# Divers
#
#
# Variables d'environnement
#
CURL_PATH='/nastools/curl'
if [ -e $CURL_PATH ]; then
export LD_LIBRARY_PATH=$CURL_PATH/lib:$LD_LIBRARY_PATH
export PATH=$CURL_PATH/bin:$PATH
fi;
#
# Divers
#
#
# Variables d'environnement
#
export PATH=$PATH:/nastools/ddd/bin
#
# Divers
#
#
# Variables d'environnement
#
export PATH=$PATH:/nastools/doxygen/bin
#
# Divers
#
#
# Variables d'environnement
#
export PATH=$PATH:/nastools/fuse/bin
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/nastools/fuse/lib
export LD_RUN_PATH=$LD_RUN_PATH:/nastools/fuse/lib
#
# Divers
#
#
# Variables d'environnement
#
export PATH=/nastools/gdb/bin:${PATH}
#
# Divers
#
#
# Variables d'environnement
#
#GITPATHVER='/nastools/git-1.8.4.3/bin'
GITPATH='/nastools/git'
GITMANPATH="$GITPATH/share/man"
GITBINPATH="$GITPATH/bin"
#if [ -e ${GITPATHVER} ]; then
# export PATH=$PATH:${GITPATHVER}
#fi;
if [ -e $GITPATH ]; then
export PATH=$PATH:$GITBINPATH
export MANPATH=$MANPATH:$GITMANPATH
fi;
#
# Divers
#
#
# Variables d'environnement
#
export PATH=$PATH:/nastools/gqlplus/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/nastools/gqlplus/lib
#
# Divers
#
#
# Variables d'environnement
#
# Add to the PATH only if it exists on the machine
export PATH=$PATH:/nastools/graphviz/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/nastools/graphviz/lib/graphviz
#
# Divers
#
#
# Variables d'environnement
#
export PATH=/nastools/java/bin:$PATH
#
# Divers
#
if [ -f /etc/SuSE-release ]; then
SUSE_VERSION=`grep VERSION /etc/SuSE-release | gawk '{print $3}'`
if [ $SUSE_VERSION = "9" ]; then
NASTOOL_PATH="/nastools"
elif [ $SUSE_VERSION = "10" ]; then
NASTOOL_PATH="/nastools/sles10"
elif [ $SUSE_VERSION = "11" ]; then
NASTOOL_PATH="/nastools/sles11"
fi
export PATH=$PATH:$NASTOOL_PATH/kcachegrind/bin
export KDEDIR=$NASTOOL_PATH/kcachegrind
fi
export PATH=$PATH:/nastools/lcov/bin
#
# Variables d'environnement
#
export MANPATH=/nastools/man:$MANPATH
#
# Divers
#
#
# Variables d'environnement
#
export PATH=$PATH:/nastools/ncftp/bin
#
# Divers
#
#
# Variables d'environnement
#
export PATH=$PATH:/nastools/nfswatch/bin
#
# Divers
#
#
# Variables d'environnement
#
OPENSSL_PATH='/nastools/openssl'
if [ -e $OPENSSL_PATH ]; then
export LD_LIBRARY_PATH=$OPENSSL_PATH/lib:$LD_LIBRARY_PATH
export PATH=$OPENSSL_PATH/bin:$PATH
fi;
#
# Divers
#
if [ -f /etc/SuSE-release ]; then
SUSE_VERSION=`grep VERSION /etc/SuSE-release | gawk '{print $3}'`
if [ "$SUSE_VERSION" = "9" ]; then
NASTOOL_PATH="/nastools"
elif [ "$SUSE_VERSION" = "10" ]; then
NASTOOL_PATH="/nastools/sles10"
elif [ "$SUSE_VERSION" = "11" ]; then
NASTOOL_PATH="/nastools/sles11"
fi
export PATH=$PATH:$NASTOOL_PATH/valgrind/bin
export MANPATH=$MANPATH:$NASTOOL_PATH/valgrind/man
export LD_RUN_PATH=$LD_RUN_PATH:$NASTOOL_PATH/valgrind/lib
fi
#
# Variables d'environnement
#
export PATH=$PATH:/nastools/valgui/bin
#
# Divers
#
export PATH=$PATH:/nastools/valkyrie/bin
#
# Variables d'environnement
#
export PATH=$PATH:/nastools/vim/bin
#
# Divers
#
# Specific USER GROUPS settings (according to user primary group membership)
# --------------------------------------------------------------------------
for i in $(groups $USERNAME)
do
if [ -f $REPENV/teams/zshenv.$i ]
then
. $REPENV/teams/zshenv.$i
fi
done
# Specific PROJECT GROUPS settings (according to user secondary group membership)
# -------------------------------------------------------------------------------
for i in $(groups $USERNAME)
do
if [ -f $REPENV/projects/zshenv.$i ]
then
. $REPENV/projects/zshenv.$i
fi
done
#==============================
# SBR Server .zshenv
#------------------------------
### Path (Asked by VAS)
export PATH=$PATH:/remote/projteams/projects/dbl_pnr_/bin
### Oracle
. /nastools/oracle/util/init_env res > /dev/null
cd /nastools/oracle/util
. ./setenv $*
#!/bin/sh
#
# Set environment variables for the database specified in parameter
#
###############################################
#
if [[ "X$1" = "X" ]]
then
echo "ERROR: this script takes one parameter: the database name or Oracle release"
return 1
fi
FORCE_MODE=0
APPEND_MODE=0
if [[ "X$2" != "X" && "$2" != "-f" && "$2" != "-a" ]]
then
echo "ERROR: second paramater of this script, if used, can be '-f' or '-a' only"
return 1
elif [[ "$2" = "-f" ]]
then
FORCE_MODE=1
elif [[ "$2" = "-a" ]]
then
APPEND_MODE=1
fi
if [[ "X$3" != "X" && "$3" != "-f" && "$3" != "-a" ]]
then
echo "ERROR: third paramater of this script, if used, can be '-f' or '-a' only"
return 1
elif [[ "$3" = "-f" ]]
then
FORCE_MODE=1
elif [[ "$3" = "-a" ]]
then
APPEND_MODE=1
fi
## unalias ls >/dev/null 2>&1
json=1
# Check if the first paramter was actually JSON format
if [[ $1 == \{* ]]
then
json=0
oracle_release=`echo $1 | grep -Po 'oracle-release=\K[^,}]*'`
server=`echo $1 | grep -Po 'server=\K[^,}]*'`
ORACLE_SID=`echo $1 | grep -Po 'oracle-sid=\K[^,}]*'`
DB_NAME=`echo $1 | grep -Po 'name=\K[^,}]*'`
ORACLE_ROOT_OVERRIDE=`echo $1 | grep -Po 'oracle-root-override=\K[^,}]*'`
TNS_ADMIN_OVERRIDE=`echo $1 | grep -Po 'tns-admin-override=\K[^,}]*'`
if [ -z "$ORACLE_SID" ]
then
ORACLE_SID=$DB_NAME
fi
else
DB_NAME=$(echo $1 | awk '{print toupper($0)}')
fi
if [ -z "$TNS_ADMIN" ]
then
TNS_ADMIN=/nastools/oracle/etc
fi
DB_COMMENT=$(echo $2 | awk '{print toupper($0)}')
DEFAULT_ORACLE_ROOT=/nastools/oracle/products
ORACLE_ROOT=${DEFAULT_ORACLE_ROOT}
# Check if the first parameter was actually an Oracle Release
for release in 9.2.0.7 9.2.0.8 10.2.0.2 10.2.0.3 10.2.0.4 11.1.0.6.0 11.1.0.7 11.2.0.1 11.2.0.2 11.2.0.3 11.2.0.4 11.2.0.4.4 12.1.0.2 12.2.0.1
do
if [ ${DB_NAME} = ${release} ]
then
if [ -d ${ORACLE_ROOT}/${release} ]
then
ORACLE_HOME=${ORACLE_ROOT}/${release}
if [ -d ${ORACLE_ROOT}/${release}cl ]; then
ORACLE_HOME=${ORACLE_ROOT}/${release}cl
fi
echo "Exporting DISABLE_HUGETLBFS=1 ..."
export DISABLE_HUGETLBFS=1
echo "Exporting ORACLE_HOME=${ORACLE_HOME} ..."
export ORACLE_HOME=${ORACLE_HOME}
if [[ ${APPEND_MODE} = 1 ]]
then
echo "Exporting PATH=\${PATH}:${ORACLE_HOME}/bin"
export PATH=${PATH}:${ORACLE_HOME}/bin
else
echo "Exporting PATH=${ORACLE_HOME}/bin:\${PATH} ..."
export PATH=${ORACLE_HOME}/bin:${PATH}
fi
if [[ ${APPEND_MODE} = 1 ]]
then
echo "Exporting LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:${ORACLE_HOME}/lib"
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${ORACLE_HOME}/lib
else
echo "Exporting LD_LIBRARY_PATH=${ORACLE_HOME}/lib:\${LD_LIBRARY_PATH} ..."
export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:${LD_LIBRARY_PATH}
fi
echo "Exporting TNS_ADMIN=${TNS_ADMIN} ..."
export TNS_ADMIN=${TNS_ADMIN}
return 0
else
echo "ERROR: directory ${ORACLE_ROOT}/${release} does not exist !"
return 1
fi
fi
done
# Check if the first parameter was actually mysql
if [ ${DB_NAME} = "MYSQL" ]
then
echo "Exporting PATH=/projects/dsdeldev/SQL_MySQL/5-1-22/Linux2-6_64/bin:\$PATH ..."
export PATH=/projects/dsdeldev/SQL_MySQL/5-1-22/Linux2-6_64/bin:$PATH
echo "Please set CONNECT_STRING to something like \"-u root -pgcguest -h ncegcolnx44\""
alias sql='eval mysql $CONNECT_STRING'
echo "Then you can use \"sql\" alias to connect: sql='eval mysql \$CONNECT_STRING' !!!"
return 0
fi
ORA_BASE=/nastools/oracle
TOPOLOGY_FILE=${ORA_BASE}/etc/db_topology.xml
unset PYTHONHOME
OS=$(uname -s)
PYTHONBIN=${ORA_BASE}/python/${OS}/bin/python
# If no JSON, get database informations from db_topology.xml
if [[ $json -ne 0 ]]
then
db_info=$(export PYTHONPATH=${ORA_BASE}/lib/python; export LD_LIBRARY_PATH=${ORA_BASE}/lib/python:/nastools/python-2.4-64/lib:${LD_LIBRARY_PATH}; ${PYTHONBIN} ${ORA_BASE}/util/readDbTopologyXml.py -f ${TOPOLOGY_FILE} -d ${DB_NAME})
if [[ $? -ne 0 ]]
then
return 1
fi
oracle_release=$(echo $db_info | cut -d '|' -f1)
server=$(echo $db_info | cut -d '|' -f3)
ORACLE_SID=$(echo $db_info | cut -d '|' -f5)
ORACLE_ROOT_OVERRIDE=$(echo $db_info | cut -d '|' -f9)
TNS_ADMIN_OVERRIDE=$(echo $db_info | cut -d '|' -f13)
DB_NAME=$(echo $db_info | cut -d '|' -f15)
fi
if [[ $(hostname) = ${server} ]]; then
ORACLE_ROOT=/softs/oracle
fi
if [ -n "${ORACLE_ROOT_OVERRIDE}" ]
then
ORACLE_ROOT=${ORACLE_ROOT_OVERRIDE}
fi
if [ -n "${TNS_ADMIN_OVERRIDE}" ]
then
TNS_ADMIN=${TNS_ADMIN_OVERRIDE}
fi
ORACLE_HOME=${ORACLE_ROOT}/${oracle_release}
if [[ ! -d ${ORACLE_HOME} ]]
then
echo "INFO : Oracle release is ${oracle_release} but directory ${ORACLE_ROOT}/${oracle_release} does not exist"
if [[ $(hostname) = ${server} ]]
then
echo "ERROR: we are on the same server as the database => the only possible value for ORACLE_HOME was ${ORACLE_ROOT}/${oracle_release} !"
return 1
else
# we first see if this version is on default oracle root
ORACLE_HOME=${DEFAULT_ORACLE_ROOT}/${oracle_release}
if [[ -d ${ORACLE_HOME} ]]
then
echo "INFO : Oracle release ${oracle_release} found in default oracle root"
else
# We get the major number of the Oracle release
oracle_release_major_number=$(echo ${oracle_release} | cut -d '.' -f1)
# Then we take same biggest existing Oracle release with same major number
# for instance if major number is 9, and we have the choice between 9.2.0.7 and 9.2.0.8
# we take 9.2.0.8.
ORACLE_HOME=$(\ls -dr ${DEFAULT_ORACLE_ROOT}/${oracle_release_major_number}.* | head -1)
fi
fi
fi
if [[ ! -d "${ORACLE_HOME}" ]]
then
echo "ERROR: environment variable ORACLE_HOME could not be set !"
return 1
fi
echo "Exporting DISABLE_HUGETLBFS=1 ..."
export DISABLE_HUGETLBFS=1
echo "Exporting ORACLE_SID=${ORACLE_SID} ..."
export ORACLE_SID=${ORACLE_SID}
echo "Exporting ORACLE_HOME=${ORACLE_HOME} ..."
export ORACLE_HOME=${ORACLE_HOME}
if [[ ${APPEND_MODE} = 1 ]]
then
echo "Exporting PATH=\${PATH}:${ORACLE_HOME}/bin"
export PATH=${PATH}:${ORACLE_HOME}/bin
else
echo "Exporting PATH=${ORACLE_HOME}/bin:\${PATH} ..."
export PATH=${ORACLE_HOME}/bin:${PATH}
fi
if [[ ${APPEND_MODE} = 1 ]]
then
echo "Exporting LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:${ORACLE_HOME}/lib"
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${ORACLE_HOME}/lib
else
echo "Exporting LD_LIBRARY_PATH=${ORACLE_HOME}/lib:\${LD_LIBRARY_PATH} ..."
export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:${LD_LIBRARY_PATH}
fi
echo "Exporting TNS_ADMIN=${TNS_ADMIN} ..."
export TNS_ADMIN=${TNS_ADMIN}
if [[ $(hostname) != ${server} || "${FORCE_MODE}" = "1" ]]
then
echo "The server is running on ${server}"
echo "Exporting TWO_TASK=${DB_NAME}ls ..."
export TWO_TASK=${DB_NAME}ls
else
echo "Unsetting TWO_TASK ..."
unset TWO_TASK
echo "Creating alias sys=\"sqlplus '/as sysdba'\" and gsys=\"gqlplus -d '/as sysdba'\" ..."
alias sys="sqlplus '/as sysdba'"
alias gsys="gqlplus -d '/as sysdba'"
echo "To connect as sysdba to ${DB_NAME} just type 'sys' !!!"
fi
return 0
cd - >/dev/null
export TNS_ADMIN=/nastools/oracle/etc
export ORACLE_VERSION=10.2.0.3
export ORACLE_HOME=/softs/oracle/$ORACLE_VERSION
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/nastools/oracle/products/$ORACLE_VERSION/lib:$LD_LIBRARY_PATH
export LANG=en_US.UTF-8
export NLS_LANG=AMERICAN_AMERICA.UTF8
### Use vim as default editor
export EDITOR='vim'
# Specific USER home environment settings
# ---------------------------------------
#if [ -f ~/.zshenv.$LOGNAME ]
#then
# . ~/.zshenv.$LOGNAME
#fi
if [ -f ~/.zshenv.user ]
then
. ~/.zshenv.user
fi
#EOF
#
unset file
# read bash.bashrc first for some features we dont want
# to re-implement here
#source /etc/bash.bashrc
# zsh line editing
: ${ZSHEDIT:="emacs"}
: ${TERM:=linux}
if [[ "$ZSHEDIT" == "vi" ]] then
bindkey -v
else
bindkey -e
bindkey "^[ " magic-space
bindkey "^[!" expand-history
fi
# Environment
HISTSIZE=1000
HISTFILE=${HOME}/.zsh_history
SAVEHIST=500
# Prompt on the right side. zsh feature
#RPROMPT="[%T]"
# Set/unset shell options
setopt globdots nocorrect pushdtohome autolist nopromptcr
setopt nocorrectall autocd recexact longlistjobs
setopt histignoredups pushdsilent appendhistory histexpiredupsfirst
setopt autopushd pushdminus extendedglob rcquotes
unsetopt bgnice autoparamslash hup
# Setup some basic programmable completions. To see more examples
# of these, check out /usr/doc/packages/zsh/compctl-examples.
# You you have a slow machine, you might want to comment the lines below
# with compctl in, and comment the below two lines out.
#
# compctl -g '*(-/)' cd pushd
# compctl -g '*(/)' rmdir dircmp
# compctl -j -P % -x 's[-] p[1]' -k signals -- kill
# compctl -j -P % fg bg wait jobs disown
# compctl -A shift
# compctl -caF type whence which
# compctl -F unfunction
# compctl -a unalias
# compctl -v unset typeset declare vared readonly export integer
# compctl -e disable
# compctl -d enable
#
# The default way is the usage of the zsh built-in completer
# Comment the two below lines out, if you are on a slow machine, and
# comment the above compctl lines in.
autoload -U compinit
compinit
#files: 565 version: 4.3.6
_comps=(
'-' '_precommand'
'.' '_source'
'a2dismod' '_a2utils'
'a2dissite' '_a2utils'
'a2enmod' '_a2utils'
'a2ensite' '_a2utils'
'a2ps' '_a2ps'
'aaaa' '_hosts'
'aap' '_aap'
'acpi' '_acpi'
'acpitool' '_acpitool'
'acroread' '_acroread'
'admin' '_sccs'
'ali' '_mh'
'alias' '_alias'
'amaya' '_webbrowser'
'analyseplugin' '_analyseplugin'
'animate' '_imagemagick'
'anno' '_mh'
'ant' '_ant'
'antiword' '_antiword'
'apache2ctl' '_apachectl'
'apachectl' '_apachectl'
'apm' '_apm'
'appletviewer' '_java'
'apropos' '_man'
'apt-cache' '_apt'
'apt-cdrom' '_apt'
'apt-config' '_apt'
'apt-file' '_apt-file'
'apt-get' '_apt'
'aptitude' '_aptitude'
'apt-move' '_apt-move'
'apt-show-versions' '_apt-show-versions'
'arena' '_webbrowser'
'arp' '_arp'
'arping' '_arping'
'-array-value-' '_value'
'-assign-parameter-' '_assign'
'attr' '_attr'
'auto-apt' '_auto-apt'
'autoload' '_typeset'
'bash' '_sh'
'baz' '_baz'
'bg' '_jobs_bg'
'bindkey' '_bindkey'
'bison' '_bison'
'bogofilter' '_bogofilter'
'bogotune' '_bogofilter'
'bogoutil' '_bogofilter'
'-brace-parameter-' '_brace_parameter'
'brctl' '_brctl'
'btdownloadcurses' '_bittorrent'
'btdownloadgui' '_bittorrent'
'btdownloadheadless' '_bittorrent'
'btlaunchmany' '_bittorrent'
'btlaunchmanycurses' '_bittorrent'
'btmakemetafile' '_bittorrent'
'btreannounce' '_bittorrent'
'btrename' '_bittorrent'
'bts' '_bts'
'btshowmetainfo' '_bittorrent'
'bttrack' '_bittorrent'
'bug' '_bug'
'buildhash' '_ispell'
'builtin' '_builtin'
'bunzip2' '_bzip2'
'burst' '_mh'
'bzcat' '_bzip2'
'bzip2' '_bzip2'
'bzip2recover' '_bzip2'
'bzr' '_bzr'
'cal' '_cal'
'calendar' '_calendar'
'catchsegv' '_precommand'
'ccal' '_ccal'
'cd' '_cd'
'cdbs-edit-patch' '_cdbs-edit-patch'
'cdc' '_sccs'
'cdcd' '_cdcd'
'cdrdao' '_cdrdao'
'cdrecord' '_cdrecord'
'certtool' '_gnutls'
'cftp' '_twisted'
'chage' '_users'
'chdir' '_cd'
'chflags' '_chflags'
'chfn' '_users'
'chgrp' '_chown'
'chimera' '_webbrowser'
'chkconfig' '_chkconfig'
'chmod' '_chmod'
'chown' '_chown'
'chsh' '_users'
'ci' '_rcs'
'ckeygen' '_twisted'
'clear' '_nothing'
'co' '_rcs'
'comb' '_sccs'
'combine' '_imagemagick'
'comm' '_comm'
'command' '_command'
'-command-' '_autocd'
'-command-line-' '_normal'
'comp' '_mh'
'compdef' '_compdef'
'composite' '_imagemagick'
'compress' '_compress'
'conch' '_twisted'
'-condition-' '_condition'
'config.status' '_configure'
'configure' '_configure'
'convert' '_imagemagick'
'cowsay' '_cowsay'
'cowthink' '_cowsay'
'cp' '_cp'
'cpio' '_cpio'
'cplay' '_cplay'
'crsh' '_cssh'
'csh' '_sh'
'cssh' '_cssh'
'csup' '_csup'
'curl' '_urls'
'cut' '_cut'
'cvs' '_cvs'
'cvsup' '_cvsup'
'cygcheck' '_cygcheck'
'cygcheck.exe' '_cygcheck'
'cygpath' '_cygpath'
'cygpath.exe' '_cygpath'
'cygrunsrv' '_cygrunsrv'
'cygrunsrv.exe' '_cygrunsrv'
'cygserver' '_cygserver'
'cygserver.exe' '_cygserver'
'cygstart' '_cygstart'
'cygstart.exe' '_cygstart'
'dak' '_dak'
'darcs' '_darcs'
'date' '_date'
'dch' '_debchange'
'dchroot' '_dchroot'
'dchroot-dsa' '_dchroot-dsa'
'dcop' '_dcop'
'dcopclient' '_dcop'
'dcopfind' '_dcop'
'dcopobject' '_dcop'
'dcopref' '_dcop'
'dcopstart' '_dcop'
'dd' '_dd'
'debchange' '_debchange'
'debdiff' '_debdiff'
'debfoster' '_debfoster'
'debsign' '_debsign'
'declare' '_typeset'
'-default-' '_default'
'defaults' '_defaults'
'delta' '_sccs'
'df' '_directories'
'dhclient' '_dhclient'
'dhclient3' '_dhclient'
'dict' '_dict'
'diff' '_diff'
'diffstat' '_diffstat'
'dillo' '_webbrowser'
'dircmp' '_directories'
'dirs' '_dirs'
'disable' '_disable'
'disown' '_jobs_fg'
'display' '_imagemagick'
'dist' '_mh'
'dlocate' '_dlocate'
'dmake' '_make'
'dmidecode' '_dmidecode'
'domainname' '_yp'
'dosdel' '_floppy'
'dosread' '_floppy'
'dpatch-edit-patch' '_dpatch-edit-patch'
'dpkg' '_dpkg'
'dpkg-buildpackage' '_dpkg-buildpackage'
'dpkg-cross' '_dpkg-cross'
'dpkg-deb' '_dpkg'
'dpkg-query' '_dpkg'
'dpkg-reconfigure' '_dpkg'
'dpkg-repack' '_dpkg-repack'
'dpkg-source' '_dpkg_source'
'dput' '_dput'
'du' '_du'
'dumper' '_dumper'
'dumper.exe' '_dumper'
'dupload' '_dupload'
'dvibook' '_dvi'
'dviconcat' '_dvi'
'dvicopy' '_dvi'
'dvidvi' '_dvi'
'dvips' '_dvi'
'dviselect' '_dvi'
'dvitodvi' '_dvi'
'dvitype' '_dvi'
'ecasound' '_ecasound'
'echotc' '_echotc'
'echoti' '_echoti'
'egrep' '_grep'
'elinks' '_elinks'
'elm' '_elm'
'emulate' '_emulate'
'enable' '_enable'
'enscript' '_enscript'
'env' '_env'
'epsffit' '_psutils'
'-equal-' '_equal'
'eval' '_precommand'
'eview' '_vim'
'evim' '_vim'
'exec' '_precommand'
'exim' '_vim'
'explodepkg' '_pkgtool'
'export' '_typeset'
'express' '_webbrowser'
'extcheck' '_java'
'extractres' '_psutils'
'fakeroot' '_fakeroot'
'false' '_nothing'
'fc' '_fc'
'fetchmail' '_fetchmail'
'fg' '_jobs_fg'
'fgrep' '_grep'
'figlet' '_figlet'
'find' '_find'
'findaffix' '_ispell'
'finger' '_finger'
'fink' '_fink'
'firefox' '_mozilla'
'-first-' '_first'
'fixdlsrps' '_psutils'
'fixfmps' '_psutils'
'fixmacps' '_psutils'
'fixpsditps' '_psutils'
'fixpspps' '_psutils'
'fixscribeps' '_psutils'
'fixtpps' '_psutils'
'fixwfwps' '_psutils'
'fixwpps' '_psutils'
'fixwwps' '_psutils'
'flasher' '_flasher'
'flex' '_flex'
'flist' '_mh'
'flists' '_mh'
'float' '_typeset'
'fned' '_zed'
'folder' '_mh'
'folders' '_mh'
'fortune' '_fortune'
'forw' '_mh'
'fsh' '_fsh'
'ftp' '_hosts'
'functions' '_typeset'
'fuser' '_fuser'
'fusermount' '_fusermount'
'fwhois' '_whois'
'g++' '_gcc'
'galeon' '_webbrowser'
'gcc' '_gcc'
'gdb' '_gdb'
'gdiff' '_diff'
'genisoimage' '_genisoimage'
'get' '_sccs'
'getafm' '_psutils'
'getclip' '_getclip'
'getclip.exe' '_getclip'
'getconf' '_getconf'
'getent' '_getent'
'getfacl' '_getfacl'
'getfacl.exe' '_getfacl'
'getfattr' '_attr'
'getmail' '_getmail'
'getopts' '_vars'
'gex' '_vim'
'ggv' '_gnome-gv'
'ghostscript' '_gs'
'ghostview' '_pspdf'
'git' '_git'
'git-add' '_git'
'git-am' '_git'
'git-annotate' '_git'
'git-apply' '_git'
'git-applymbox' '_git'
'git-applypatch' '_git'
'git-archimport' '_git'
'git-archive' '_git'
'git-bisect' '_git'
'git-blame' '_git'
'git-branch' '_git'
'git-cat-file' '_git'
'git-check-attr' '_git'
'git-checkout' '_git'
'git-checkout-index' '_git'
'git-check-ref-format' '_git'
'git-cherry' '_git'
'git-cherry-pick' '_git'
'git-clean' '_git'
'git-clone' '_git'
'git-clone-pack' '_git'
'git-commit' '_git'
'git-commit-tree' '_git'
'git-config' '_git'
'git-convert-objects' '_git'
'git-count-objects' '_git'
'git-cvsexportcommit' '_git'
'git-cvsimport' '_git'
'git-cvsserver' '_git'
'git-daemon' '_git'
'git-describe' '_git'
'git-diff' '_git'
'git-diff-files' '_git'
'git-diff-index' '_git'
'git-diff-stages' '_git'
'git-diff-tree' '_git'
'git-fast-import' '_git'
'git-fetch' '_git'
'git-fetch-pack' '_git'
'git-fmt-merge-msg' '_git'
'git-for-each-ref' '_git'
'git-format-patch' '_git'
'git-fsck' '_git'
'git-gc' '_git'
'git-get-tar-commit-id' '_git'
'git-grep' '_git'
'git-hash-object' '_git'
'git-http-fetch' '_git'
'git-http-push' '_git'
'git-imap-send' '_git'
'git-index-pack' '_git'
'git-init' '_git'
'git-instaweb' '_git'
'git-local-fetch' '_git'
'git-log' '_git'
'git-lost-found' '_git'
'git-ls-files' '_git'
'git-ls-remote' '_git'
'git-ls-tree' '_git'
'git-mailinfo' '_git'
'git-mailsplit' '_git'
'git-merge' '_git'
'git-merge-base' '_git'
'git-merge-file' '_git'
'git-merge-index' '_git'
'git-merge-one-file' '_git'
'git-mergetool' '_git'
'git-merge-tree' '_git'
'git-mktag' '_git'
'git-mktree' '_git'
'git-mv' '_git'
'git-name-rev' '_git'
'git-octopus' '_git'
'git-pack-objects' '_git'
'git-pack-redundant' '_git'
'git-pack-refs' '_git'
'git-patch-id' '_git'
'git-peek-remote' '_git'
'git-prune' '_git'
'git-prune-packed' '_git'
'git-pull' '_git'
'git-push' '_git'
'git-quiltimport' '_git'
'git-read-tree' '_git'
'git-rebase' '_git'
'git-receive-pack' '_git'
'git-reflog' '_git'
'git-relink' '_git'
'git-remote' '_git'
'git-repack' '_git'
'git-request-pull' '_git'
'git-rerere' '_git'
'git-reset' '_git'
'git-revert' '_git'
'git-rev-list' '_git'
'git-rev-parse' '_git'
'git-rm' '_git'
'git-send-email' '_git'
'git-send-pack' '_git'
'git-shell' '_git'
'git-shortlog' '_git'
'git-show' '_git'
'git-show-branch' '_git'
'git-show-index' '_git'
'git-show-ref' '_git'
'git-sh-setup' '_git'
'git-ssh-fetch' '_git'
'git-ssh-upload' '_git'
'git-status' '_git'
'git-stripspace' '_git'
'git-svn' '_git'
'git-svnimport' '_git'
'git-symbolic-ref' '_git'
'git-tag' '_git'
'git-tar-tree' '_git'
'git-unpack-file' '_git'
'git-unpack-objects' '_git'
'git-update-index' '_git'
'git-update-ref' '_git'
'git-update-server-info' '_git'
'git-upload-archive' '_git'
'git-upload-pack' '_git'
'git-var' '_git'
'git-verify-pack' '_git'
'git-verify-tag' '_git'
'git-whatchanged' '_git'
'git-write-tree' '_git'
'global' '_global'
'gls' '_ls'
'gmake' '_make'
'gmplayer' '_mplayer'
'gnome-gv' '_gnome-gv'
'gnutls-cli' '_gnutls'
'gnutls-cli-debug' '_gnutls'
'gpg' '_gpg'
'gpgv' '_gpg'
'gphoto2' '_gphoto2'
'gprof' '_gprof'
'gqview' '_gqview'
'grail' '_webbrowser'
'grep' '_grep'
'groff' '_groff'
'groupadd' '_user_admin'
'groupdel' '_groups'
'groupmod' '_user_admin'
'groups' '_users'
'growisofs' '_growisofs'
'gs' '_gs'
'gsbj' '_pspdf'
'gsdj' '_pspdf'
'gsdj500' '_pspdf'
'gslj' '_pspdf'
'gslp' '_pspdf'
'gsnd' '_pspdf'
'gtar' '_tar'
'guilt' '_guilt'
'guilt-add' '_guilt'
'guilt-applied' '_guilt'
'guilt-delete' '_guilt'
'guilt-files' '_guilt'
'guilt-fold' '_guilt'
'guilt-fork' '_guilt'
'guilt-header' '_guilt'
'guilt-help' '_guilt'
'guilt-import' '_guilt'
'guilt-import-commit' '_guilt'
'guilt-init' '_guilt'
'guilt-new' '_guilt'
'guilt-next' '_guilt'
'guilt-patchbomb' '_guilt'
'guilt-pop' '_guilt'
'guilt-prev' '_guilt'
'guilt-push' '_guilt'
'guilt-rebase' '_guilt'
'guilt-refresh' '_guilt'
'guilt-rm' '_guilt'
'guilt-series' '_guilt'
'guilt-status' '_guilt'
'guilt-top' '_guilt'
'guilt-unapplied' '_guilt'
'gunzip' '_gzip'
'gut-runstatus' '_git'
'gv' '_gv'
'gview' '_vim'
'gvim' '_vim'
'gvimdiff' '_vim'
'gzcat' '_gzip'
'gzilla' '_webbrowser'
'gzip' '_gzip'
'hash' '_hash'
'hdiutil' '_hdiutil'
'help' '_sccs'
'hg' '_mercurial'
'history' '_fc'
'host' '_hosts'
'hotjava' '_webbrowser'
'hwinfo' '_hwinfo'
'iceweasel' '_mozilla'
'icombine' '_ispell'
'iconv' '_iconv'
'id' '_id'
'identify' '_imagemagick'
'ifconfig' '_ifconfig'
'ifdown' '_net_interfaces'
'ifup' '_net_interfaces'
'ijoin' '_ispell'
'import' '_imagemagick'
'inc' '_mh'
'includeres' '_psutils'
'info' '_texinfo'
'infocmp' '_terminals'
'insmod' '_modutils'
'install-info' '_texinfo'
'installpkg' '_pkgtool'
'integer' '_typeset'
'invoke-rc.d' '_invoke-rc.d'
'ip' '_ip'
'iptables' '_iptables'
'iptables-restore' '_iptables'
'iptables-save' '_iptables'
'irssi' '_irssi'
'ispell' '_ispell'
'iwconfig' '_iwconfig'
'jadetex' '_tex'
'jar' '_java'
'jarsigner' '_java'
'java' '_java'
'javac' '_java'
'javadoc' '_java'
'javah' '_java'
'javap' '_java'
'jdb' '_java'
'jobs' '_jobs_builtin'
'joe' '_joe'
'keytool' '_java'
'kfmclient' '_kfmclient'
'kill' '_kill'
'killall' '_killall'
'killall5' '_killall'
'kldload' '_kld'
'kldunload' '_kld'
'knock' '_knock'
'konqueror' '_webbrowser'
'kpdf' '_pdf'
'ksh' '_sh'
'kvno' '_kvno'
'last' '_last'
'lastb' '_last'
'latex' '_tex'
'ldd' '_ldd'
'less' '_less'
'let' '_math'
'lftp' '_ncftp'
'light' '_webbrowser'
'lighty-disable-mod' '_lighttpd'
'lighty-enable-mod' '_lighttpd'
'limit' '_limit'
'linda' '_linda'
'links' '_links'
'lintian' '_lintian'
'linux' '_uml'
'loadkeys' '_loadkeys'
'local' '_typeset'
'locate' '_locate'
'log' '_nothing'
'logname' '_nothing'
'look' '_look'
'lore' '_twisted'
'losetup' '_losetup'
'lp' '_lp'
'lpq' '_lp'
'lpr' '_lp'
'lprm' '_lp'
'ls' '_ls'
'lscfg' '_lscfg'
'lsdev' '_lsdev'
'lslv' '_lslv'
'lsmod' '_modutils'
'lsof' '_lsof'
'lspv' '_lspv'
'lsusb' '_lsusb'
'lsvg' '_lsvg'
'lynx' '_lynx'
'lzop' '_lzop'
'm-a' '_module-assistant'
'madison' '_madison'
'mail' '_mail'
'Mail' '_mail'
'mailx' '_mail'
'make' '_make'
'makeinfo' '_texinfo'
'make-kpkg' '_make-kpkg'
'makepkg' '_pkgtool'
'man' '_man'
'manhole' '_twisted'
'mark' '_mh'
'-math-' '_math'
'mattrib' '_mtools'
'mcd' '_mtools'
'mcopy' '_mtools'
'md5sum' '_md5sum'
'mdel' '_mtools'
'mdeltree' '_mtools'
'mdir' '_mtools'
'mdu' '_mtools'
'members' '_members'
'mencal' '_mencal'
'mere' '_mere'
'merge' '_rcs'
'mergechanges' '_mergechanges'
'metaflac' '_metaflac'
'mformat' '_mtools'
'mgv' '_pspdf'
'mhlist' '_mh'
'mhmail' '_mh'
'mhn' '_mh'
'mhparam' '_mh'
'mhpath' '_mh'
'mhshow' '_mh'
'mhstore' '_mh'
'mii-tool' '_mii-tool'
'mkdir' '_mkdir'
'mkisofs' '_growisofs'
'mkshortcut' '_mkshortcut'
'mkshortcut.exe' '_mkshortcut'
'mktap' '_twisted'
'mkzsh' '_mkzsh'
'mkzsh.exe' '_mkzsh'
'mlabel' '_mtools'
'mlocate' '_locate'
'mmd' '_mtools'
'mmm' '_webbrowser'
'mmount' '_mtools'
'mmove' '_mtools'
'modinfo' '_modutils'
'modprobe' '_modutils'
'module' '_module'
'module-assistant' '_module-assistant'
'mogrify' '_imagemagick'
'mondoarchive' '_mondo'
'montage' '_imagemagick'
'Mosaic' '_webbrowser'
'mount' '_mount'
'mozilla' '_mozilla'
'mozilla-firefox' '_mozilla'
'mozilla-xremote-client' '_mozilla'
'mpc' '_mpc'
'mplayer' '_mplayer'
'mrd' '_mtools'
'mread' '_mtools'
'mren' '_mtools'
'msgchk' '_mh'
'mt' '_mt'
'mtn' '_monotone'
'mtoolstest' '_mtools'
'mtr' '_mtr'
'mtype' '_mtools'
'munchlist' '_ispell'
'mush' '_mail'
'mutt' '_mutt'
'mx' '_hosts'
'mysql' '_mysql_utils'
'mysqladmin' '_mysql_utils'
'mysqldiff' '_mysqldiff'
'mysqldump' '_mysql_utils'
'mysqlimport' '_mysql_utils'
'mysqlshow' '_mysql_utils'
'nail' '_mail'
'native2ascii' '_java'
'nautilus' '_nautilus'
'nc' '_netcat'
'ncal' '_cal'
'ncftp' '_ncftp'
'ncl' '_nedit'
'nedit' '_nedit'
'nedit-nc' '_nedit'
'netcat' '_netcat'
'netrik' '_webbrowser'
'netscape' '_netscape'
'newgrp' '_groups'
'next' '_mh'
'nice' '_nice'
'nmap' '_nmap'
'nmblookup' '_samba'
'nocorrect' '_precommand'
'noglob' '_precommand'
'nohup' '_precommand'
'ns' '_hosts'
'nslookup' '_nslookup'
'ntalk' '_other_accounts'
'odme' '_object_classes'
'odmget' '_object_classes'
'odmshow' '_object_classes'
'ogg123' '_vorbis'
'oggdec' '_vorbis'
'oggenc' '_vorbis'
'ogginfo' '_vorbis'
'open' '_open'
'opera' '_webbrowser'
'p4' '_perforce'
'p4d' '_perforce'
'pack' '_pack'
'packf' '_mh'
'-parameter-' '_parameter'
'parsehdlist' '_urpmi'
'passwd' '_users'
'patch' '_patch'
'pax' '_pax'
'pcat' '_pack'
'pcred' '_pids'
'pdf2dsc' '_pdf'
'pdf2ps' '_pdf'
'pdffonts' '_pdf'
'pdfimages' '_pdf'
'pdfinfo' '_pdf'
'pdfjadetex' '_tex'
'pdflatex' '_tex'
'pdfopt' '_pdf'
'pdftopbm' '_pdf'
'pdftops' '_pdf'
'pdftotext' '_pdf'
'perl' '_perl'
'perldoc' '_perldoc'
'pfiles' '_pids'
'pflags' '_pids'
'phoenix' '_webbrowser'
'php' '_php'
'pick' '_mh'
'pine' '_pine'
'pinef' '_pine'
'ping' '_ping'
'piuparts' '_piuparts'
'pkg_add' '_bsd_pkg'
'pkg-config' '_pkg-config'
'pkg_create' '_bsd_pkg'
'pkg_delete' '_bsd_pkg'
'pkg_info' '_bsd_pkg'
'pkgtool' '_pkgtool'
'pldd' '_pids'
'pmake' '_make'
'pman' '_perl_modules'
'pmap' '_pids'
'pmcat' '_perl_modules'
'pmdesc' '_perl_modules'
'pmeth' '_perl_modules'
'pmexp' '_perl_modules'
'pmfunc' '_perl_modules'
'pmload' '_perl_modules'
'pmls' '_perl_modules'
'pmpath' '_perl_modules'
'pmvers' '_perl_modules'
'podgrep' '_perl_modules'
'podpath' '_perl_modules'
'podtoc' '_perl_modules'
'poff' '_pon'
'policytool' '_java'
'pon' '_pon'
'popd' '_directory_stack'
'portlint' '_portlint'
'portsnap' '_portsnap'
'postsuper' '_postfix'
'prcs' '_prcs'
'prev' '_mh'
'print' '_print'
'printenv' '_printenv'
'prompt' '_prompt'
'prs' '_sccs'
'prt' '_sccs'
'prun' '_pids'
'ps2ascii' '_pspdf'
'ps2epsi' '_ps'
'ps2pdf' '_ps'
'ps2pdf12' '_ps'
'ps2pdf13' '_ps'
'ps2pdf14' '_ps'
'ps2pdfwr' '_ps'
'ps2ps' '_ps'
'psbook' '_psutils'
'pscp' '_pscp'
'pscp.exe' '_pscp'
'psig' '_pids'
'psmerge' '_psutils'
'psmulti' '_ps'
'psnup' '_psutils'
'psresize' '_psutils'
'psselect' '_psutils'
'pstack' '_pids'
'pstoedit' '_pspdf'
'pstop' '_pids'
'pstops' '_psutils'
'pstotgif' '_pspdf'
'pswrap' '_ps'
'ptree' '_pids'
'pump' '_pump'
'pushd' '_cd'
'putclip' '_putclip'
'putclip.exe' '_putclip'
'pwait' '_pids'
'pwdx' '_pids'
'pyhtmlizer' '_twisted'
'python' '_python'
'qemu' '_qemu'
'qiv' '_qiv'
'qtplay' '_qtplay'
'querybts' '_bug'
'quilt' '_quilt'
'r' '_fc'
'raggle' '_raggle'
'rake' '_rake'
'ranlib' '_ranlib'
'rar' '_rar'
'rc' '_sh'
'rcp' '_rlogin'
'rcs' '_rcs'
'rcsdiff' '_rcs'
'read' '_read'
'readonly' '_typeset'
'-redirect-' '_redirect'
'-redirect-,<,bunzip2' '_bzip2'
'-redirect-,<,bzip2' '_bzip2'
'-redirect-,>,bzip2' '_bzip2'
'-redirect-,<,compress' '_compress'
'-redirect-,>,compress' '_compress'
'-redirect-,-default-,-default-' '_files'
'-redirect-,<,gunzip' '_gzip'
'-redirect-,<,gzip' '_gzip'
'-redirect-,>,gzip' '_gzip'
'-redirect-,<,uncompress' '_compress'
'refile' '_mh'
'rehash' '_hash'
'removepkg' '_pkgtool'
'remsh' '_rlogin'
'renice' '_renice'
'repl' '_mh'
'reportbug' '_bug'
'reprepro' '_reprepro'
'retawq' '_webbrowser'
'rgview' '_vim'
'rgvim' '_vim'
'ri' '_ri'
'rlogin' '_rlogin'
'rmadison' '_madison'
'rmdel' '_sccs'
'rmdir' '_directories'
'rmf' '_mh'
'rmic' '_java'
'rmid' '_java'
'rmiregistry' '_java'
'rmm' '_mh'
'rmmod' '_modutils'
'rpm' '_rpm'
'rrdtool' '_rrdtool'
'rsh' '_rlogin'
'rsync' '_rsync'
'rtin' '_tin'
'rubber' '_rubber'
'rubber-info' '_rubber'
'rubber-pipe' '_rubber'
'ruby' '_ruby'
'rup' '_hosts'
'rusage' '_precommand'
'rview' '_vim'
'rvim' '_vim'
'rwho' '_hosts'
'sabcmd' '_sablotron'
'sact' '_sccs'
'scan' '_mh'
'sccs' '_sccs'
'sccsdiff' '_sccs'
'sched' '_sched'
'schroot' '_schroot'
'scp' '_ssh'
'screen' '_screen'
'sed' '_sed'
'serialver' '_java'
'service' '_service'
'set' '_set'
'setfattr' '_attr'
'setopt' '_setopt'
'sftp' '_ssh'
'sh' '_sh'
'shift' '_arrays'
'show' '_mh'
'showchar' '_psutils'
'showmount' '_showmount'
'sisu' '_sisu'
'skipstone' '_webbrowser'
'slitex' '_tex'
'slocate' '_locate'
'slogin' '_ssh'
'slrn' '_slrn'
'smbclient' '_samba'
'smbcontrol' '_samba'
'smbstatus' '_samba'
'smit' '_smit'
'smitty' '_smit'
'soa' '_hosts'
'socket' '_socket'
'softwareupdate' '_softwareupdate'
'sortm' '_mh'
'source' '_source'
'spamassassin' '_spamassassin'
'sqsh' '_sqsh'
'sr' '_surfraw'
'srptool' '_gnutls'
'ssh' '_ssh'
'ssh-add' '_ssh'
'ssh-agent' '_ssh'
'sshfs' '_sshfs'
'ssh-keygen' '_ssh'
'star' '_tar'
'stat' '_stat'
'strip' '_strip'
'stty' '_stty'
'su' '_su'
'-subscript-' '_subscript'
'sudo' '_sudo'
'surfraw' '_surfraw'
'SuSEconfig' '_SuSEconfig'
'svn' '_subversion'
'svnadmin' '_subversion'
'svnadmin-static' '_subversion'
'svn-buildpackage' '_svn-buildpackage'
'sync' '_nothing'
'sysctl' '_sysctl'
'talk' '_other_accounts'
'tap2deb' '_twisted'
'tap2rpm' '_twisted'
'tapconvert' '_twisted'
'tar' '_tar'
'tardy' '_tardy'
'tcptraceroute' '_tcptraceroute'
'tcsh' '_sh'
'telnet' '_telnet'
'tex' '_tex'
'texi2dvi' '_texinfo'
'texindex' '_texinfo'
'tidy' '_tidy'
'-tilde-' '_tilde'
'time' '_precommand'
'times' '_nothing'
'tin' '_tin'
'tkconch' '_twisted'
'tkinfo' '_texinfo'
'tkmktap' '_twisted'
'tla' '_tla'
'todo.sh' '_todo.sh'
'toilet' '_toilet'
'totdconfig' '_totd'
'tpb' '_tpb'
'tpconfig' '_tpconfig'
'tpkg-debarch' '_toolchain-source'
'tpkg-install' '_toolchain-source'
'tpkg-install-libc' '_toolchain-source'
'tpkg-make' '_toolchain-source'
'tpkg-update' '_toolchain-source'
'tracepath' '_tracepath'
'tracepath6' '_tracepath'
'traceroute' '_hosts'
'trap' '_trap'
'trial' '_twisted'
'true' '_nothing'
'tryaffix' '_ispell'
'ttyctl' '_ttyctl'
'tunctl' '_uml'
'tune2fs' '_tune2fs'
'twistd' '_twisted'
'txt' '_hosts'
'type' '_which'
'typeset' '_typeset'
'ulimit' '_ulimit'
'uml_mconsole' '_uml'
'uml_moo' '_uml'
'uml_switch' '_uml'
'umount' '_mount'
'unace' '_unace'
'unalias' '_aliases'
'uname' '_uname'
'uncompress' '_compress'
'unexpand' '_unexpand'
'unfunction' '_functions'
'unget' '_sccs'
'unhash' '_unhash'
'uniq' '_uniq'
'units' '_units'
'unlimit' '_limits'
'unpack' '_pack'
'unrar' '_rar'
'unset' '_vars'
'unsetopt' '_unsetopt'
'unzip' '_zip'
'update-alternatives' '_update-alternatives'
'update-rc.d' '_update-rc.d'
'upgradepkg' '_pkgtool'
'urpme' '_urpmi'
'urpmf' '_urpmi'
'urpmi' '_urpmi'
'urpmi.addmedia' '_urpmi'
'urpmi.removemedia' '_urpmi'
'urpmi.update' '_urpmi'
'urpmq' '_urpmi'
'urxvt' '_urxvt'
'uscan' '_uscan'
'useradd' '_user_admin'
'userdel' '_users'
'usermod' '_user_admin'
'val' '_sccs'
'valgrind' '_valgrind'
'-value-' '_value'
'-value-,ANT_ARGS,-default-' '_ant'
'-value-,CFLAGS,-default-' '_gcc'
'-value-,CPPFLAGS,-default-' '_gcc'
'-value-,-default-,-default-' '_value'
'-value-,DISPLAY,-default-' '_x_display'
'-value-,GREP_OPTIONS,-default-' '_grep'
'-value-,GZIP,-default-' '_gzip'
'-value-,LANG,-default-' '_locales'
'-value-,LANGUAGE,-default-' '_locales'
'-value-,LD_DEBUG,-default-' '_ld_debug'
'-value-,LDFLAGS,-default-' '_gcc'
'-value-,LESSCHARSET,-default-' '_less'
'-value-,LESS,-default-' '_less'
'-value-,LPDEST,-default-' '_printers'
'-value-,P4CLIENT,-default-' '_perforce'
'-value-,P4MERGE,-default-' '_perforce'
'-value-,P4PORT,-default-' '_perforce'
'-value-,P4USER,-default-' '_perforce'
'-value-,PERLDOC,-default-' '_perldoc'
'-value-,PRINTER,-default-' '_printers'
'-value-,TERM,-default-' '_terminals'
'-value-,TERMINFO_DIRS,-default-' '_dir_list'
'-value-,TZ,-default-' '_time_zone'
'-value-,VALGRIND_OPTS,-default-' '_valgrind'
'-value-,WWW_HOME,-default-' '_urls'
'-value-,XML_CATALOG_FILES,-default-' '_xmlsoft'
'vared' '_vared'
'-vared-' '_in_vared'
'vim' '_vim'
'vim-addons' '_vim-addons'
'vimdiff' '_vim'
'vncserver' '_vnc'
'vncviewer' '_vnc'
'vorbiscomment' '_vorbiscomment'
'vserver' '_vserver'
'vux' '_vux'
'vuxctl' '_vux'
'w3m' '_w3m'
'wait' '_wait'
'wajig' '_wajig'
'wanna-build' '_wanna-build'
'websetroot' '_twisted'
'wget' '_wget'
'what' '_sccs'
'whatis' '_man'
'whence' '_which'
'where' '_which'
'whereis' '_whereis'
'which' '_which'
'whoami' '_nothing'
'whois' '_whois'
'whom' '_mh'
'wiggle' '_wiggle'
'wodim' '_cdrecord'
'write' '_users_on'
'www' '_webbrowser'
'xargs' '_xargs'
'xauth' '_xauth'
'xdpyinfo' '_x_utils'
'xdvi' '_xdvi'
'xelatex' '_tex'
'xetex' '_tex'
'xev' '_x_utils'
'xfd' '_x_utils'
'xfig' '_xfig'
'xfontsel' '_x_utils'
'xhost' '_x_utils'
'xkill' '_x_utils'
'xli' '_xloadimage'
'xloadimage' '_xloadimage'
'xmllint' '_xmlsoft'
'xmodmap' '_xmodmap'
'xmosaic' '_webbrowser'
'xon' '_x_utils'
'xpdf' '_xpdf'
'xping' '_hosts'
'xrandr' '_xrandr'
'xrdb' '_x_utils'
'xscreensaver-command' '_xscreensaver'
'xset' '_xset'
'xsetbg' '_xloadimage'
'xsetroot' '_x_utils'
'xsltproc' '_xmlsoft'
'xterm' '_xterm'
'xtightvncviewer' '_vnc'
'xtp' '_imagemagick'
'xv' '_xv'
'xview' '_xloadimage'
'xvnc4viewer' '_vnc'
'xvncviewer' '_vnc'
'xwd' '_x_utils'
'xwininfo' '_x_utils'
'xwit' '_xwit'
'xwud' '_x_utils'
'yast' '_yast'
'yast2' '_yast'
'ypbind' '_yp'
'ypcat' '_yp'
'ypmatch' '_yp'
'yppasswd' '_yp'
'yppoll' '_yp'
'yppush' '_yp'
'ypserv' '_yp'
'ypset' '_yp'
'ypwhich' '_yp'
'ypxfr' '_yp'
'ytalk' '_other_accounts'
'yum' '_yum'
'zcat' '_zcat'
'zcompile' '_zcompile'
'zcp' '_zmv'
'zdump' '_zdump'
'zed' '_zed'
'zen' '_webbrowser'
'zip' '_zip'
'zipinfo' '_zip'
'zle' '_zle'
'zln' '_zmv'
'zmail' '_mail'
'zmodload' '_zmodload'
'zmv' '_zmv'
'zone' '_hosts'
'zpty' '_zpty'
'zsh' '_sh'
'zstat' '_stat'
'zstyle' '_zstyle'
'zxpdf' '_xpdf'
)
_services=(
'bzcat' 'bunzip2'
'dch' 'debchange'
'gzcat' 'gunzip'
'iceweasel' 'firefox'
'Mail' 'mail'
'mailx' 'mail'
'nail' 'mail'
'ncl' 'nc'
'nedit-nc' 'nc'
'pcat' 'unpack'
'-redirect-,<,bunzip2' 'bunzip2'
'-redirect-,<,bzip2' 'bzip2'
'-redirect-,>,bzip2' 'bunzip2'
'-redirect-,<,compress' 'compress'
'-redirect-,>,compress' 'uncompress'
'-redirect-,<,gunzip' 'gunzip'
'-redirect-,<,gzip' 'gzip'
'-redirect-,>,gzip' 'gunzip'
'-redirect-,<,uncompress' 'uncompress'
'remsh' 'rsh'
'slogin' 'ssh'
'svnadmin-static' 'svnadmin'
'xelatex' 'latex'
'xetex' 'tex'
)
_patcomps=(
'*/(init|rc[0-9S]#).d/*' '_init_d'
'zf*' '_zftp'
)
_postpatcomps=(
'(p[bgpn]m*|*top[bgpn]m)' '_pbm'
'(texi(2*|ndex))' '_texi'
'(tiff*|*2tiff|pal2rgb)' '_tiff'
'-value-,(ftp|http(|s))_proxy,-default-' '_urls'
'-value-,LC_*,-default-' '_locales'
'-value-,*path,-default-' '_directories'
'-value-,*PATH,-default-' '_dir_list'
'-value-,RUBY(LIB|OPT|PATH),-default-' '_ruby'
'*/X11(|R[456])/*' '_x_arguments'
'yodl(|2*)' '_yodl'
)
_compautos=(
'_call_program' '+X'
)
zle -C _bash_complete-word .complete-word _bash_completions
zle -C _bash_list-choices .list-choices _bash_completions
zle -C _complete_debug .complete-word _complete_debug
zle -C _complete_help .complete-word _complete_help
zle -C _complete_tag .complete-word _complete_tag
zle -C _correct_filename .complete-word _correct_filename
zle -C _correct_word .complete-word _correct_word
zle -C _expand_alias .complete-word _expand_alias
zle -C _expand_word .complete-word _expand_word
zle -C _history-complete-newer .complete-word _history_complete_word
zle -C _history-complete-older .complete-word _history_complete_word
zle -C _list_expansions .list-choices _expand_word
zle -C _most_recent_file .complete-word _most_recent_file
zle -C _next_tags .list-choices _next_tags
zle -C _read_comp .complete-word _read_comp
bindkey '^X^R' _read_comp
bindkey '^X?' _complete_debug
bindkey '^XC' _correct_filename
bindkey '^Xa' _expand_alias
bindkey '^Xc' _correct_word
bindkey '^Xd' _list_expansions
bindkey '^Xe' _expand_word
bindkey '^Xh' _complete_help
bindkey '^Xm' _most_recent_file
bindkey '^Xn' _next_tags
bindkey '^Xt' _complete_tag
bindkey '^X~' _bash_list-choices
bindkey '^[,' _history-complete-newer
bindkey '^[/' _history-complete-older
bindkey '^[~' _bash_complete-word
autoload -Uz _a2ps _a2utils _aap _acpi _acpitool \
_acroread _alias _aliases _all_labels _all_matches \
_alternative _analyseplugin _ant _antiword _apachectl \
_apm _approximate _apt _apt-file _aptitude \
_apt-move _apt-show-versions _arch_archives _arch_namespace _arg_compile \
_arguments _arp _arping _arrays _assign \
_attr _auto-apt _autocd _bash_completions _baz \
_bind_addresses _bindkey _bison _bittorrent _bogofilter \
_brace_parameter _brctl _bsd_pkg _bts _bug \
_builtin _bzip2 _bzr _cache_invalid _cal \
_calendar _call_function _canonical_paths _ccal _cd \
_cdbs-edit-patch _cdcd _cdrdao _cdrecord _chflags \
_chkconfig _chmod _chown _combination _comm \
_command _command_names _compdef _complete _complete_debug \
_complete_help _complete_help_generic _complete_tag _compress _condition \
_configure _correct _correct_filename _correct_word _cowsay \
_cp _cpio _cplay _cssh _csup \
_ctags_tags _cut _cvs _cvsup _cygcheck \
_cygpath _cygrunsrv _cygserver _cygstart _dak \
_darcs _date _dchroot _dchroot-dsa _dcop \
_dd _debchange _debdiff _debfoster _deb_packages \
_debsign _default _defaults _delimiters _describe \
_description _dhclient _dict _dict_words _diff \
_diff_options _diffstat _directories _directory_stack _dir_list \
_dirs _disable _dispatch _dlocate _dmidecode \
_domains _dpatch-edit-patch _dpkg _dpkg-buildpackage _dpkg-cross \
_dpkg-repack _dpkg_source _dput _du _dumper \
_dupload _dvi _ecasound _echotc _echoti \
_elinks _elm _email_addresses _emulate _enable \
_enscript _env _equal _expand _expand_alias \
_expand_word _fakeroot _fc _fetchmail _figlet \
_file_descriptors _files _file_systems _find _finger \
_fink _first _flasher _flex _floppy \
_fortune _fsh _functions _fuse_arguments _fuser \
_fusermount _fuse_values _gcc _gdb _generic \
_genisoimage _getclip _getconf _getent _getfacl \
_getmail _git _global _global_tags _globqual_delims \
_globquals _gnome-gv _gnu_generic _gnutls _gpg \
_gphoto2 _gprof _gqview _grep _groff \
_groups _growisofs _gs _guard _guilt \
_gv _gzip _hash _hdiutil _history \
_history_complete_word _history_modifiers _hosts _hwinfo _iconv \
_id _ifconfig _ignored _imagemagick _init_d \
_in_vared _invoke-rc.d _ip _iptables _irssi \
_ispell _iwconfig _java _java_class _jobs \
_jobs_bg _jobs_builtin _jobs_fg _joe _kfmclient \
_kill _killall _kld _knock _kvno \
_last _ldd _ld_debug _less _lighttpd \
_limit _limits _linda _links _lintian \
_list _list_files _loadkeys _locales _locate \
_logical_volumes _look _losetup _lp _ls \
_lscfg _lsdev _lslv _lsof _lspv \
_lsusb _lsvg _lynx _lzop _mac_applications \
_mac_files_for_application _madison _mail _mailboxes _main_complete \
_make _make-kpkg _man _match _math \
_md5sum _members _mencal _menu _mercurial \
_mere _mergechanges _message _metaflac _mh \
_mii-tool _mime_types _mkdir _mkshortcut _mkzsh \
_module _module-assistant _modutils _mondo _monotone \
_most_recent_file _mount _mozilla _mpc _mplayer \
_mt _mtools _mtr _multi_parts _mutt \
_my_accounts _mysqldiff _mysql_utils _nautilus _ncftp \
_nedit _netcat _net_interfaces _netscape _newsgroups \
_next_label _next_tags _nice _nmap _normal \
_nothing _nslookup _object_classes _oldlist _open \
_options _options_set _options_unset _other_accounts _pack \
_parameter _parameters _patch _path_commands _path_files \
_pax _pbm _pdf _perforce _perl \
_perl_basepods _perldoc _perl_modules _php _physical_volumes \
_pick_variant _pids _pine _ping _piuparts \
_pkg-config _pkgtool _pon _portlint _ports \
_portsnap _postfix _prcs _precommand _prefix \
_print _printenv _printers _prompt _ps \
_pscp _pspdf _psutils _pump _putclip \
_python _qemu _qiv _qtplay _quilt \
_raggle _rake _ranlib _rar _rcs \
_read _read_comp _redirect _regex_arguments _regex_words \
_renice _reprepro _requested _retrieve_cache _retrieve_mac_apps \
_ri _rlogin _rpm _rrdtool _rsync \
_rubber _ruby _sablotron _samba _sccs \
_sched _schroot _screen _sed _sep_parts \
_service _services _set _set_command _setopt \
_setup _sh _showmount _signals _sisu \
_slrn _smit _socket _softwareupdate _source \
_spamassassin _sqsh _ssh _sshfs _stat \
_store_cache _strip _stty _su _sub_commands \
_subscript _subversion _sudo _suffix_alias_files _surfraw \
_SuSEconfig _svn-buildpackage _sysctl _tags _tar \
_tar_archive _tardy _tcptraceroute _telnet _terminals \
_tex _texi _texinfo _tidy _tiff \
_tilde _tilde_files _time_zone _tin _tla \
_todo.sh _toilet _toolchain-source _totd _tpb \
_tpconfig _tracepath _trap _ttyctl _tune2fs \
_twisted _typeset _ulimit _uml _unace \
_uname _unexpand _unhash _uniq _units \
_unsetopt _update-alternatives _update-rc.d _urls _urpmi \
_urxvt _uscan _user_admin _user_at_host _users \
_users_on _valgrind _value _values _vared \
_vars _vim _vim-addons _vnc _volume_groups \
_vorbis _vorbiscomment _vserver _vux _w3m \
_wait _wajig _wakeup_capable_devices _wanna-build _wanted \
_webbrowser _wget _whereis _which _whois \
_wiggle _xargs _x_arguments _xauth _x_borderwidth \
_x_color _x_colormapid _x_cursor _x_display _xdvi \
_x_extension _xfig _x_font _x_geometry _x_keysym \
_xloadimage _x_locale _xmlsoft _x_modifier _xmodmap \
_x_name _xpdf _xrandr _x_resource _xscreensaver \
_x_selection_timeout _xset _xt_arguments _xterm _x_title \
_xt_session_id _x_utils _xv _x_visual _x_window \
_xwit _yast _yast2 _yodl _yp \
_yum _zcat _zcompile _zdump _zed \
_zftp _zip _zle _zmodload _zmv \
_zpty _zstyle
autoload -Uz +X _call_program
typeset -gUa _comp_assocs
_comp_assocs=( '' )
# Completion so "cd ..<TAB>" -> "cd ../"
# zstyle ':completion:*' special-dirs ..
# Online help
unalias run-help 2>/dev/null || true
autoload run-help
# Don't use zsh builtin which
alias which >/dev/null && unalias which
# Common standard keypad and cursor
bindkey "^[[2~" yank
bindkey "^[[3~" delete-char
# History completion on pgup and pgdown
autoload -U history-search-end
zle -N history-beginning-search-backward-end history-search-end
zle -N history-beginning-search-forward-end history-search-end
bindkey "^[[5~" history-beginning-search-backward-end
bindkey "^[[6~" history-beginning-search-forward-end
if [[ "$TERM" == "xterm" ]] then
bindkey "^[2;5~" yank
bindkey "^[3;5~" delete-char
bindkey "^[5;5~" up-history
bindkey "^[6;5~" down-history
fi
bindkey "^[[C" forward-char
bindkey "^[[D" backward-char
bindkey "^[[A" up-history
bindkey "^[[B" down-history
# Avoid network problems
# ... \177 (ASCII-DEL) and \010 (ASCII-BS)
# do `backward-delete-char'
# Note: `delete-char' is maped to \033[3~
# Therefore xterm's responce on pressing
# key Delete or KP-Delete should be
# \033[3~ ... NOT \177
bindkey "^?" backward-delete-char
bindkey "^H" backward-delete-char
# Home and End
if [[ "$TERM" == "xterm" ]] then
# Normal keypad and cursor of xterm
bindkey "^[[1~" history-search-backward
bindkey "^[[4~" set-mark-command
bindkey "^[[H" beginning-of-line
bindkey "^[[F" end-of-line
# Home and End of application keypad and cursor of xterm
bindkey "^[OH" beginning-of-line
bindkey "^[OF" end-of-line
bindkey "^[O5H" beginning-of-line
bindkey "^[O5F" end-of-line
else
if [[ "$TERM" == "kvt" ]] then
bindkey "^[[1~" history-search-backward
bindkey "^[[4~" set-mark-command
bindkey "^[OH" beginning-of-line
bindkey "^[OF" end-of-line
else
# TERM=linux or console
bindkey "^[[1~" beginning-of-line
bindkey "^[[4~" end-of-line
fi
fi
# Application keypad and cursor of xterm
if [[ "$TERM" == "xterm" ]] then
bindkey "^[OD" backward-char
bindkey "^[OC" forward-char
bindkey "^[OA" up-history
bindkey "^[OB" down-history
# DEC keyboard KP_F1 - KP_F4
bindkey -s "^[OP" "^["
bindkey "^[OQ" undo
bindkey "^[OR" undefined-key
bindkey "^[OS" kill-line
fi
if [[ "$TERM" == "gnome" ]] then
# or gnome terminal F1 - F4
bindkey -s "^[OP" "^["
bindkey "^[OQ" undo
bindkey "^[OR" undefined-key
bindkey "^[OS" kill-line
fi
# Function keys F1 - F12
if [[ "$TERM" == "linux" ]] then
# On console the first five function keys
bindkey "^[[[A" undefined-key
bindkey "^[[[B" undefined-key
bindkey "^[[[C" undefined-key
bindkey "^[[[D" undefined-key
bindkey "^[[[E" undefined-key
else
# The first five standard function keys
bindkey "^[[11~" undefined-key
bindkey "^[[12~" undefined-key
bindkey "^[[13~" undefined-key
bindkey "^[[14~" undefined-key
bindkey "^[[15~" undefined-key
fi
bindkey "^[[17~" undefined-key
bindkey "^[[18~" undefined-key
bindkey "^[[19~" undefined-key
bindkey "^[[20~" undefined-key
bindkey "^[[21~" undefined-key
# Note: F11, F12 are identical with Shift_F1 and Shift_F2
bindkey "^[[23~" undefined-key
bindkey "^[[24~" undefined-key
# Shift Function keys F1 - F12
# identical with F11 - F22
#
# bindkey "^[[23~" undefined-key
# bindkey "^[[24~" undefined-key
bindkey "^[[25~" undefined-key
bindkey "^[[26~" undefined-key
# DEC keyboard: F15=^[[28~ is Help
bindkey "^[[28~" undefined-key
# DEC keyboard: F16=^[[29~ is Menu
bindkey "^[[29~" undefined-key
bindkey "^[[31~" undefined-key
bindkey "^[[32~" undefined-key
bindkey "^[[33~" undefined-key
bindkey "^[[34~" undefined-key
if [[ "$TERM" == "xterm" ]] then
# Not common
bindkey "^[[35~" undefined-key
bindkey "^[[36~" undefined-key
fi
if [[ "$TERM" == "xterm" ]] then
# Application keypad and cursor of xterm
# with NumLock ON
#
# Operators
bindkey -s "^[Oo" "/"
bindkey -s "^[Oj" "*"
bindkey -s "^[Om" "-"
bindkey -s "^[Ok" "+"
bindkey -s "^[Ol" ","
bindkey -s "^[OM" "\n"
bindkey -s "^[On" "."
# Numbers
bindkey -s "^[Op" "0"
bindkey -s "^[Oq" "1"
bindkey -s "^[Or" "2"
bindkey -s "^[Os" "3"
bindkey -s "^[Ot" "4"
bindkey -s "^[Ou" "5"
bindkey -s "^[Ov" "6"
bindkey -s "^[Ow" "7"
bindkey -s "^[Ox" "8"
bindkey -s "^[Oy" "9"
fi
# EMACS line editing
if [[ "$ZSHEDIT" == "emacs" ]] then
# ... xterm application cursor
if [[ "$TERM" == "xterm" ]] then
bindkey "^[^[OD" backward-word
bindkey "^[^[OC" forward-word
bindkey "^[^[OA" up-history
bindkey "^[^[OB" down-history
bindkey "^^[OD" backward-char
bindkey "^^[OC" forward-char
bindkey "^^[OA" up-history
bindkey "^^[OB" down-history
fi
# Standard cursor
bindkey "^[^[[D" backward-word
bindkey "^[^[[C" forward-word
bindkey "^[^[[A" up-history
bindkey "^[^[[B" down-history
bindkey "^^[[D" backward-char
bindkey "^^[[C" forward-char
bindkey "^^[[A" up-history
bindkey "^^[[B" down-history
fi
# DO NOT EDIT THIS FILE !!!
# All your personal configuration should be done in .zshrc.<loginname>
# If for any reason you wish to bypass the standard process, you can create a
# .zshrc.override to set a custom environment, but DSP will not provide support
# in such a case.
if [ -e $HOME/.zshrc.override ]
then
file="$HOME/.zshrc.override"
else
file="$REPENV/buildrc"
fi
if [ -f $file ]
then
if tty -s
then
. $file
else
. $file > /dev/null
fi
fi
# Common server OS Settings
#
if [ -f $REPENV/systems/zshrc.allsystems ]
then
. $REPENV/systems/zshrc.allsystems
fi
#
# Options de shell
#
setopt ignoreeof
setopt noclobber
setopt extendedglob
setopt numericglobsort
setopt autopushd pushdsilent pushdtohome
setopt histverify histignoredups appendhistory
setopt zle
setopt correct correctall
setopt completeinword automenu
setopt autolist listtypes
setopt rcexpandparam
#
# Alias
#
alias ll='ls -lL'
alias la='ls -lLa'
alias dirs='dirs -v'
alias h='fc -l -50 '
alias rmi='rm -i'
alias psall='ps -ef'
#alias psmy='ps -ef | grep "^[ ]*$LOGNAME "'
#JFR 100916
alias psmy='ps -fu $USER | sort | egrep -v "ps -fu|sort|grep"'
alias chown='chown -h'
alias chgrp='chgrp -h'
alias exit='. /tools/scripts/global_scripts/exitclean'
alias myquotacheck='quota'
alias myquotalist='quota -v'
alias -g PM='| more'
alias -g PG='| grep'
alias -g PGV='| grep -v'
#
# Fonctions
#
#
# Divers
#
stty intr '^C'
#stty erase ''
stty kill '^K'
bindkey -e
# Specific server OS Settings
if [ -f $REPENV/systems/zshrc.$(uname -s).$(uname -r) ]
then
. $REPENV/systems/zshrc.$(uname -s).$(uname -r)
fi
# Specific HOST settings
# ----------------------
if [ -f $REPENV/hosts/zshrc.$HOST ]
then
. $REPENV/hosts/zshrc.$HOST
fi
# Specific installed TOOLS settings (in local /softntools/tools linux folder)
# ---------------------------------------------------------------------------
for i in `ls -d /softs/*(N)|sed 's/.*\/\([^\/]*\)$/\1/'`
do
if [ -f $REPENV/softs/zshrc.$i ]
then
. $REPENV/softs/zshrc.$i
fi
done
#
# Options de shell
#
#
# Alias
#
alias 9iR2-4='. /nastools/oracle/util/init_env.sh 9.2.0.4; echo "Switch to Oracle 9.2.0.4"'
alias 9iR2-5='. /nastools/oracle/util/init_env.sh 9.2.0.5; echo "Switch to Oracle 9.2.0.5"'
alias 9iR2-6='. /nastools/oracle/util/init_env.sh 9.2.0.6; echo "Switch to Oracle 9.2.0.6"'
alias 9iR2-7='. /nastools/oracle/util/init_env.sh 9.2.0.7; echo "Switch to Oracle 9.2.0.7"'
alias 10g='. /nastools/oracle/util/init_env.sh 10.1.0; echo "Switch to Oracle 10.1.0"'
alias 10gR2='. /nastools/oracle/util/init_env.sh 10.2.0; echo "Switch to Oracle 10.2.0"'
alias 10gR22='. /nastools/oracle/util/init_env.sh 10.2.0.2; echo "Switch to Oracle 10.2.0.2"'
# Specific installed TOOLS settings (in local /softntools/tools linux folder)
# ---------------------------------------------------------------------------
for i in `ls -d /tools/*(N)|sed 's/.*\/\([^\/]*\)$/\1/'`
do
if [ -f $REPENV/tools/zshrc.$i ]
then
. $REPENV/tools/zshrc.$i
fi
done
#
# Options de shell
#
#
# Alias
#
[[ -x /tools/fileutils/bin/df ]] && alias df='/tools/fileutils/bin/df'
#
# Fonctions
#
#
# Divers
#
# Specific NASTOOLS settings (in global /remote/tools/Linux/2.6 folder)
# ---------------------------------------------------------------------
for i in `ls -d /nastools/*(N)|sed 's/.*\/\([^\/]*\)$/\1/'`
do
if [ -f $REPENV/nastools/zshrc.$i ]
then
. $REPENV/nastools/zshrc.$i
fi
done
#
# Options de shell
#
#
# Alias
#
#
# Fonctions
#
#
# Divers
#
#
# Options de shell
#
#
# Alias
#
#
# Fonctions
#
#
# Divers
#
#
# Options de shell
#
#
# Alias
#
#
# Fonctions
#
#
# Divers
#
#
# Options de shell
#
#
# Alias
#
#
# Fonctions
#
#
# Divers
#
#
# Options de shell
#
#
# Alias
#
#
# Fonctions
#
#
# Divers
#
#
# Options de shell
#
#
# Alias
#
#
# Fonctions
#
#
# Divers
#
#
# Options de shell
#
#
# Alias
#
#
# Fonctions
#
#
# Divers
#
#
# Options de shell
#
#
# Alias
#
#
# Fonctions
#
#
# Divers
#
#
# Options de shell
#
#
# Alias
#
#
# Fonctions
#
#
# Divers
#
#
# Options de shell
#
#
# Alias
#
#
# Fonctions
#
#
# Divers
#
# Specific USER GROUPS settings (according to user primary group membership)
# --------------------------------------------------------------------------
for i in $(groups $USERNAME)
do
if [ -f $REPENV/teams/zshrc.$i ]
then
. $REPENV/teams/zshrc.$i
fi
done
# Specific PROJECT GROUPS settings (according to user secondary group membership)
# -------------------------------------------------------------------------------
for i in $(groups $USERNAME)
do
if [ -f $REPENV/projects/zshrc.$i ]
then
. $REPENV/projects/zshrc.$i
fi
done
# ====================================================================== #
# SBR Server .zshrc #
# ---------------------------------------------------------------------- #
# The .zshrc file is only sourced by zsh for "interactive" shells.
#
# It should contain all parameters relevant only for interactive shells
# -- such as command aliases, terminal behaviour settings (prompt, key
# bindings, etc.) -- but not suitable for scripting (for instance aliases
# may have undesirable side effects when scripting).
# --------- #
# Shortcuts #
# --------- #
### -- Use colour output for 'ls'
# WARNING: Be sure to set the color in "auto" mode. This way, color output is
# turned on only when 'ls' is run as an interactive command. Otherwise, the
# color escape codes scramble the output and prevent using 'ls' in scripts.
alias ls="ls --color=auto"
### -- Long listing
# The default 'll' alias uses the -L switch that hides symbolic links.
# This is error-prone.
alias ll='ls -l'
# Go up one directory
alias s='cd ..'
# Vim as vi
alias vi='vim'
# Wall-e database scripts path
export PATH=/remote/projects1/intprl/delivery/walle/latest:$PATH
### -- Switch some environment variables
alias cvs_remove_status="cvs status | fgrep "Needs Checkout" | cut -f4 -d" " | cut -f1"
### Database handling
alias sqc="sqlplus $AMDORA_USER/$AMDORA_PASSWD@$AMDORA_SERVICE"
alias trc="script_sql/utility/truncate.sh $AMDORA_USER $AMDORA_PASSWD $AMDORA_SERVICE"
### -- AStyle
export ARTISTIC_STYLE_OPTIONS=/projects/dbl_pnr_/tools/astyle/etc/astylerc
# ----------------- #
# Terminal settings #
# ----------------- #
### Prompt
# Default prompt is set to '[username@host] /current/directory >'
# Prompt is also underlined to help locate it easily
# OLDPROMPT='%U[%n@%m] %~%u >'
# alias oldprompt="export PS1=\"$OLDPROMPT\"; export RPS1='%T'"
# Nicer prompt with colours, the colour of the hostname being different on Sun
# and HP machines
export PS1='%{%}%T %{%}%n%{%}@%{%}%m %{%}%~%{%}>%{%} '
unset RPS1
#
# Key bindings
#
### -- HOME
bindkey "\e[1~" beginning-of-line
### -- END
bindkey "\e[4~" end-of-line
### -- Ctrl + Left Arrow
bindkey "\eOD" backward-word
### -- Ctrl + Right Arrow
bindkey "\eOC" forward-word
### -- DEL
bindkey "\e[3~" delete-char
### -- Shift + Tab. cycle completion list in reverse order
bindkey '' reverse-menu-complete
### -- Ctrl+SPACE: history completion (backward)
bindkey "^@" history-beginning-search-backward
### -- Ctrl+Z: history completion (forward)
bindkey "^Z" history-beginning-search-forward
### -- PageUp: history completion (backward from the end)
bindkey '[5~' history-search-backward
### -- PageDown: history completion (forward from the end)
bindkey '[6~' history-search-forward
# ---- #
# Misc #
# ---- #
# Ctrl+D is the same as logout
unsetopt ignore_eof
# Specific USER home environment settings
# ---------------------------------------
#if [ -f ~/.zshrc.$LOGNAME ]
#then
# . ~/.zshrc.$LOGNAME
#fi
if [ -f ~/.zshrc.user ]
then
. ~/.zshrc.user
fi
#export TERM="xterm-256color"
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# 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.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="dieter"
# 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.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# 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"
# 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/*)
# 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.
plugins=(python git)
source $ZSH/oh-my-zsh.sh
# Check for updates on initial load...
if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then
env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f $ZSH/tools/check_for_upgrade.sh
fi
# Initializes Oh My Zsh
# add a function path
fpath=($ZSH/functions $ZSH/completions $fpath)
# Load all stock functions (from $fpath files) called below.
autoload -U compaudit compinit
: ${ZSH_DISABLE_COMPFIX:=true}
# Set ZSH_CUSTOM to the path where your custom config files
# and plugins exists, or else we will use the default custom/
if [[ -z "$ZSH_CUSTOM" ]]; then
ZSH_CUSTOM="$ZSH/custom"
fi
# Set ZSH_CACHE_DIR to the path where cache files should be created
# or else we will use the default cache/
if [[ -z "$ZSH_CACHE_DIR" ]]; then
ZSH_CACHE_DIR="$ZSH/cache"
fi
# Load all of the config files in ~/oh-my-zsh that end in .zsh
# TIP: Add files you don't want in git to .gitignore
for config_file ($ZSH/lib/*.zsh); do
custom_config_file="${ZSH_CUSTOM}/lib/${config_file:t}"
[ -f "${custom_config_file}" ] && config_file=${custom_config_file}
source $config_file
done
## Bazaar integration
## Just works with the GIT integration just add $(bzr_prompt_info) to the PROMPT
function bzr_prompt_info() {
BZR_CB=`bzr nick 2> /dev/null | grep -v "ERROR" | cut -d ":" -f2 | awk -F / '{print "bzr::"$1}'`
if [ -n "$BZR_CB" ]; then
BZR_DIRTY=""
[[ -n `bzr status` ]] && BZR_DIRTY=" %{$fg[red]%} * %{$fg[green]%}"
echo "$ZSH_THEME_SCM_PROMPT_PREFIX$BZR_CB$BZR_DIRTY$ZSH_THEME_GIT_PROMPT_SUFFIX"
fi
}# System clipboard integration
#
# This file has support for doing system clipboard copy and paste operations
# from the command line in a generic cross-platform fashion.
#
# On OS X and Windows, the main system clipboard or "pasteboard" is used. On other
# Unix-like OSes, this considers the X Windows CLIPBOARD selection to be the
# "system clipboard", and the X Windows `xclip` command must be installed.
# clipcopy - Copy data to clipboard
#
# Usage:
#
# <command> | clipcopy - copies stdin to clipboard
#
# clipcopy <file> - copies a file's contents to clipboard
#
function clipcopy() {
emulate -L zsh
local file=$1
if [[ $OSTYPE == darwin* ]]; then
if [[ -z $file ]]; then
pbcopy
else
cat $file | pbcopy
fi
elif [[ $OSTYPE == cygwin* ]]; then
if [[ -z $file ]]; then
cat > /dev/clipboard
else
cat $file > /dev/clipboard
fi
else
if (( $+commands[xclip] )); then
if [[ -z $file ]]; then
xclip -in -selection clipboard
else
xclip -in -selection clipboard $file
fi
elif (( $+commands[xsel] )); then
if [[ -z $file ]]; then
xsel --clipboard --input
else
cat "$file" | xsel --clipboard --input
fi
else
print "clipcopy: Platform $OSTYPE not supported or xclip/xsel not installed" >&2
return 1
fi
fi
}
# clippaste - "Paste" data from clipboard to stdout
#
# Usage:
#
# clippaste - writes clipboard's contents to stdout
#
# clippaste | <command> - pastes contents and pipes it to another process
#
# clippaste > <file> - paste contents to a file
#
# Examples:
#
# # Pipe to another process
# clippaste | grep foo
#
# # Paste to a file
# clippaste > file.txt
function clippaste() {
emulate -L zsh
if [[ $OSTYPE == darwin* ]]; then
pbpaste
elif [[ $OSTYPE == cygwin* ]]; then
cat /dev/clipboard
else
if (( $+commands[xclip] )); then
xclip -out -selection clipboard
elif (( $+commands[xsel] )); then
xsel --clipboard --output
else
print "clipcopy: Platform $OSTYPE not supported or xclip/xsel not installed" >&2
return 1
fi
fi
}
# Handle completions insecurities (i.e., completion-dependent directories with
# insecure ownership or permissions) by:
#
# * Human-readably notifying the user of these insecurities.
# * Moving away all existing completion caches to a temporary directory. Since
# any of these caches may have been generated from insecure directories, they
# are all suspect now. Failing to do so typically causes subsequent compinit()
# calls to fail with "command not found: compdef" errors. (That's bad.)
function handle_completion_insecurities() {
# List of the absolute paths of all unique insecure directories, split on
# newline from compaudit()'s output resembling:
#
# There are insecure directories:
# /usr/share/zsh/site-functions
# /usr/share/zsh/5.0.6/functions
# /usr/share/zsh
# /usr/share/zsh/5.0.6
#
# Since the ignorable first line is printed to stderr and thus not captured,
# stderr is squelched to prevent this output from leaking to the user.
local -aU insecure_dirs
insecure_dirs=( ${(f@):-"$(compaudit 2>/dev/null)"} )
# If no such directories exist, get us out of here.
if (( ! ${#insecure_dirs} )); then
print "[oh-my-zsh] No insecure completion-dependent directories detected."
return
fi
# List ownership and permissions of all insecure directories.
print "[oh-my-zsh] Insecure completion-dependent directories detected:"
ls -ld "${(@)insecure_dirs}"
print "[oh-my-zsh] For safety, completions will be disabled until you manually fix all"
print "[oh-my-zsh] insecure directory permissions and ownership and restart oh-my-zsh."
print "[oh-my-zsh] See the above list for directories with group or other writability.\n"
# Locally enable the "NULL_GLOB" option, thus removing unmatched filename
# globs from argument lists *AND* printing no warning when doing so. Failing
# to do so prints an unreadable warning if no completion caches exist below.
setopt local_options null_glob
# List of the absolute paths of all unique existing completion caches.
local -aU zcompdump_files
zcompdump_files=( "${ZSH_COMPDUMP}"(.) "${ZDOTDIR:-${HOME}}"/.zcompdump* )
# Move such caches to a temporary directory.
if (( ${#zcompdump_files} )); then
# Absolute path of the directory to which such files will be moved.
local ZSH_ZCOMPDUMP_BAD_DIR="${ZSH_CACHE_DIR}/zcompdump-bad"
# List such files first.
print "[oh-my-zsh] Insecure completion caches also detected:"
ls -l "${(@)zcompdump_files}"
# For safety, move rather than permanently remove such files.
print "[oh-my-zsh] Moving to \"${ZSH_ZCOMPDUMP_BAD_DIR}/\"...\n"
mkdir -p "${ZSH_ZCOMPDUMP_BAD_DIR}"
mv "${(@)zcompdump_files}" "${ZSH_ZCOMPDUMP_BAD_DIR}/"
fi
}
# fixme - the load process here seems a bit bizarre
zmodload -i zsh/complist
WORDCHARS=''
unsetopt menu_complete # do not autoselect the first completion entry
unsetopt flowcontrol
setopt auto_menu # show completion menu on successive tab press
setopt complete_in_word
setopt always_to_end
# should this be in keybindings?
bindkey -M menuselect '^o' accept-and-infer-next-history
zstyle ':completion:*:*:*:*:*' menu select
# case insensitive (all), partial-word and substring completion
if [[ "$CASE_SENSITIVE" = true ]]; then
zstyle ':completion:*' matcher-list 'r:|=*' 'l:|=* r:|=*'
else
if [[ "$HYPHEN_INSENSITIVE" = true ]]; then
zstyle ':completion:*' matcher-list 'm:{a-zA-Z-_}={A-Za-z_-}' 'r:|=*' 'l:|=* r:|=*'
else
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*'
fi
fi
unset CASE_SENSITIVE HYPHEN_INSENSITIVE
zstyle ':completion:*' list-colors ''
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
if [[ "$OSTYPE" = solaris* ]]; then
zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm"
else
zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm -w -w"
fi
# disable named-directories autocompletion
zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
# Use caching so that commands like apt and dpkg complete are useable
zstyle ':completion::complete:*' use-cache 1
zstyle ':completion::complete:*' cache-path $ZSH_CACHE_DIR
# Don't complete uninteresting users
zstyle ':completion:*:*:*:users' ignored-patterns \
adm amanda apache at avahi avahi-autoipd beaglidx bin cacti canna \
clamav daemon dbus distcache dnsmasq dovecot fax ftp games gdm \
gkrellmd gopher hacluster haldaemon halt hsqldb ident junkbust kdm \
ldap lp mail mailman mailnull man messagebus mldonkey mysql nagios \
named netdump news nfsnobody nobody nscd ntp nut nx obsrun openvpn \
operator pcap polkitd postfix postgres privoxy pulse pvm quagga radvd \
rpc rpcuser rpm rtkit scard shutdown squid sshd statd svn sync tftp \
usbmux uucp vcsa wwwrun xfs '_*'
# ... unless we really want to.
zstyle '*' single-ignored show
if [[ $COMPLETION_WAITING_DOTS = true ]]; then
expand-or-complete-with-dots() {
# toggle line-wrapping off and back on again
[[ -n "$terminfo[rmam]" && -n "$terminfo[smam]" ]] && echoti rmam
print -Pn "%{%F{red}......%f%}"
[[ -n "$terminfo[rmam]" && -n "$terminfo[smam]" ]] && echoti smam
zle expand-or-complete
zle redisplay
}
zle -N expand-or-complete-with-dots
bindkey "^I" expand-or-complete-with-dots
fi
if [[ "$ENABLE_CORRECTION" == "true" ]]; then
alias ebuild='nocorrect ebuild'
alias gist='nocorrect gist'
alias heroku='nocorrect heroku'
alias hpodder='nocorrect hpodder'
alias man='nocorrect man'
alias mkdir='nocorrect mkdir'
alias mv='nocorrect mv'
alias mysql='nocorrect mysql'
alias sudo='nocorrect sudo'
setopt correct_all
fi
# diagnostics.zsh
#
# Diagnostic and debugging support for oh-my-zsh
# omz_diagnostic_dump()
#
# Author: Andrew Janke <andrew@apjanke.net>
#
# Usage:
#
# omz_diagnostic_dump [-v] [-V] [file]
#
# NOTE: This is a work in progress. Its interface and behavior are going to change,
# and probably in non-back-compatible ways.
#
# Outputs a bunch of information about the state and configuration of
# oh-my-zsh, zsh, and the user's system. This is intended to provide a
# bunch of context for diagnosing your own or a third party's problems, and to
# be suitable for posting to public bug reports.
#
# The output is human-readable and its format may change over time. It is not
# suitable for parsing. All the output is in one single file so it can be posted
# as a gist or bug comment on GitHub. GitHub doesn't support attaching tarballs
# or other files to bugs; otherwise, this would probably have an option to produce
# tarballs that contain copies of the config and customization files instead of
# catting them all in to one file.
#
# This is intended to be widely portable, and run anywhere that oh-my-zsh does.
# Feel free to report any portability issues as bugs.
#
# This is written in a defensive style so it still works (and can detect) cases when
# basic functionality like echo and which have been redefined. In particular, almost
# everything is invoked with "builtin" or "command", to work in the face of user
# redefinitions.
#
# OPTIONS
#
# [file] Specifies the output file. If not given, a file in the current directory
# is selected automatically.
#
# -v Increase the verbosity of the dump output. May be specified multiple times.
# Verbosity levels:
# 0 - Basic info, shell state, omz configuration, git state
# 1 - (default) Adds key binding info and configuration file contents
# 2 - Adds zcompdump file contents
#
# -V Reduce the verbosity of the dump output. May be specified multiple times.
#
# TODO:
# * Multi-file capture
# * Add automatic gist uploading
# * Consider whether to move default output file location to TMPDIR. More robust
# but less user friendly.
#
autoload -Uz is-at-least
function omz_diagnostic_dump() {
emulate -L zsh
builtin echo "Generating diagnostic dump; please be patient..."
local thisfcn=omz_diagnostic_dump
local -A opts
local opt_verbose opt_noverbose opt_outfile
local timestamp=$(date +%Y%m%d-%H%M%S)
local outfile=omz_diagdump_$timestamp.txt
builtin zparseopts -A opts -D -- "v+=opt_verbose" "V+=opt_noverbose"
local verbose n_verbose=${#opt_verbose} n_noverbose=${#opt_noverbose}
(( verbose = 1 + n_verbose - n_noverbose ))
if [[ ${#*} > 0 ]]; then
opt_outfile=$1
fi
if [[ ${#*} > 1 ]]; then
builtin echo "$thisfcn: error: too many arguments" >&2
return 1
fi
if [[ -n "$opt_outfile" ]]; then
outfile="$opt_outfile"
fi
# Always write directly to a file so terminal escape sequences are
# captured cleanly
_omz_diag_dump_one_big_text &> "$outfile"
if [[ $? != 0 ]]; then
builtin echo "$thisfcn: error while creating diagnostic dump; see $outfile for details"
fi
builtin echo
builtin echo Diagnostic dump file created at: "$outfile"
builtin echo
builtin echo To share this with OMZ developers, post it as a gist on GitHub
builtin echo at "https://gist.github.com" and share the link to the gist.
builtin echo
builtin echo "WARNING: This dump file contains all your zsh and omz configuration files,"
builtin echo "so don't share it publicly if there's sensitive information in them."
builtin echo
}
function _omz_diag_dump_one_big_text() {
local program programs progfile md5
builtin echo oh-my-zsh diagnostic dump
builtin echo
builtin echo $outfile
builtin echo
# Basic system and zsh information
command date
command uname -a
builtin echo OSTYPE=$OSTYPE
builtin echo ZSH_VERSION=$ZSH_VERSION
builtin echo User: $USER
builtin echo umask: $(umask)
builtin echo
_omz_diag_dump_os_specific_version
builtin echo
# Installed programs
programs=(sh zsh ksh bash sed cat grep ls find git posh)
local progfile="" extra_str="" sha_str=""
for program in $programs; do
extra_str="" sha_str=""
progfile=$(builtin which $program)
if [[ $? == 0 ]]; then
if [[ -e $progfile ]]; then
if builtin whence shasum &>/dev/null; then
sha_str=($(command shasum $progfile))
sha_str=$sha_str[1]
extra_str+=" SHA $sha_str"
fi
if [[ -h "$progfile" ]]; then
extra_str+=" ( -> ${progfile:A} )"
fi
fi
builtin printf '%-9s %-20s %s\n' "$program is" "$progfile" "$extra_str"
else
builtin echo "$program: not found"
fi
done
builtin echo
builtin echo Command Versions:
builtin echo "zsh: $(zsh --version)"
builtin echo "this zsh session: $ZSH_VERSION"
builtin echo "bash: $(bash --version | command grep bash)"
builtin echo "git: $(git --version)"
builtin echo "grep: $(grep --version)"
builtin echo
# Core command definitions
_omz_diag_dump_check_core_commands || return 1
builtin echo
# ZSH Process state
builtin echo Process state:
builtin echo pwd: $PWD
if builtin whence pstree &>/dev/null; then
builtin echo Process tree for this shell:
pstree -p $$
else
ps -fT
fi
builtin set | command grep -a '^\(ZSH\|plugins\|TERM\|LC_\|LANG\|precmd\|chpwd\|preexec\|FPATH\|TTY\|DISPLAY\|PATH\)\|OMZ'
builtin echo
#TODO: Should this include `env` instead of or in addition to `export`?
builtin echo Exported:
builtin echo $(builtin export | command sed 's/=.*//')
builtin echo
builtin echo Locale:
command locale
builtin echo
# Zsh installation and configuration
builtin echo Zsh configuration:
builtin echo setopt: $(builtin setopt)
builtin echo
builtin echo zstyle:
builtin zstyle
builtin echo
builtin echo 'compaudit output:'
compaudit
builtin echo
builtin echo '$fpath directories:'
command ls -lad $fpath
builtin echo
# Oh-my-zsh installation
builtin echo oh-my-zsh installation:
command ls -ld ~/.z*
command ls -ld ~/.oh*
builtin echo
builtin echo oh-my-zsh git state:
(cd $ZSH && builtin echo "HEAD: $(git rev-parse HEAD)" && git remote -v && git status | command grep "[^[:space:]]")
if [[ $verbose -ge 1 ]]; then
(cd $ZSH && git reflog --date=default | command grep pull)
fi
builtin echo
if [[ -e $ZSH_CUSTOM ]]; then
local custom_dir=$ZSH_CUSTOM
if [[ -h $custom_dir ]]; then
custom_dir=$(cd $custom_dir && pwd -P)
fi
builtin echo "oh-my-zsh custom dir:"
builtin echo " $ZSH_CUSTOM ($custom_dir)"
(cd ${custom_dir:h} && command find ${custom_dir:t} -name .git -prune -o -print)
builtin echo
fi
# Key binding and terminal info
if [[ $verbose -ge 1 ]]; then
builtin echo "bindkey:"
builtin bindkey
builtin echo
builtin echo "infocmp:"
command infocmp -L
builtin echo
fi
# Configuration file info
local zdotdir=${ZDOTDIR:-$HOME}
builtin echo "Zsh configuration files:"
local cfgfile cfgfiles
# Some files for bash that zsh does not use are intentionally included
# to help with diagnosing behavior differences between bash and zsh
cfgfiles=( /etc/zshenv /etc/zprofile /etc/zshrc /etc/zlogin /etc/zlogout
$zdotdir/.zshenv $zdotdir/.zprofile $zdotdir/.zshrc $zdotdir/.zlogin $zdotdir/.zlogout
~/.zsh.pre-oh-my-zsh
/etc/bashrc /etc/profile ~/.bashrc ~/.profile ~/.bash_profile ~/.bash_logout )
command ls -lad $cfgfiles 2>&1
builtin echo
if [[ $verbose -ge 1 ]]; then
for cfgfile in $cfgfiles; do
_omz_diag_dump_echo_file_w_header $cfgfile
done
fi
builtin echo
builtin echo "Zsh compdump files:"
local dumpfile dumpfiles
command ls -lad $zdotdir/.zcompdump*
dumpfiles=( $zdotdir/.zcompdump*(N) )
if [[ $verbose -ge 2 ]]; then
for dumpfile in $dumpfiles; do
_omz_diag_dump_echo_file_w_header $dumpfile
done
fi
}
function _omz_diag_dump_check_core_commands() {
builtin echo "Core command check:"
local redefined name builtins externals reserved_words
redefined=()
# All the zsh non-module builtin commands
# These are taken from the zsh reference manual for 5.0.2
# Commands from modules should not be included.
# (For back-compatibility, if any of these are newish, they should be removed,
# or at least made conditional on the version of the current running zsh.)
# "history" is also excluded because OMZ is known to redefine that
reserved_words=( do done esac then elif else fi for case if while function
repeat time until select coproc nocorrect foreach end '!' '[[' '{' '}'
)
builtins=( alias autoload bg bindkey break builtin bye cd chdir command
comparguments compcall compctl compdescribe compfiles compgroups compquote comptags
comptry compvalues continue dirs disable disown echo echotc echoti emulate
enable eval exec exit false fc fg functions getln getopts hash
jobs kill let limit log logout noglob popd print printf
pushd pushln pwd r read rehash return sched set setopt shift
source suspend test times trap true ttyctl type ulimit umask unalias
unfunction unhash unlimit unset unsetopt vared wait whence where which zcompile
zle zmodload zparseopts zregexparse zstyle )
if is-at-least 5.1; then
reserved_word+=( declare export integer float local readonly typeset )
else
builtins+=( declare export integer float local readonly typeset )
fi
builtins_fatal=( builtin command local )
externals=( zsh )
for name in $reserved_words; do
if [[ $(builtin whence -w $name) != "$name: reserved" ]]; then
builtin echo "reserved word '$name' has been redefined"
builtin which $name
redefined+=$name
fi
done
for name in $builtins; do
if [[ $(builtin whence -w $name) != "$name: builtin" ]]; then
builtin echo "builtin '$name' has been redefined"
builtin which $name
redefined+=$name
fi
done
for name in $externals; do
if [[ $(builtin whence -w $name) != "$name: command" ]]; then
builtin echo "command '$name' has been redefined"
builtin which $name
redefined+=$name
fi
done
if [[ -n "$redefined" ]]; then
builtin echo "SOME CORE COMMANDS HAVE BEEN REDEFINED: $redefined"
else
builtin echo "All core commands are defined normally"
fi
}
function _omz_diag_dump_echo_file_w_header() {
local file=$1
if [[ ( -f $file || -h $file ) ]]; then
builtin echo "========== $file =========="
if [[ -h $file ]]; then
builtin echo "========== ( => ${file:A} ) =========="
fi
command cat $file
builtin echo "========== end $file =========="
builtin echo
elif [[ -d $file ]]; then
builtin echo "File '$file' is a directory"
elif [[ ! -e $file ]]; then
builtin echo "File '$file' does not exist"
else
command ls -lad "$file"
fi
}
function _omz_diag_dump_os_specific_version() {
local osname osver version_file version_files
case "$OSTYPE" in
darwin*)
osname=$(command sw_vers -productName)
osver=$(command sw_vers -productVersion)
builtin echo "OS Version: $osname $osver build $(sw_vers -buildVersion)"
;;
cygwin)
command systeminfo | command head -4 | command tail -2
;;
esac
if builtin which lsb_release >/dev/null; then
builtin echo "OS Release: $(command lsb_release -s -d)"
fi
version_files=( /etc/*-release(N) /etc/*-version(N) /etc/*_version(N) )
for version_file in $version_files; do
builtin echo "$version_file:"
command cat "$version_file"
builtin echo
done
}
# Changing/making/removing directory
setopt auto_pushd
setopt pushd_ignore_dups
setopt pushdminus
alias -g ...='../..'
alias -g ....='../../..'
alias -g .....='../../../..'
alias -g ......='../../../../..'
alias -- -='cd -'
alias 1='cd -'
alias 2='cd -2'
alias 3='cd -3'
alias 4='cd -4'
alias 5='cd -5'
alias 6='cd -6'
alias 7='cd -7'
alias 8='cd -8'
alias 9='cd -9'
alias md='mkdir -p'
alias rd=rmdir
alias d='dirs -v | head -10'
# List directory contents
alias lsa='ls -lah'
alias l='ls -lah'
alias ll='ls -lh'
alias la='ls -lAh'
# Push and pop directories on directory stack
alias pu='pushd'
alias po='popd'
function zsh_stats() {
fc -l 1 | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20
}
function uninstall_oh_my_zsh() {
env ZSH=$ZSH sh $ZSH/tools/uninstall.sh
}
function upgrade_oh_my_zsh() {
env ZSH=$ZSH sh $ZSH/tools/upgrade.sh
}
function take() {
mkdir -p $1
cd $1
}
function open_command() {
emulate -L zsh
setopt shwordsplit
local open_cmd
# define the open command
case "$OSTYPE" in
darwin*) open_cmd='open' ;;
cygwin*) open_cmd='cygstart' ;;
linux*) open_cmd='xdg-open' ;;
msys*) open_cmd='start ""' ;;
*) echo "Platform $OSTYPE not supported"
return 1
;;
esac
# don't use nohup on OSX
if [[ "$OSTYPE" == darwin* ]]; then
$open_cmd "$@" &>/dev/null
else
nohup $open_cmd "$@" &>/dev/null
fi
}
#
# Get the value of an alias.
#
# Arguments:
# 1. alias - The alias to get its value from
# STDOUT:
# The value of alias $1 (if it has one).
# Return value:
# 0 if the alias was found,
# 1 if it does not exist
#
function alias_value() {
alias "$1" | sed "s/^$1='\(.*\)'$/\1/"
test $(alias "$1")
}
#
# Try to get the value of an alias,
# otherwise return the input.
#
# Arguments:
# 1. alias - The alias to get its value from
# STDOUT:
# The value of alias $1, or $1 if there is no alias $1.
# Return value:
# Always 0
#
function try_alias_value() {
alias_value "$1" || echo "$1"
}
#
# Set variable "$1" to default value "$2" if "$1" is not yet defined.
#
# Arguments:
# 1. name - The variable to set
# 2. val - The default value
# Return value:
# 0 if the variable exists, 3 if it was set
#
function default() {
test `typeset +m "$1"` && return 0
typeset -g "$1"="$2" && return 3
}
#
# Set environment variable "$1" to default value "$2" if "$1" is not yet defined.
#
# Arguments:
# 1. name - The env variable to set
# 2. val - The default value
# Return value:
# 0 if the env variable exists, 3 if it was set
#
function env_default() {
env | grep -q "^$1=" && return 0
export "$1=$2" && return 3
}
# Required for $langinfo
zmodload zsh/langinfo
# URL-encode a string
#
# Encodes a string using RFC 2396 URL-encoding (%-escaped).
# See: https://www.ietf.org/rfc/rfc2396.txt
#
# By default, reserved characters and unreserved "mark" characters are
# not escaped by this function. This allows the common usage of passing
# an entire URL in, and encoding just special characters in it, with
# the expectation that reserved and mark characters are used appropriately.
# The -r and -m options turn on escaping of the reserved and mark characters,
# respectively, which allows arbitrary strings to be fully escaped for
# embedding inside URLs, where reserved characters might be misinterpreted.
#
# Prints the encoded string on stdout.
# Returns nonzero if encoding failed.
#
# Usage:
# omz_urlencode [-r] [-m] [-P] <string>
#
# -r causes reserved characters (;/?:@&=+$,) to be escaped
#
# -m causes "mark" characters (_.!~*''()-) to be escaped
#
# -P causes spaces to be encoded as '%20' instead of '+'
function omz_urlencode() {
emulate -L zsh
zparseopts -D -E -a opts r m P
local in_str=$1
local url_str=""
local spaces_as_plus
if [[ -z $opts[(r)-P] ]]; then spaces_as_plus=1; fi
local str="$in_str"
# URLs must use UTF-8 encoding; convert str to UTF-8 if required
local encoding=$langinfo[CODESET]
local safe_encodings
safe_encodings=(UTF-8 utf8 US-ASCII)
if [[ -z ${safe_encodings[(r)$encoding]} ]]; then
str=$(echo -E "$str" | iconv -f $encoding -t UTF-8)
if [[ $? != 0 ]]; then
echo "Error converting string from $encoding to UTF-8" >&2
return 1
fi
fi
# Use LC_CTYPE=C to process text byte-by-byte
local i byte ord LC_ALL=C
export LC_ALL
local reserved=';/?:@&=+$,'
local mark='_.!~*''()-'
local dont_escape="[A-Za-z0-9"
if [[ -z $opts[(r)-r] ]]; then
dont_escape+=$reserved
fi
# $mark must be last because of the "-"
if [[ -z $opts[(r)-m] ]]; then
dont_escape+=$mark
fi
dont_escape+="]"
# Implemented to use a single printf call and avoid subshells in the loop,
# for performance (primarily on Windows).
local url_str=""
for (( i = 1; i <= ${#str}; ++i )); do
byte="$str[i]"
if [[ "$byte" =~ "$dont_escape" ]]; then
url_str+="$byte"
else
if [[ "$byte" == " " && -n $spaces_as_plus ]]; then
url_str+="+"
else
ord=$(( [##16] #byte ))
url_str+="%$ord"
fi
fi
done
echo -E "$url_str"
}
# URL-decode a string
#
# Decodes a RFC 2396 URL-encoded (%-escaped) string.
# This decodes the '+' and '%' escapes in the input string, and leaves
# other characters unchanged. Does not enforce that the input is a
# valid URL-encoded string. This is a convenience to allow callers to
# pass in a full URL or similar strings and decode them for human
# presentation.
#
# Outputs the encoded string on stdout.
# Returns nonzero if encoding failed.
#
# Usage:
# omz_urldecode <urlstring> - prints decoded string followed by a newline
function omz_urldecode {
emulate -L zsh
local encoded_url=$1
# Work bytewise, since URLs escape UTF-8 octets
local caller_encoding=$langinfo[CODESET]
local LC_ALL=C
export LC_ALL
# Change + back to ' '
local tmp=${encoded_url:gs/+/ /}
# Protect other escapes to pass through the printf unchanged
tmp=${tmp:gs/\\/\\\\/}
# Handle %-escapes by turning them into `\xXX` printf escapes
tmp=${tmp:gs/%/\\x/}
local decoded
eval "decoded=\$'$tmp'"
# Now we have a UTF-8 encoded string in the variable. We need to re-encode
# it if caller is in a non-UTF-8 locale.
local safe_encodings
safe_encodings=(UTF-8 utf8 US-ASCII)
if [[ -z ${safe_encodings[(r)$caller_encoding]} ]]; then
decoded=$(echo -E "$decoded" | iconv -f UTF-8 -t $caller_encoding)
if [[ $? != 0 ]]; then
echo "Error converting string from UTF-8 to $caller_encoding" >&2
return 1
fi
fi
echo -E "$decoded"
}
# Outputs current branch info in prompt format
function git_prompt_info() {
local ref
if [[ "$(command git config --get oh-my-zsh.hide-status 2>/dev/null)" != "1" ]]; then
ref=$(command git symbolic-ref HEAD 2> /dev/null) || \
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return 0
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
fi
}
# Checks if working tree is dirty
function parse_git_dirty() {
local STATUS=''
local -a FLAGS
FLAGS=('--porcelain')
if [[ "$(command git config --get oh-my-zsh.hide-dirty)" != "1" ]]; then
if [[ $POST_1_7_2_GIT -gt 0 ]]; then
FLAGS+='--ignore-submodules=dirty'
fi
if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" == "true" ]]; then
FLAGS+='--untracked-files=no'
fi
STATUS=$(command git status ${FLAGS} 2> /dev/null | tail -n1)
fi
if [[ -n $STATUS ]]; then
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
else
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
fi
}
# Gets the difference between the local and remote branches
function git_remote_status() {
local remote ahead behind git_remote_status git_remote_status_detailed
remote=${$(command git rev-parse --verify ${hook_com[branch]}@{upstream} --symbolic-full-name 2>/dev/null)/refs\/remotes\/}
if [[ -n ${remote} ]]; then
ahead=$(command git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)
behind=$(command git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
if [[ $ahead -eq 0 ]] && [[ $behind -eq 0 ]]; then
git_remote_status="$ZSH_THEME_GIT_PROMPT_EQUAL_REMOTE"
elif [[ $ahead -gt 0 ]] && [[ $behind -eq 0 ]]; then
git_remote_status="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE"
git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}"
elif [[ $behind -gt 0 ]] && [[ $ahead -eq 0 ]]; then
git_remote_status="$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE"
git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}"
elif [[ $ahead -gt 0 ]] && [[ $behind -gt 0 ]]; then
git_remote_status="$ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE"
git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}"
fi
if [[ -n $ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_DETAILED ]]; then
git_remote_status="$ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_PREFIX$remote$git_remote_status_detailed$ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_SUFFIX"
fi
echo $git_remote_status
fi
}
# Outputs the name of the current branch
# Usage example: git pull origin $(git_current_branch)
# Using '--quiet' with 'symbolic-ref' will not cause a fatal error (128) if
# it's not a symbolic ref, but in a Git repo.
function git_current_branch() {
local ref
ref=$(command git symbolic-ref --quiet HEAD 2> /dev/null)
local ret=$?
if [[ $ret != 0 ]]; then
[[ $ret == 128 ]] && return # no git repo.
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
fi
echo ${ref#refs/heads/}
}
# Gets the number of commits ahead from remote
function git_commits_ahead() {
if command git rev-parse --git-dir &>/dev/null; then
local commits="$(git rev-list --count @{upstream}..HEAD)"
if [[ "$commits" != 0 ]]; then
echo "$ZSH_THEME_GIT_COMMITS_AHEAD_PREFIX$commits$ZSH_THEME_GIT_COMMITS_AHEAD_SUFFIX"
fi
fi
}
# Gets the number of commits behind remote
function git_commits_behind() {
if command git rev-parse --git-dir &>/dev/null; then
local commits="$(git rev-list --count HEAD..@{upstream})"
if [[ "$commits" != 0 ]]; then
echo "$ZSH_THEME_GIT_COMMITS_BEHIND_PREFIX$commits$ZSH_THEME_GIT_COMMITS_BEHIND_SUFFIX"
fi
fi
}
# Outputs if current branch is ahead of remote
function git_prompt_ahead() {
if [[ -n "$(command git rev-list origin/$(git_current_branch)..HEAD 2> /dev/null)" ]]; then
echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
fi
}
# Outputs if current branch is behind remote
function git_prompt_behind() {
if [[ -n "$(command git rev-list HEAD..origin/$(git_current_branch) 2> /dev/null)" ]]; then
echo "$ZSH_THEME_GIT_PROMPT_BEHIND"
fi
}
# Outputs if current branch exists on remote or not
function git_prompt_remote() {
if [[ -n "$(command git show-ref origin/$(git_current_branch) 2> /dev/null)" ]]; then
echo "$ZSH_THEME_GIT_PROMPT_REMOTE_EXISTS"
else
echo "$ZSH_THEME_GIT_PROMPT_REMOTE_MISSING"
fi
}
# Formats prompt string for current git commit short SHA
function git_prompt_short_sha() {
local SHA
SHA=$(command git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
}
# Formats prompt string for current git commit long SHA
function git_prompt_long_sha() {
local SHA
SHA=$(command git rev-parse HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
}
# Get the status of the working tree
function git_prompt_status() {
local INDEX STATUS
INDEX=$(command git status --porcelain -b 2> /dev/null)
STATUS=""
if $(echo "$INDEX" | command grep -E '^\?\? ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
fi
if $(echo "$INDEX" | grep '^A ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
elif $(echo "$INDEX" | grep '^M ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
fi
if $(echo "$INDEX" | grep '^ M ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
elif $(echo "$INDEX" | grep '^AM ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
elif $(echo "$INDEX" | grep '^ T ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
fi
if $(echo "$INDEX" | grep '^R ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_RENAMED$STATUS"
fi
if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
elif $(echo "$INDEX" | grep '^D ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
elif $(echo "$INDEX" | grep '^AD ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
fi
if $(command git rev-parse --verify refs/stash >/dev/null 2>&1); then
STATUS="$ZSH_THEME_GIT_PROMPT_STASHED$STATUS"
fi
if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
fi
if $(echo "$INDEX" | grep '^## [^ ]\+ .*ahead' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_AHEAD$STATUS"
fi
if $(echo "$INDEX" | grep '^## [^ ]\+ .*behind' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_BEHIND$STATUS"
fi
if $(echo "$INDEX" | grep '^## [^ ]\+ .*diverged' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DIVERGED$STATUS"
fi
echo $STATUS
}
# Compares the provided version of git to the version installed and on path
# Outputs -1, 0, or 1 if the installed version is less than, equal to, or
# greater than the input version, respectively.
function git_compare_version() {
local INPUT_GIT_VERSION INSTALLED_GIT_VERSION
INPUT_GIT_VERSION=(${(s/./)1})
INSTALLED_GIT_VERSION=($(command git --version 2>/dev/null))
INSTALLED_GIT_VERSION=(${(s/./)INSTALLED_GIT_VERSION[3]})
for i in {1..3}; do
if [[ $INSTALLED_GIT_VERSION[$i] -gt $INPUT_GIT_VERSION[$i] ]]; then
echo 1
return 0
fi
if [[ $INSTALLED_GIT_VERSION[$i] -lt $INPUT_GIT_VERSION[$i] ]]; then
echo -1
return 0
fi
done
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
unfunction git_compare_version
# is x grep argument available?
grep-flag-available() {
echo | grep $1 "" >/dev/null 2>&1
}
GREP_OPTIONS=""
# color grep results
if grep-flag-available --color=auto; then
GREP_OPTIONS+=" --color=auto"
fi
# ignore VCS folders (if the necessary grep flags are available)
VCS_FOLDERS="{.bzr,CVS,.git,.hg,.svn}"
if grep-flag-available --exclude-dir=.cvs; then
GREP_OPTIONS+=" --exclude-dir=$VCS_FOLDERS"
elif grep-flag-available --exclude=.cvs; then
GREP_OPTIONS+=" --exclude=$VCS_FOLDERS"
fi
# export grep settings
alias grep="grep $GREP_OPTIONS"
# clean up
unset GREP_OPTIONS
unset VCS_FOLDERS
unfunction grep-flag-available
## Command history configuration
if [ -z "$HISTFILE" ]; then
HISTFILE=$HOME/.zsh_history
fi
HISTSIZE=10000
SAVEHIST=10000
# Show history
case $HIST_STAMPS in
"mm/dd/yyyy") alias history='fc -fl 1' ;;
"dd.mm.yyyy") alias history='fc -El 1' ;;
"yyyy-mm-dd") alias history='fc -il 1' ;;
*) alias history='fc -l 1' ;;
esac
setopt append_history
setopt extended_history
setopt hist_expire_dups_first
setopt hist_ignore_dups # ignore duplication command history list
setopt hist_ignore_space
setopt hist_verify
setopt inc_append_history
setopt share_history # share command history data
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Zle-Builtins
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Standard-Widgets
# Make sure that the terminal is in application mode when zle is active, since
# only then values from $terminfo are valid
if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
function zle-line-init() {
echoti smkx
}
function zle-line-finish() {
echoti rmkx
}
zle -N zle-line-init
zle -N zle-line-finish
fi
bindkey -e # Use emacs key bindings
bindkey '\ew' kill-region # [Esc-w] - Kill from the cursor to the mark
bindkey -s '\el' 'ls\n' # [Esc-l] - run command: ls
bindkey '^r' history-incremental-search-backward # [Ctrl-r] - Search backward incrementally for a specified string. The string may begin with ^ to anchor the search to the beginning of the line.
if [[ "${terminfo[kpp]}" != "" ]]; then
bindkey "${terminfo[kpp]}" up-line-or-history # [PageUp] - Up a line of history
fi
if [[ "${terminfo[knp]}" != "" ]]; then
bindkey "${terminfo[knp]}" down-line-or-history # [PageDown] - Down a line of history
fi
# start typing + [Up-Arrow] - fuzzy find history forward
if [[ "${terminfo[kcuu1]}" != "" ]]; then
autoload -U up-line-or-beginning-search
zle -N up-line-or-beginning-search
bindkey "${terminfo[kcuu1]}" up-line-or-beginning-search
fi
# start typing + [Down-Arrow] - fuzzy find history backward
if [[ "${terminfo[kcud1]}" != "" ]]; then
autoload -U down-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey "${terminfo[kcud1]}" down-line-or-beginning-search
fi
if [[ "${terminfo[khome]}" != "" ]]; then
bindkey "${terminfo[khome]}" beginning-of-line # [Home] - Go to beginning of line
fi
if [[ "${terminfo[kend]}" != "" ]]; then
bindkey "${terminfo[kend]}" end-of-line # [End] - Go to end of line
fi
bindkey ' ' magic-space # [Space] - do history expansion
bindkey '^[[1;5C' forward-word # [Ctrl-RightArrow] - move forward one word
bindkey '^[[1;5D' backward-word # [Ctrl-LeftArrow] - move backward one word
if [[ "${terminfo[kcbt]}" != "" ]]; then
bindkey "${terminfo[kcbt]}" reverse-menu-complete # [Shift-Tab] - move through the completion menu backwards
fi
bindkey '^?' backward-delete-char # [Backspace] - delete backward
if [[ "${terminfo[kdch1]}" != "" ]]; then
bindkey "${terminfo[kdch1]}" delete-char # [Delete] - delete forward
else
bindkey "^[[3~" delete-char
bindkey "^[3;5~" delete-char
bindkey "\e[3~" delete-char
fi
# Edit the current command line in $EDITOR
autoload -U edit-command-line
zle -N edit-command-line
bindkey '\C-x\C-e' edit-command-line
# file rename magick
bindkey "^[m" copy-prev-shell-word
# consider emacs keybindings:
#bindkey -e ## emacs key bindings
#
#bindkey '^[[A' up-line-or-search
#bindkey '^[[B' down-line-or-search
#bindkey '^[^[[C' emacs-forward-word
#bindkey '^[^[[D' emacs-backward-word
#
#bindkey -s '^X^Z' '%-^M'
#bindkey '^[e' expand-cmd-path
#bindkey '^[^I' reverse-menu-complete
#bindkey '^X^N' accept-and-infer-next-history
#bindkey '^W' kill-region
#bindkey '^I' complete-word
## Fix weird sequence that rxvt produces
#bindkey -s '^[[Z' '\t'
#
## Load smart urls if available
# bracketed-paste-magic is known buggy in zsh 5.1.1 (only), so skip it there; see #4434
autoload -Uz is-at-least
if [[ $ZSH_VERSION != 5.1.1 ]]; then
for d in $fpath; do
if [[ -e "$d/url-quote-magic" ]]; then
if is-at-least 5.1; then
autoload -Uz bracketed-paste-magic
zle -N bracketed-paste bracketed-paste-magic
fi
autoload -Uz url-quote-magic
zle -N self-insert url-quote-magic
break
fi
done
fi
## jobs
setopt long_list_jobs
## pager
env_default PAGER 'less'
env_default LESS '-R'
## super user alias
alias _='sudo'
alias please='sudo'
## more intelligent acking for ubuntu users
if which ack-grep &> /dev/null; then
alias afind='ack-grep -il'
else
alias afind='ack -il'
fi
# only define LC_CTYPE if undefined
if [[ -z "$LC_CTYPE" && -z "$LC_ALL" ]]; then
export LC_CTYPE=${LANG%%:*} # pick the first entry from LANG
fi
# recognize comments
setopt interactivecomments
# get the node.js version
function nvm_prompt_info() {
[[ -f "$NVM_DIR/nvm.sh" ]] || return
local nvm_prompt
nvm_prompt=$(node -v 2>/dev/null)
[[ "${nvm_prompt}x" == "x" ]] && return
nvm_prompt=${nvm_prompt:1}
echo "${ZSH_THEME_NVM_PROMPT_PREFIX}${nvm_prompt}${ZSH_THEME_NVM_PROMPT_SUFFIX}"
}
# *_prompt_info functions for usage in your prompt
#
# Plugin creators, please add your *_prompt_info function to the list
# of dummy implementations to help theme creators not receiving errors
# without the need of implementing conditional clauses.
#
# See also lib/bzr.zsh, lib/git.zsh and lib/nvm.zsh for
# git_prompt_info, bzr_prompt_info and nvm_prompt_info
# Dummy implementations that return false to prevent command_not_found
# errors with themes, that implement these functions
# Real implementations will be used when the respective plugins are loaded
function chruby_prompt_info hg_prompt_info pyenv_prompt_info \
rbenv_prompt_info svn_prompt_info vi_mode_prompt_info \
virtualenv_prompt_info {
return 1
}
# oh-my-zsh supports an rvm prompt by default
# get the name of the rvm ruby version
function rvm_prompt_info() {
[ -f $HOME/.rvm/bin/rvm-prompt ] || return 1
local rvm_prompt
rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${=ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null)
[[ "${rvm_prompt}x" == "x" ]] && return 1
echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
}
# use this to enable users to see their ruby version, no matter which
# version management system they use
function ruby_prompt_info() {
echo $(rvm_prompt_info || rbenv_prompt_info || chruby_prompt_info)
}
#! /bin/zsh
# A script to make using 256 colors in zsh less painful.
# P.C. Shyamshankar <sykora@lucentbeing.com>
# Copied from http://github.com/sykora/etc/blob/master/zsh/functions/spectrum/
typeset -AHg FX FG BG
FX=(
reset "%{%}"
bold "%{%}" no-bold "%{%}"
italic "%{%}" no-italic "%{%}"
underline "%{%}" no-underline "%{%}"
blink "%{%}" no-blink "%{%}"
reverse "%{%}" no-reverse "%{%}"
)
for color in {000..255}; do
FG[$color]="%{[38;5;${color}m%}"
BG[$color]="%{[48;5;${color}m%}"
done
ZSH_SPECTRUM_TEXT=${ZSH_SPECTRUM_TEXT:-Arma virumque cano Troiae qui primus ab oris}
# Show all 256 colors with color number
function spectrum_ls() {
for code in {000..255}; do
print -P -- "$code: %{$FG[$code]%}$ZSH_SPECTRUM_TEXT%{$reset_color%}"
done
}
# Show all 256 colors where the background is set to specific color
function spectrum_bls() {
for code in {000..255}; do
print -P -- "$code: %{$BG[$code]%}$ZSH_SPECTRUM_TEXT%{$reset_color%}"
done
}
# Set terminal window and tab/icon title
#
# usage: title short_tab_title [long_window_title]
#
# See: http://www.faqs.org/docs/Linux-mini/Xterm-Title.html#ss3.1
# Fully supports screen, iterm, and probably most modern xterm and rxvt
# (In screen, only short_tab_title is used)
# Limited support for Apple Terminal (Terminal can't set window and tab separately)
function title {
emulate -L zsh
setopt prompt_subst
[[ "$EMACS" == *term* ]] && return
# if $2 is unset use $1 as default
# if it is set and empty, leave it as is
: ${2=$1}
case "$TERM" in
cygwin|xterm*|putty*|rxvt*|ansi)
print -Pn "\e]2;$2:q\a" # set window name
print -Pn "\e]1;$1:q\a" # set tab name
;;
screen*)
print -Pn "\ek$1:q\e\\" # set screen hardstatus
;;
*)
if [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
print -Pn "\e]2;$2:q\a" # set window name
print -Pn "\e]1;$1:q\a" # set tab name
else
# Try to use terminfo to set the title
# If the feature is available set title
if [[ -n "$terminfo[fsl]" ]] && [[ -n "$terminfo[tsl]" ]]; then
echoti tsl
print -Pn "$1"
echoti fsl
fi
fi
;;
esac
}
ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD
ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~"
# Avoid duplication of directory in terminals with independent dir display
if [[ "$TERM_PROGRAM" == Apple_Terminal ]]; then
ZSH_THEME_TERM_TITLE_IDLE="%n@%m"
fi
# Runs before showing the prompt
function omz_termsupport_precmd {
emulate -L zsh
if [[ "$DISABLE_AUTO_TITLE" == true ]]; then
return
fi
title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE
}
# Runs before executing the command
function omz_termsupport_preexec {
emulate -L zsh
setopt extended_glob
if [[ "$DISABLE_AUTO_TITLE" == true ]]; then
return
fi
# cmd name only, or if this is sudo or ssh, the next cmd
local CMD=${1[(wr)^(*=*|sudo|ssh|mosh|rake|-*)]:gs/%/%%}
local LINE="${2:gs/%/%%}"
title '$CMD' '%100>...>$LINE%<<'
}
precmd_functions+=(omz_termsupport_precmd)
preexec_functions+=(omz_termsupport_preexec)
# Keep Apple Terminal.app's current working directory updated
# Based on this answer: http://superuser.com/a/315029
# With extra fixes to handle multibyte chars and non-UTF-8 locales
if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then
# Emits the control sequence to notify Terminal.app of the cwd
# Identifies the directory using a file: URI scheme, including
# the host name to disambiguate local vs. remote paths.
function update_terminalapp_cwd() {
emulate -L zsh
# Percent-encode the pathname.
local URL_PATH="$(omz_urlencode -P $PWD)"
[[ $? != 0 ]] && return 1
# Undocumented Terminal.app-specific control sequence
printf '\e]7;%s\a' "file://$HOST$URL_PATH"
}
# Use a precmd hook instead of a chpwd hook to avoid contaminating output
precmd_functions+=(update_terminalapp_cwd)
# Run once to get initial cwd set
update_terminalapp_cwd
fi
# ls colors
autoload -U colors && colors
# Enable ls colors
export LSCOLORS="Gxfxcxdxbxegedabagacad"
# TODO organise this chaotic logic
if [[ "$DISABLE_LS_COLORS" != "true" ]]; then
# Find the option for using colors in ls, depending on the version
if [[ "$OSTYPE" == 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 && alias ls='gls --color=tty'
elif [[ "$OSTYPE" == openbsd* ]]; then
# On OpenBSD, "gls" (ls from GNU coreutils) and "colorls" (ls from base,
# with color and multibyte support) are available from ports. "colorls"
# will be installed on purpose and can't be pulled in by installing
# coreutils, so prefer it to "gls".
gls --color -d . &>/dev/null && alias ls='gls --color=tty'
colorls -G -d . &>/dev/null && alias ls='colorls -G'
elif [[ "$OSTYPE" == darwin* ]]; then
# this is a good alias, it works by default just using $LSCOLORS
ls -G . &>/dev/null && alias ls='ls -G'
# only use coreutils ls if there is a dircolors customization present ($LS_COLORS or .dircolors file)
# otherwise, gls will use the default color scheme which is ugly af
[[ -n "$LS_COLORS" || -f "$HOME/.dircolors" ]] && gls --color -d . &>/dev/null && alias ls='gls --color=tty'
else
# For GNU ls, we use the default ls color theme. They can later be overwritten by themes.
if [[ -z "$LS_COLORS" ]]; then
(( $+commands[dircolors] )) && eval "$(dircolors -b)"
fi
ls --color -d . &>/dev/null && alias ls='ls --color=tty' || { ls -G . &>/dev/null && alias ls='ls -G' }
# Take advantage of $LS_COLORS for completion as well.
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
fi
fi
setopt auto_cd
setopt multios
setopt prompt_subst
[[ -n "$WINDOW" ]] && SCREEN_NO="%B$WINDOW%b " || SCREEN_NO=""
# Apply theming defaults
PS1="%n@%m:%~%# "
# git theming default: Variables for theming the git info prompt
ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Prefix at the very beginning of the prompt, before the branch name
ZSH_THEME_GIT_PROMPT_SUFFIX=")" # At the very end of the prompt
ZSH_THEME_GIT_PROMPT_DIRTY="*" # Text to display if the branch is dirty
ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is clean
is_plugin() {
local base_dir=$1
local name=$2
test -f $base_dir/plugins/$name/$name.plugin.zsh \
|| test -f $base_dir/plugins/$name/_$name
}
# Add all defined plugins to fpath. This must be done
# before running compinit.
for plugin ($plugins); do
if is_plugin $ZSH_CUSTOM $plugin; then
fpath=($ZSH_CUSTOM/plugins/$plugin $fpath)
elif is_plugin $ZSH $plugin; then
fpath=($ZSH/plugins/$plugin $fpath)
fi
done
# Figure out the SHORT hostname
if [[ "$OSTYPE" = darwin* ]]; then
# macOS's $HOST changes with dhcp, etc. Use ComputerName if possible.
SHORT_HOST=$(scutil --get ComputerName 2>/dev/null) || SHORT_HOST=${HOST/.*/}
else
SHORT_HOST=${HOST/.*/}
fi
# Save the location of the current completion dump file.
if [ -z "$ZSH_COMPDUMP" ]; then
ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
fi
if [[ $ZSH_DISABLE_COMPFIX != true ]]; then
# If completion insecurities exist, warn the user without enabling completions.
if ! compaudit &>/dev/null; then
# This function resides in the "lib/compfix.zsh" script sourced above.
handle_completion_insecurities
# Else, enable and cache completions to the desired file.
else
compinit -d "${ZSH_COMPDUMP}"
fi
else
compinit -i -d "${ZSH_COMPDUMP}"
fi
#files: 566 version: 4.3.6
_comps=(
'-' '_precommand'
'.' '_source'
'a2dismod' '_a2utils'
'a2dissite' '_a2utils'
'a2enmod' '_a2utils'
'a2ensite' '_a2utils'
'a2ps' '_a2ps'
'aaaa' '_hosts'
'aap' '_aap'
'acpi' '_acpi'
'acpitool' '_acpitool'
'acroread' '_acroread'
'admin' '_sccs'
'ali' '_mh'
'alias' '_alias'
'amaya' '_webbrowser'
'analyseplugin' '_analyseplugin'
'animate' '_imagemagick'
'anno' '_mh'
'ant' '_ant'
'antiword' '_antiword'
'apache2ctl' '_apachectl'
'apachectl' '_apachectl'
'apm' '_apm'
'appletviewer' '_java'
'apropos' '_man'
'apt-cache' '_apt'
'apt-cdrom' '_apt'
'apt-config' '_apt'
'apt-file' '_apt-file'
'apt-get' '_apt'
'aptitude' '_aptitude'
'apt-move' '_apt-move'
'apt-show-versions' '_apt-show-versions'
'arena' '_webbrowser'
'arp' '_arp'
'arping' '_arping'
'-array-value-' '_value'
'-assign-parameter-' '_assign'
'attr' '_attr'
'auto-apt' '_auto-apt'
'autoload' '_typeset'
'bash' '_sh'
'baz' '_baz'
'bg' '_jobs_bg'
'bindkey' '_bindkey'
'bison' '_bison'
'bogofilter' '_bogofilter'
'bogotune' '_bogofilter'
'bogoutil' '_bogofilter'
'-brace-parameter-' '_brace_parameter'
'brctl' '_brctl'
'btdownloadcurses' '_bittorrent'
'btdownloadgui' '_bittorrent'
'btdownloadheadless' '_bittorrent'
'btlaunchmany' '_bittorrent'
'btlaunchmanycurses' '_bittorrent'
'btmakemetafile' '_bittorrent'
'btreannounce' '_bittorrent'
'btrename' '_bittorrent'
'bts' '_bts'
'btshowmetainfo' '_bittorrent'
'bttrack' '_bittorrent'
'bug' '_bug'
'buildhash' '_ispell'
'builtin' '_builtin'
'bunzip2' '_bzip2'
'burst' '_mh'
'bzcat' '_bzip2'
'bzip2' '_bzip2'
'bzip2recover' '_bzip2'
'bzr' '_bzr'
'cal' '_cal'
'calendar' '_calendar'
'catchsegv' '_precommand'
'ccal' '_ccal'
'cd' '_cd'
'cdbs-edit-patch' '_cdbs-edit-patch'
'cdc' '_sccs'
'cdcd' '_cdcd'
'cdrdao' '_cdrdao'
'cdrecord' '_cdrecord'
'certtool' '_gnutls'
'cftp' '_twisted'
'chage' '_users'
'chdir' '_cd'
'chflags' '_chflags'
'chfn' '_users'
'chgrp' '_chown'
'chimera' '_webbrowser'
'chkconfig' '_chkconfig'
'chmod' '_chmod'
'chown' '_chown'
'chsh' '_users'
'ci' '_rcs'
'ckeygen' '_twisted'
'clear' '_nothing'
'co' '_rcs'
'comb' '_sccs'
'combine' '_imagemagick'
'comm' '_comm'
'command' '_command'
'-command-' '_autocd'
'-command-line-' '_normal'
'comp' '_mh'
'compdef' '_compdef'
'composite' '_imagemagick'
'compress' '_compress'
'conch' '_twisted'
'-condition-' '_condition'
'config.status' '_configure'
'configure' '_configure'
'convert' '_imagemagick'
'cowsay' '_cowsay'
'cowthink' '_cowsay'
'cp' '_cp'
'cpio' '_cpio'
'cplay' '_cplay'
'crsh' '_cssh'
'csh' '_sh'
'cssh' '_cssh'
'csup' '_csup'
'curl' '_urls'
'cut' '_cut'
'cvs' '_cvs'
'cvsup' '_cvsup'
'cygcheck' '_cygcheck'
'cygcheck.exe' '_cygcheck'
'cygpath' '_cygpath'
'cygpath.exe' '_cygpath'
'cygrunsrv' '_cygrunsrv'
'cygrunsrv.exe' '_cygrunsrv'
'cygserver' '_cygserver'
'cygserver.exe' '_cygserver'
'cygstart' '_cygstart'
'cygstart.exe' '_cygstart'
'dak' '_dak'
'darcs' '_darcs'
'date' '_date'
'dch' '_debchange'
'dchroot' '_dchroot'
'dchroot-dsa' '_dchroot-dsa'
'dcop' '_dcop'
'dcopclient' '_dcop'
'dcopfind' '_dcop'
'dcopobject' '_dcop'
'dcopref' '_dcop'
'dcopstart' '_dcop'
'dd' '_dd'
'debchange' '_debchange'
'debdiff' '_debdiff'
'debfoster' '_debfoster'
'debsign' '_debsign'
'declare' '_typeset'
'-default-' '_default'
'defaults' '_defaults'
'delta' '_sccs'
'df' '_directories'
'dhclient' '_dhclient'
'dhclient3' '_dhclient'
'dict' '_dict'
'diff' '_diff'
'diffstat' '_diffstat'
'dillo' '_webbrowser'
'dircmp' '_directories'
'dirs' '_dirs'
'disable' '_disable'
'disown' '_jobs_fg'
'display' '_imagemagick'
'dist' '_mh'
'dlocate' '_dlocate'
'dmake' '_make'
'dmidecode' '_dmidecode'
'domainname' '_yp'
'dosdel' '_floppy'
'dosread' '_floppy'
'dpatch-edit-patch' '_dpatch-edit-patch'
'dpkg' '_dpkg'
'dpkg-buildpackage' '_dpkg-buildpackage'
'dpkg-cross' '_dpkg-cross'
'dpkg-deb' '_dpkg'
'dpkg-query' '_dpkg'
'dpkg-reconfigure' '_dpkg'
'dpkg-repack' '_dpkg-repack'
'dpkg-source' '_dpkg_source'
'dput' '_dput'
'du' '_du'
'dumper' '_dumper'
'dumper.exe' '_dumper'
'dupload' '_dupload'
'dvibook' '_dvi'
'dviconcat' '_dvi'
'dvicopy' '_dvi'
'dvidvi' '_dvi'
'dvips' '_dvi'
'dviselect' '_dvi'
'dvitodvi' '_dvi'
'dvitype' '_dvi'
'ecasound' '_ecasound'
'echotc' '_echotc'
'echoti' '_echoti'
'egrep' '_grep'
'elinks' '_elinks'
'elm' '_elm'
'emulate' '_emulate'
'enable' '_enable'
'enscript' '_enscript'
'env' '_env'
'epsffit' '_psutils'
'-equal-' '_equal'
'eval' '_precommand'
'eview' '_vim'
'evim' '_vim'
'exec' '_precommand'
'exim' '_vim'
'explodepkg' '_pkgtool'
'export' '_typeset'
'express' '_webbrowser'
'extcheck' '_java'
'extractres' '_psutils'
'fakeroot' '_fakeroot'
'false' '_nothing'
'fc' '_fc'
'fetchmail' '_fetchmail'
'fg' '_jobs_fg'
'fgrep' '_grep'
'figlet' '_figlet'
'find' '_find'
'findaffix' '_ispell'
'finger' '_finger'
'fink' '_fink'
'firefox' '_mozilla'
'-first-' '_first'
'fixdlsrps' '_psutils'
'fixfmps' '_psutils'
'fixmacps' '_psutils'
'fixpsditps' '_psutils'
'fixpspps' '_psutils'
'fixscribeps' '_psutils'
'fixtpps' '_psutils'
'fixwfwps' '_psutils'
'fixwpps' '_psutils'
'fixwwps' '_psutils'
'flasher' '_flasher'
'flex' '_flex'
'flist' '_mh'
'flists' '_mh'
'float' '_typeset'
'fned' '_zed'
'folder' '_mh'
'folders' '_mh'
'fortune' '_fortune'
'forw' '_mh'
'fsh' '_fsh'
'ftp' '_hosts'
'functions' '_typeset'
'fuser' '_fuser'
'fusermount' '_fusermount'
'fwhois' '_whois'
'g++' '_gcc'
'galeon' '_webbrowser'
'gcc' '_gcc'
'gdb' '_gdb'
'gdiff' '_diff'
'genisoimage' '_genisoimage'
'get' '_sccs'
'getafm' '_psutils'
'getclip' '_getclip'
'getclip.exe' '_getclip'
'getconf' '_getconf'
'getent' '_getent'
'getfacl' '_getfacl'
'getfacl.exe' '_getfacl'
'getfattr' '_attr'
'getmail' '_getmail'
'getopts' '_vars'
'gex' '_vim'
'ggv' '_gnome-gv'
'ghostscript' '_gs'
'ghostview' '_pspdf'
'git' '_git'
'git-add' '_git'
'git-am' '_git'
'git-annotate' '_git'
'git-apply' '_git'
'git-applymbox' '_git'
'git-applypatch' '_git'
'git-archimport' '_git'
'git-archive' '_git'
'git-bisect' '_git'
'git-blame' '_git'
'git-branch' '_git'
'git-cat-file' '_git'
'git-check-attr' '_git'
'git-checkout' '_git'
'git-checkout-index' '_git'
'git-check-ref-format' '_git'
'git-cherry' '_git'
'git-cherry-pick' '_git'
'git-clean' '_git'
'git-clone' '_git'
'git-clone-pack' '_git'
'git-commit' '_git'
'git-commit-tree' '_git'
'git-config' '_git'
'git-convert-objects' '_git'
'git-count-objects' '_git'
'git-cvsexportcommit' '_git'
'git-cvsimport' '_git'
'git-cvsserver' '_git'
'git-daemon' '_git'
'git-describe' '_git'
'git-diff' '_git'
'git-diff-files' '_git'
'git-diff-index' '_git'
'git-diff-stages' '_git'
'git-diff-tree' '_git'
'git-fast-import' '_git'
'git-fetch' '_git'
'git-fetch-pack' '_git'
'git-fmt-merge-msg' '_git'
'git-for-each-ref' '_git'
'git-format-patch' '_git'
'git-fsck' '_git'
'git-gc' '_git'
'git-get-tar-commit-id' '_git'
'git-grep' '_git'
'git-hash-object' '_git'
'git-http-fetch' '_git'
'git-http-push' '_git'
'git-imap-send' '_git'
'git-index-pack' '_git'
'git-init' '_git'
'git-instaweb' '_git'
'git-local-fetch' '_git'
'git-log' '_git'
'git-lost-found' '_git'
'git-ls-files' '_git'
'git-ls-remote' '_git'
'git-ls-tree' '_git'
'git-mailinfo' '_git'
'git-mailsplit' '_git'
'git-merge' '_git'
'git-merge-base' '_git'
'git-merge-file' '_git'
'git-merge-index' '_git'
'git-merge-one-file' '_git'
'git-mergetool' '_git'
'git-merge-tree' '_git'
'git-mktag' '_git'
'git-mktree' '_git'
'git-mv' '_git'
'git-name-rev' '_git'
'git-octopus' '_git'
'git-pack-objects' '_git'
'git-pack-redundant' '_git'
'git-pack-refs' '_git'
'git-patch-id' '_git'
'git-peek-remote' '_git'
'git-prune' '_git'
'git-prune-packed' '_git'
'git-pull' '_git'
'git-push' '_git'
'git-quiltimport' '_git'
'git-read-tree' '_git'
'git-rebase' '_git'
'git-receive-pack' '_git'
'git-reflog' '_git'
'git-relink' '_git'
'git-remote' '_git'
'git-repack' '_git'
'git-request-pull' '_git'
'git-rerere' '_git'
'git-reset' '_git'
'git-revert' '_git'
'git-rev-list' '_git'
'git-rev-parse' '_git'
'git-rm' '_git'
'git-send-email' '_git'
'git-send-pack' '_git'
'git-shell' '_git'
'git-shortlog' '_git'
'git-show' '_git'
'git-show-branch' '_git'
'git-show-index' '_git'
'git-show-ref' '_git'
'git-sh-setup' '_git'
'git-ssh-fetch' '_git'
'git-ssh-upload' '_git'
'git-status' '_git'
'git-stripspace' '_git'
'git-svn' '_git'
'git-svnimport' '_git'
'git-symbolic-ref' '_git'
'git-tag' '_git'
'git-tar-tree' '_git'
'git-unpack-file' '_git'
'git-unpack-objects' '_git'
'git-update-index' '_git'
'git-update-ref' '_git'
'git-update-server-info' '_git'
'git-upload-archive' '_git'
'git-upload-pack' '_git'
'git-var' '_git'
'git-verify-pack' '_git'
'git-verify-tag' '_git'
'git-whatchanged' '_git'
'git-write-tree' '_git'
'global' '_global'
'gls' '_ls'
'gmake' '_make'
'gmplayer' '_mplayer'
'gnome-gv' '_gnome-gv'
'gnutls-cli' '_gnutls'
'gnutls-cli-debug' '_gnutls'
'gpg' '_gpg'
'gpgv' '_gpg'
'gphoto2' '_gphoto2'
'gprof' '_gprof'
'gqview' '_gqview'
'grail' '_webbrowser'
'grep' '_grep'
'groff' '_groff'
'groupadd' '_user_admin'
'groupdel' '_groups'
'groupmod' '_user_admin'
'groups' '_users'
'growisofs' '_growisofs'
'gs' '_gs'
'gsbj' '_pspdf'
'gsdj' '_pspdf'
'gsdj500' '_pspdf'
'gslj' '_pspdf'
'gslp' '_pspdf'
'gsnd' '_pspdf'
'gtar' '_tar'
'guilt' '_guilt'
'guilt-add' '_guilt'
'guilt-applied' '_guilt'
'guilt-delete' '_guilt'
'guilt-files' '_guilt'
'guilt-fold' '_guilt'
'guilt-fork' '_guilt'
'guilt-header' '_guilt'
'guilt-help' '_guilt'
'guilt-import' '_guilt'
'guilt-import-commit' '_guilt'
'guilt-init' '_guilt'
'guilt-new' '_guilt'
'guilt-next' '_guilt'
'guilt-patchbomb' '_guilt'
'guilt-pop' '_guilt'
'guilt-prev' '_guilt'
'guilt-push' '_guilt'
'guilt-rebase' '_guilt'
'guilt-refresh' '_guilt'
'guilt-rm' '_guilt'
'guilt-series' '_guilt'
'guilt-status' '_guilt'
'guilt-top' '_guilt'
'guilt-unapplied' '_guilt'
'gunzip' '_gzip'
'gut-runstatus' '_git'
'gv' '_gv'
'gview' '_vim'
'gvim' '_vim'
'gvimdiff' '_vim'
'gzcat' '_gzip'
'gzilla' '_webbrowser'
'gzip' '_gzip'
'hash' '_hash'
'hdiutil' '_hdiutil'
'help' '_sccs'
'hg' '_mercurial'
'history' '_fc'
'host' '_hosts'
'hotjava' '_webbrowser'
'hwinfo' '_hwinfo'
'iceweasel' '_mozilla'
'icombine' '_ispell'
'iconv' '_iconv'
'id' '_id'
'identify' '_imagemagick'
'ifconfig' '_ifconfig'
'ifdown' '_net_interfaces'
'ifup' '_net_interfaces'
'ijoin' '_ispell'
'import' '_imagemagick'
'inc' '_mh'
'includeres' '_psutils'
'info' '_texinfo'
'infocmp' '_terminals'
'insmod' '_modutils'
'install-info' '_texinfo'
'installpkg' '_pkgtool'
'integer' '_typeset'
'invoke-rc.d' '_invoke-rc.d'
'ip' '_ip'
'iptables' '_iptables'
'iptables-restore' '_iptables'
'iptables-save' '_iptables'
'irssi' '_irssi'
'ispell' '_ispell'
'iwconfig' '_iwconfig'
'jadetex' '_tex'
'jar' '_java'
'jarsigner' '_java'
'java' '_java'
'javac' '_java'
'javadoc' '_java'
'javah' '_java'
'javap' '_java'
'jdb' '_java'
'jobs' '_jobs_builtin'
'joe' '_joe'
'keytool' '_java'
'kfmclient' '_kfmclient'
'kill' '_kill'
'killall' '_killall'
'killall5' '_killall'
'kldload' '_kld'
'kldunload' '_kld'
'knock' '_knock'
'konqueror' '_webbrowser'
'kpdf' '_pdf'
'ksh' '_sh'
'kvno' '_kvno'
'last' '_last'
'lastb' '_last'
'latex' '_tex'
'ldd' '_ldd'
'less' '_less'
'let' '_math'
'lftp' '_ncftp'
'light' '_webbrowser'
'lighty-disable-mod' '_lighttpd'
'lighty-enable-mod' '_lighttpd'
'limit' '_limit'
'linda' '_linda'
'links' '_links'
'lintian' '_lintian'
'linux' '_uml'
'loadkeys' '_loadkeys'
'local' '_typeset'
'locate' '_locate'
'log' '_nothing'
'logname' '_nothing'
'look' '_look'
'lore' '_twisted'
'losetup' '_losetup'
'lp' '_lp'
'lpq' '_lp'
'lpr' '_lp'
'lprm' '_lp'
'ls' '_ls'
'lscfg' '_lscfg'
'lsdev' '_lsdev'
'lslv' '_lslv'
'lsmod' '_modutils'
'lsof' '_lsof'
'lspv' '_lspv'
'lsusb' '_lsusb'
'lsvg' '_lsvg'
'lynx' '_lynx'
'lzop' '_lzop'
'm-a' '_module-assistant'
'madison' '_madison'
'mail' '_mail'
'Mail' '_mail'
'mailx' '_mail'
'make' '_make'
'makeinfo' '_texinfo'
'make-kpkg' '_make-kpkg'
'makepkg' '_pkgtool'
'man' '_man'
'manhole' '_twisted'
'mark' '_mh'
'-math-' '_math'
'mattrib' '_mtools'
'mcd' '_mtools'
'mcopy' '_mtools'
'md5sum' '_md5sum'
'mdel' '_mtools'
'mdeltree' '_mtools'
'mdir' '_mtools'
'mdu' '_mtools'
'members' '_members'
'mencal' '_mencal'
'mere' '_mere'
'merge' '_rcs'
'mergechanges' '_mergechanges'
'metaflac' '_metaflac'
'mformat' '_mtools'
'mgv' '_pspdf'
'mhlist' '_mh'
'mhmail' '_mh'
'mhn' '_mh'
'mhparam' '_mh'
'mhpath' '_mh'
'mhshow' '_mh'
'mhstore' '_mh'
'mii-tool' '_mii-tool'
'mkdir' '_mkdir'
'mkisofs' '_growisofs'
'mkshortcut' '_mkshortcut'
'mkshortcut.exe' '_mkshortcut'
'mktap' '_twisted'
'mkzsh' '_mkzsh'
'mkzsh.exe' '_mkzsh'
'mlabel' '_mtools'
'mlocate' '_locate'
'mmd' '_mtools'
'mmm' '_webbrowser'
'mmount' '_mtools'
'mmove' '_mtools'
'modinfo' '_modutils'
'modprobe' '_modutils'
'module' '_module'
'module-assistant' '_module-assistant'
'mogrify' '_imagemagick'
'mondoarchive' '_mondo'
'montage' '_imagemagick'
'Mosaic' '_webbrowser'
'mount' '_mount'
'mozilla' '_mozilla'
'mozilla-firefox' '_mozilla'
'mozilla-xremote-client' '_mozilla'
'mpc' '_mpc'
'mplayer' '_mplayer'
'mrd' '_mtools'
'mread' '_mtools'
'mren' '_mtools'
'msgchk' '_mh'
'mt' '_mt'
'mtn' '_monotone'
'mtoolstest' '_mtools'
'mtr' '_mtr'
'mtype' '_mtools'
'munchlist' '_ispell'
'mush' '_mail'
'mutt' '_mutt'
'mx' '_hosts'
'mysql' '_mysql_utils'
'mysqladmin' '_mysql_utils'
'mysqldiff' '_mysqldiff'
'mysqldump' '_mysql_utils'
'mysqlimport' '_mysql_utils'
'mysqlshow' '_mysql_utils'
'nail' '_mail'
'native2ascii' '_java'
'nautilus' '_nautilus'
'nc' '_netcat'
'ncal' '_cal'
'ncftp' '_ncftp'
'ncl' '_nedit'
'nedit' '_nedit'
'nedit-nc' '_nedit'
'netcat' '_netcat'
'netrik' '_webbrowser'
'netscape' '_netscape'
'newgrp' '_groups'
'next' '_mh'
'nice' '_nice'
'nmap' '_nmap'
'nmblookup' '_samba'
'nocorrect' '_precommand'
'noglob' '_precommand'
'nohup' '_precommand'
'ns' '_hosts'
'nslookup' '_nslookup'
'ntalk' '_other_accounts'
'odme' '_object_classes'
'odmget' '_object_classes'
'odmshow' '_object_classes'
'ogg123' '_vorbis'
'oggdec' '_vorbis'
'oggenc' '_vorbis'
'ogginfo' '_vorbis'
'open' '_open'
'opera' '_webbrowser'
'p4' '_perforce'
'p4d' '_perforce'
'pack' '_pack'
'packf' '_mh'
'-parameter-' '_parameter'
'parsehdlist' '_urpmi'
'passwd' '_users'
'patch' '_patch'
'pax' '_pax'
'pcat' '_pack'
'pcred' '_pids'
'pdf2dsc' '_pdf'
'pdf2ps' '_pdf'
'pdffonts' '_pdf'
'pdfimages' '_pdf'
'pdfinfo' '_pdf'
'pdfjadetex' '_tex'
'pdflatex' '_tex'
'pdfopt' '_pdf'
'pdftopbm' '_pdf'
'pdftops' '_pdf'
'pdftotext' '_pdf'
'perl' '_perl'
'perldoc' '_perldoc'
'pfiles' '_pids'
'pflags' '_pids'
'phoenix' '_webbrowser'
'php' '_php'
'pick' '_mh'
'pine' '_pine'
'pinef' '_pine'
'ping' '_ping'
'piuparts' '_piuparts'
'pkg_add' '_bsd_pkg'
'pkg-config' '_pkg-config'
'pkg_create' '_bsd_pkg'
'pkg_delete' '_bsd_pkg'
'pkg_info' '_bsd_pkg'
'pkgtool' '_pkgtool'
'pldd' '_pids'
'pmake' '_make'
'pman' '_perl_modules'
'pmap' '_pids'
'pmcat' '_perl_modules'
'pmdesc' '_perl_modules'
'pmeth' '_perl_modules'
'pmexp' '_perl_modules'
'pmfunc' '_perl_modules'
'pmload' '_perl_modules'
'pmls' '_perl_modules'
'pmpath' '_perl_modules'
'pmvers' '_perl_modules'
'podgrep' '_perl_modules'
'podpath' '_perl_modules'
'podtoc' '_perl_modules'
'poff' '_pon'
'policytool' '_java'
'pon' '_pon'
'popd' '_directory_stack'
'portlint' '_portlint'
'portsnap' '_portsnap'
'postsuper' '_postfix'
'prcs' '_prcs'
'prev' '_mh'
'print' '_print'
'printenv' '_printenv'
'prompt' '_prompt'
'prs' '_sccs'
'prt' '_sccs'
'prun' '_pids'
'ps2ascii' '_pspdf'
'ps2epsi' '_ps'
'ps2pdf' '_ps'
'ps2pdf12' '_ps'
'ps2pdf13' '_ps'
'ps2pdf14' '_ps'
'ps2pdfwr' '_ps'
'ps2ps' '_ps'
'psbook' '_psutils'
'pscp' '_pscp'
'pscp.exe' '_pscp'
'psig' '_pids'
'psmerge' '_psutils'
'psmulti' '_ps'
'psnup' '_psutils'
'psresize' '_psutils'
'psselect' '_psutils'
'pstack' '_pids'
'pstoedit' '_pspdf'
'pstop' '_pids'
'pstops' '_psutils'
'pstotgif' '_pspdf'
'pswrap' '_ps'
'ptree' '_pids'
'pump' '_pump'
'pushd' '_cd'
'putclip' '_putclip'
'putclip.exe' '_putclip'
'pwait' '_pids'
'pwdx' '_pids'
'pyhtmlizer' '_twisted'
'python' '_python'
'qemu' '_qemu'
'qiv' '_qiv'
'qtplay' '_qtplay'
'querybts' '_bug'
'quilt' '_quilt'
'r' '_fc'
'raggle' '_raggle'
'rake' '_rake'
'ranlib' '_ranlib'
'rar' '_rar'
'rc' '_sh'
'rcp' '_rlogin'
'rcs' '_rcs'
'rcsdiff' '_rcs'
'read' '_read'
'readonly' '_typeset'
'-redirect-' '_redirect'
'-redirect-,<,bunzip2' '_bzip2'
'-redirect-,<,bzip2' '_bzip2'
'-redirect-,>,bzip2' '_bzip2'
'-redirect-,<,compress' '_compress'
'-redirect-,>,compress' '_compress'
'-redirect-,-default-,-default-' '_files'
'-redirect-,<,gunzip' '_gzip'
'-redirect-,<,gzip' '_gzip'
'-redirect-,>,gzip' '_gzip'
'-redirect-,<,uncompress' '_compress'
'refile' '_mh'
'rehash' '_hash'
'removepkg' '_pkgtool'
'remsh' '_rlogin'
'renice' '_renice'
'repl' '_mh'
'reportbug' '_bug'
'reprepro' '_reprepro'
'retawq' '_webbrowser'
'rgview' '_vim'
'rgvim' '_vim'
'ri' '_ri'
'rlogin' '_rlogin'
'rmadison' '_madison'
'rmdel' '_sccs'
'rmdir' '_directories'
'rmf' '_mh'
'rmic' '_java'
'rmid' '_java'
'rmiregistry' '_java'
'rmm' '_mh'
'rmmod' '_modutils'
'rpm' '_rpm'
'rrdtool' '_rrdtool'
'rsh' '_rlogin'
'rsync' '_rsync'
'rtin' '_tin'
'rubber' '_rubber'
'rubber-info' '_rubber'
'rubber-pipe' '_rubber'
'ruby' '_ruby'
'rup' '_hosts'
'rusage' '_precommand'
'rview' '_vim'
'rvim' '_vim'
'rwho' '_hosts'
'sabcmd' '_sablotron'
'sact' '_sccs'
'scan' '_mh'
'sccs' '_sccs'
'sccsdiff' '_sccs'
'sched' '_sched'
'schroot' '_schroot'
'scp' '_ssh'
'screen' '_screen'
'sed' '_sed'
'serialver' '_java'
'service' '_service'
'set' '_set'
'setfattr' '_attr'
'setopt' '_setopt'
'sftp' '_ssh'
'sh' '_sh'
'shift' '_arrays'
'show' '_mh'
'showchar' '_psutils'
'showmount' '_showmount'
'sisu' '_sisu'
'skipstone' '_webbrowser'
'slitex' '_tex'
'slocate' '_locate'
'slogin' '_ssh'
'slrn' '_slrn'
'smbclient' '_samba'
'smbcontrol' '_samba'
'smbstatus' '_samba'
'smit' '_smit'
'smitty' '_smit'
'soa' '_hosts'
'socket' '_socket'
'softwareupdate' '_softwareupdate'
'sortm' '_mh'
'source' '_source'
'spamassassin' '_spamassassin'
'sqsh' '_sqsh'
'sr' '_surfraw'
'srptool' '_gnutls'
'ssh' '_ssh'
'ssh-add' '_ssh'
'ssh-agent' '_ssh'
'sshfs' '_sshfs'
'ssh-keygen' '_ssh'
'star' '_tar'
'stat' '_stat'
'strip' '_strip'
'stty' '_stty'
'su' '_su'
'-subscript-' '_subscript'
'sudo' '_sudo'
'surfraw' '_surfraw'
'SuSEconfig' '_SuSEconfig'
'svn' '_subversion'
'svnadmin' '_subversion'
'svnadmin-static' '_subversion'
'svn-buildpackage' '_svn-buildpackage'
'sync' '_nothing'
'sysctl' '_sysctl'
'talk' '_other_accounts'
'tap2deb' '_twisted'
'tap2rpm' '_twisted'
'tapconvert' '_twisted'
'tar' '_tar'
'tardy' '_tardy'
'tcptraceroute' '_tcptraceroute'
'tcsh' '_sh'
'telnet' '_telnet'
'tex' '_tex'
'texi2dvi' '_texinfo'
'texindex' '_texinfo'
'tidy' '_tidy'
'-tilde-' '_tilde'
'time' '_precommand'
'times' '_nothing'
'tin' '_tin'
'tkconch' '_twisted'
'tkinfo' '_texinfo'
'tkmktap' '_twisted'
'tla' '_tla'
'todo.sh' '_todo.sh'
'toilet' '_toilet'
'totdconfig' '_totd'
'tpb' '_tpb'
'tpconfig' '_tpconfig'
'tpkg-debarch' '_toolchain-source'
'tpkg-install' '_toolchain-source'
'tpkg-install-libc' '_toolchain-source'
'tpkg-make' '_toolchain-source'
'tpkg-update' '_toolchain-source'
'tracepath' '_tracepath'
'tracepath6' '_tracepath'
'traceroute' '_hosts'
'trap' '_trap'
'trial' '_twisted'
'true' '_nothing'
'tryaffix' '_ispell'
'ttyctl' '_ttyctl'
'tunctl' '_uml'
'tune2fs' '_tune2fs'
'twistd' '_twisted'
'txt' '_hosts'
'type' '_which'
'typeset' '_typeset'
'ulimit' '_ulimit'
'uml_mconsole' '_uml'
'uml_moo' '_uml'
'uml_switch' '_uml'
'umount' '_mount'
'unace' '_unace'
'unalias' '_aliases'
'uname' '_uname'
'uncompress' '_compress'
'unexpand' '_unexpand'
'unfunction' '_functions'
'unget' '_sccs'
'unhash' '_unhash'
'uniq' '_uniq'
'units' '_units'
'unlimit' '_limits'
'unpack' '_pack'
'unrar' '_rar'
'unset' '_vars'
'unsetopt' '_unsetopt'
'unzip' '_zip'
'update-alternatives' '_update-alternatives'
'update-rc.d' '_update-rc.d'
'upgradepkg' '_pkgtool'
'urpme' '_urpmi'
'urpmf' '_urpmi'
'urpmi' '_urpmi'
'urpmi.addmedia' '_urpmi'
'urpmi.removemedia' '_urpmi'
'urpmi.update' '_urpmi'
'urpmq' '_urpmi'
'urxvt' '_urxvt'
'uscan' '_uscan'
'useradd' '_user_admin'
'userdel' '_users'
'usermod' '_user_admin'
'val' '_sccs'
'valgrind' '_valgrind'
'-value-' '_value'
'-value-,ANT_ARGS,-default-' '_ant'
'-value-,CFLAGS,-default-' '_gcc'
'-value-,CPPFLAGS,-default-' '_gcc'
'-value-,-default-,-default-' '_value'
'-value-,DISPLAY,-default-' '_x_display'
'-value-,GREP_OPTIONS,-default-' '_grep'
'-value-,GZIP,-default-' '_gzip'
'-value-,LANG,-default-' '_locales'
'-value-,LANGUAGE,-default-' '_locales'
'-value-,LD_DEBUG,-default-' '_ld_debug'
'-value-,LDFLAGS,-default-' '_gcc'
'-value-,LESSCHARSET,-default-' '_less'
'-value-,LESS,-default-' '_less'
'-value-,LPDEST,-default-' '_printers'
'-value-,P4CLIENT,-default-' '_perforce'
'-value-,P4MERGE,-default-' '_perforce'
'-value-,P4PORT,-default-' '_perforce'
'-value-,P4USER,-default-' '_perforce'
'-value-,PERLDOC,-default-' '_perldoc'
'-value-,PRINTER,-default-' '_printers'
'-value-,TERM,-default-' '_terminals'
'-value-,TERMINFO_DIRS,-default-' '_dir_list'
'-value-,TZ,-default-' '_time_zone'
'-value-,VALGRIND_OPTS,-default-' '_valgrind'
'-value-,WWW_HOME,-default-' '_urls'
'-value-,XML_CATALOG_FILES,-default-' '_xmlsoft'
'vared' '_vared'
'-vared-' '_in_vared'
'vim' '_vim'
'vim-addons' '_vim-addons'
'vimdiff' '_vim'
'vncserver' '_vnc'
'vncviewer' '_vnc'
'vorbiscomment' '_vorbiscomment'
'vserver' '_vserver'
'vux' '_vux'
'vuxctl' '_vux'
'w3m' '_w3m'
'wait' '_wait'
'wajig' '_wajig'
'wanna-build' '_wanna-build'
'websetroot' '_twisted'
'wget' '_wget'
'what' '_sccs'
'whatis' '_man'
'whence' '_which'
'where' '_which'
'whereis' '_whereis'
'which' '_which'
'whoami' '_nothing'
'whois' '_whois'
'whom' '_mh'
'wiggle' '_wiggle'
'wodim' '_cdrecord'
'write' '_users_on'
'www' '_webbrowser'
'xargs' '_xargs'
'xauth' '_xauth'
'xdpyinfo' '_x_utils'
'xdvi' '_xdvi'
'xelatex' '_tex'
'xetex' '_tex'
'xev' '_x_utils'
'xfd' '_x_utils'
'xfig' '_xfig'
'xfontsel' '_x_utils'
'xhost' '_x_utils'
'xkill' '_x_utils'
'xli' '_xloadimage'
'xloadimage' '_xloadimage'
'xmllint' '_xmlsoft'
'xmodmap' '_xmodmap'
'xmosaic' '_webbrowser'
'xon' '_x_utils'
'xpdf' '_xpdf'
'xping' '_hosts'
'xrandr' '_xrandr'
'xrdb' '_x_utils'
'xscreensaver-command' '_xscreensaver'
'xset' '_xset'
'xsetbg' '_xloadimage'
'xsetroot' '_x_utils'
'xsltproc' '_xmlsoft'
'xterm' '_xterm'
'xtightvncviewer' '_vnc'
'xtp' '_imagemagick'
'xv' '_xv'
'xview' '_xloadimage'
'xvnc4viewer' '_vnc'
'xvncviewer' '_vnc'
'xwd' '_x_utils'
'xwininfo' '_x_utils'
'xwit' '_xwit'
'xwud' '_x_utils'
'yast' '_yast'
'yast2' '_yast'
'ypbind' '_yp'
'ypcat' '_yp'
'ypmatch' '_yp'
'yppasswd' '_yp'
'yppoll' '_yp'
'yppush' '_yp'
'ypserv' '_yp'
'ypset' '_yp'
'ypwhich' '_yp'
'ypxfr' '_yp'
'ytalk' '_other_accounts'
'yum' '_yum'
'zcat' '_zcat'
'zcompile' '_zcompile'
'zcp' '_zmv'
'zdump' '_zdump'
'zed' '_zed'
'zen' '_webbrowser'
'zip' '_zip'
'zipinfo' '_zip'
'zle' '_zle'
'zln' '_zmv'
'zmail' '_mail'
'zmodload' '_zmodload'
'zmv' '_zmv'
'zone' '_hosts'
'zpty' '_zpty'
'zsh' '_sh'
'zstat' '_stat'
'zstyle' '_zstyle'
'zxpdf' '_xpdf'
)
_services=(
'bzcat' 'bunzip2'
'dch' 'debchange'
'gzcat' 'gunzip'
'iceweasel' 'firefox'
'Mail' 'mail'
'mailx' 'mail'
'nail' 'mail'
'ncl' 'nc'
'nedit-nc' 'nc'
'pcat' 'unpack'
'-redirect-,<,bunzip2' 'bunzip2'
'-redirect-,<,bzip2' 'bzip2'
'-redirect-,>,bzip2' 'bunzip2'
'-redirect-,<,compress' 'compress'
'-redirect-,>,compress' 'uncompress'
'-redirect-,<,gunzip' 'gunzip'
'-redirect-,<,gzip' 'gzip'
'-redirect-,>,gzip' 'gunzip'
'-redirect-,<,uncompress' 'uncompress'
'remsh' 'rsh'
'slogin' 'ssh'
'svnadmin-static' 'svnadmin'
'xelatex' 'latex'
'xetex' 'tex'
)
_patcomps=(
'*/(init|rc[0-9S]#).d/*' '_init_d'
'zf*' '_zftp'
)
_postpatcomps=(
'(p[bgpn]m*|*top[bgpn]m)' '_pbm'
'(texi(2*|ndex))' '_texi'
'(tiff*|*2tiff|pal2rgb)' '_tiff'
'-value-,(ftp|http(|s))_proxy,-default-' '_urls'
'-value-,LC_*,-default-' '_locales'
'-value-,*path,-default-' '_directories'
'-value-,*PATH,-default-' '_dir_list'
'-value-,RUBY(LIB|OPT|PATH),-default-' '_ruby'
'*/X11(|R[456])/*' '_x_arguments'
'yodl(|2*)' '_yodl'
)
_compautos=(
'_call_program' '+X'
)
zle -C _bash_complete-word .complete-word _bash_completions
zle -C _bash_list-choices .list-choices _bash_completions
zle -C _complete_debug .complete-word _complete_debug
zle -C _complete_help .complete-word _complete_help
zle -C _complete_tag .complete-word _complete_tag
zle -C _correct_filename .complete-word _correct_filename
zle -C _correct_word .complete-word _correct_word
zle -C _expand_alias .complete-word _expand_alias
zle -C _expand_word .complete-word _expand_word
zle -C _history-complete-newer .complete-word _history_complete_word
zle -C _history-complete-older .complete-word _history_complete_word
zle -C _list_expansions .list-choices _expand_word
zle -C _most_recent_file .complete-word _most_recent_file
zle -C _next_tags .list-choices _next_tags
zle -C _read_comp .complete-word _read_comp
bindkey '^X^R' _read_comp
bindkey '^X?' _complete_debug
bindkey '^XC' _correct_filename
bindkey '^Xa' _expand_alias
bindkey '^Xc' _correct_word
bindkey '^Xd' _list_expansions
bindkey '^Xe' _expand_word
bindkey '^Xh' _complete_help
bindkey '^Xm' _most_recent_file
bindkey '^Xn' _next_tags
bindkey '^Xt' _complete_tag
bindkey '^X~' _bash_list-choices
bindkey '^[,' _history-complete-newer
bindkey '^[/' _history-complete-older
bindkey '^[~' _bash_complete-word
autoload -Uz _a2ps _a2utils _aap _acpi _acpitool \
_acroread _alias _aliases _all_labels _all_matches \
_alternative _analyseplugin _ant _antiword _apachectl \
_apm _approximate _apt _apt-file _aptitude \
_apt-move _apt-show-versions _arch_archives _arch_namespace _arg_compile \
_arguments _arp _arping _arrays _assign \
_attr _auto-apt _autocd _bash_completions _baz \
_bind_addresses _bindkey _bison _bittorrent _bogofilter \
_brace_parameter _brctl _bsd_pkg _bts _bug \
_builtin _bzip2 _bzr _cache_invalid _cal \
_calendar _call_function _canonical_paths _ccal _cd \
_cdbs-edit-patch _cdcd _cdrdao _cdrecord _chflags \
_chkconfig _chmod _chown _combination _comm \
_command _command_names _compdef _complete _complete_debug \
_complete_help _complete_help_generic _complete_tag _compress _condition \
_configure _correct _correct_filename _correct_word _cowsay \
_cp _cpio _cplay _cssh _csup \
_ctags_tags _cut _cvs _cvsup _cygcheck \
_cygpath _cygrunsrv _cygserver _cygstart _dak \
_darcs _date _dchroot _dchroot-dsa _dcop \
_dd _debchange _debdiff _debfoster _deb_packages \
_debsign _default _defaults _delimiters _describe \
_description _dhclient _dict _dict_words _diff \
_diff_options _diffstat _directories _directory_stack _dir_list \
_dirs _disable _dispatch _dlocate _dmidecode \
_domains _dpatch-edit-patch _dpkg _dpkg-buildpackage _dpkg-cross \
_dpkg-repack _dpkg_source _dput _du _dumper \
_dupload _dvi _ecasound _echotc _echoti \
_elinks _elm _email_addresses _emulate _enable \
_enscript _env _equal _expand _expand_alias \
_expand_word _fakeroot _fc _fetchmail _figlet \
_file_descriptors _files _file_systems _find _finger \
_fink _first _flasher _flex _floppy \
_fortune _fsh _functions _fuse_arguments _fuser \
_fusermount _fuse_values _gcc _gdb _generic \
_genisoimage _getclip _getconf _getent _getfacl \
_getmail _git _global _global_tags _globqual_delims \
_globquals _gnome-gv _gnu_generic _gnutls _gpg \
_gphoto2 _gprof _gqview _grep _groff \
_groups _growisofs _gs _guard _guilt \
_gv _gzip _hash _hdiutil _history \
_history_complete_word _history_modifiers _hosts _hwinfo _iconv \
_id _ifconfig _ignored _imagemagick _init_d \
_in_vared _invoke-rc.d _ip _iptables _irssi \
_ispell _iwconfig _java _java_class _jobs \
_jobs_bg _jobs_builtin _jobs_fg _joe _kfmclient \
_kill _killall _kld _knock _kvno \
_last _ldd _ld_debug _less _lighttpd \
_limit _limits _linda _links _lintian \
_list _list_files _loadkeys _locales _locate \
_logical_volumes _look _losetup _lp _ls \
_lscfg _lsdev _lslv _lsof _lspv \
_lsusb _lsvg _lynx _lzop _mac_applications \
_mac_files_for_application _madison _mail _mailboxes _main_complete \
_make _make-kpkg _man _match _math \
_md5sum _members _mencal _menu _mercurial \
_mere _mergechanges _message _metaflac _mh \
_mii-tool _mime_types _mkdir _mkshortcut _mkzsh \
_module _module-assistant _modutils _mondo _monotone \
_most_recent_file _mount _mozilla _mpc _mplayer \
_mt _mtools _mtr _multi_parts _mutt \
_my_accounts _mysqldiff _mysql_utils _nautilus _ncftp \
_nedit _netcat _net_interfaces _netscape _newsgroups \
_next_label _next_tags _nice _nmap _normal \
_nothing _nslookup _object_classes _oldlist _omz_diag_dump_check_core_commands \
_omz_diag_dump_echo_file_w_header _omz_diag_dump_one_big_text _omz_diag_dump_os_specific_version _open _options \
_options_set _options_unset _other_accounts _pack _parameter \
_parameters _patch _path_commands _path_files _pax \
_pbm _pdf _perforce _perl _perl_basepods \
_perldoc _perl_modules _php _physical_volumes _pick_variant \
_pids _pine _ping _piuparts _pkg-config \
_pkgtool _pon _portlint _ports _portsnap \
_postfix _prcs _precommand _prefix _print \
_printenv _printers _prompt _ps _pscp \
_pspdf _psutils _pump _putclip _python \
_qemu _qiv _qtplay _quilt _raggle \
_rake _ranlib _rar _rcs _read \
_read_comp _redirect _regex_arguments _regex_words _renice \
_reprepro _requested _retrieve_cache _retrieve_mac_apps _ri \
_rlogin _rpm _rrdtool _rsync _rubber \
_ruby _sablotron _samba _sccs _sched \
_schroot _screen _sed _sep_parts _service \
_services _set _set_command _setopt _setup \
_sh _showmount _signals _sisu _slrn \
_smit _socket _softwareupdate _source _spamassassin \
_sqsh _ssh _sshfs _stat _store_cache \
_strip _stty _su _sub_commands _subscript \
_subversion _sudo _suffix_alias_files _surfraw _SuSEconfig \
_svn-buildpackage _sysctl _tags _tar _tar_archive \
_tardy _tcptraceroute _telnet _terminals _tex \
_texi _texinfo _tidy _tiff _tilde \
_tilde_files _time_zone _tin _tla _todo.sh \
_toilet _toolchain-source _totd _tpb _tpconfig \
_tracepath _trap _ttyctl _tune2fs _twisted \
_typeset _ulimit _uml _unace _uname \
_unexpand _unhash _uniq _units _unsetopt \
_update-alternatives _update-rc.d _urls _urpmi _urxvt \
_uscan _user_admin _user_at_host _users _users_on \
_valgrind _value _values _vared _vars \
_vim _vim-addons _vnc _volume_groups _vorbis \
_vorbiscomment _vserver _vux _w3m _wait \
_wajig _wakeup_capable_devices _wanna-build _wanted _webbrowser \
_wget _whereis _which _whois _wiggle \
_xargs _x_arguments _xauth _x_borderwidth _x_color \
_x_colormapid _x_cursor _x_display _xdvi _x_extension \
_xfig _x_font _x_geometry _x_keysym _xloadimage \
_x_locale _xmlsoft _x_modifier _xmodmap _x_name \
_xpdf _xrandr _x_resource _xscreensaver _x_selection_timeout \
_xset _xt_arguments _xterm _x_title _xt_session_id \
_x_utils _xv _x_visual _x_window _xwit \
_yast _yast2 _yodl _yp _yum \
_zcat _zcompile _zdump _zed _zftp \
_zip _zle _zmodload _zmv _zpty \
_zstyle
autoload -Uz +X _call_program
typeset -gUa _comp_assocs
_comp_assocs=( '' )
# Load all of the plugins that were defined in ~/.zshrc
for plugin ($plugins); do
if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then
source $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh
elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
source $ZSH/plugins/$plugin/$plugin.plugin.zsh
fi
done
# Find python file
alias pyfind='find . -name "*.py"'
# Remove python compiled byte-code in either current directory or in a
# list of specified directories
function pyclean() {
ZSH_PYCLEAN_PLACES=${*:-'.'}
find ${ZSH_PYCLEAN_PLACES} -type f -name "*.py[co]" -delete
find ${ZSH_PYCLEAN_PLACES} -type d -name "__pycache__" -delete
}
# Grep among .py files
alias pygrep='grep --include="*.py"'
# Query/use custom command for `git`.
zstyle -s ":vcs_info:git:*:-all-" "command" _omz_git_git_cmd
: ${_omz_git_git_cmd:=git}
#
# Functions
#
# The name of the current branch
# Back-compatibility wrapper for when this function was defined here in
# the plugin, before being pulled in to core lib/git.zsh as git_current_branch()
# to fix the core -> git plugin dependency.
function current_branch() {
git_current_branch
}
# The list of remotes
function current_repository() {
if ! $_omz_git_git_cmd rev-parse --is-inside-work-tree &> /dev/null; then
return
fi
echo $($_omz_git_git_cmd remote -v | cut -d':' -f 2)
}
# Pretty log messages
function _git_log_prettily(){
if ! [ -z $1 ]; then
git log --pretty=$1
fi
}
# Warn if the current branch is a WIP
function work_in_progress() {
if $(git log -n 1 2>/dev/null | grep -q -c "\-\-wip\-\-"); then
echo "WIP!!"
fi
}
#
# Aliases
# (sorted alphabetically)
#
alias g='git'
alias ga='git add'
alias gaa='git add --all'
alias gapa='git add --patch'
alias gau='git add --update'
alias gap='git apply'
alias gb='git branch'
alias gba='git branch -a'
alias gbd='git branch -d'
alias gbda='git branch --no-color --merged | command grep -vE "^(\*|\s*(master|develop|dev)\s*$)" | command xargs -n 1 git branch -d'
alias gbl='git blame -b -w'
alias gbnm='git branch --no-merged'
alias gbr='git branch --remote'
alias gbs='git bisect'
alias gbsb='git bisect bad'
alias gbsg='git bisect good'
alias gbsr='git bisect reset'
alias gbss='git bisect start'
alias gc='git commit -v'
alias gc!='git commit -v --amend'
alias gcn!='git commit -v --no-edit --amend'
alias gca='git commit -v -a'
alias gca!='git commit -v -a --amend'
alias gcan!='git commit -v -a --no-edit --amend'
alias gcans!='git commit -v -a -s --no-edit --amend'
alias gcam='git commit -a -m'
alias gcsm='git commit -s -m'
alias gcb='git checkout -b'
alias gcf='git config --list'
alias gcl='git clone --recursive'
alias gclean='git clean -fd'
alias gpristine='git reset --hard && git clean -dfx'
alias gcm='git checkout master'
alias gcd='git checkout develop'
alias gcmsg='git commit -m'
alias gco='git checkout'
alias gcount='git shortlog -sn'
compdef _git gcount
alias gcp='git cherry-pick'
alias gcpa='git cherry-pick --abort'
alias gcpc='git cherry-pick --continue'
alias gcs='git commit -S'
alias gd='git diff'
alias gdca='git diff --cached'
alias gdcw='git diff --cached --word-diff'
alias gdct='git describe --tags `git rev-list --tags --max-count=1`'
alias gdt='git diff-tree --no-commit-id --name-only -r'
alias gdw='git diff --word-diff'
gdv() { git diff -w "$@" | view - }
compdef _git gdv=git-diff
alias gf='git fetch'
alias gfa='git fetch --all --prune'
alias gfo='git fetch origin'
function gfg() { git ls-files | grep $@ }
compdef _grep gfg
alias gg='git gui citool'
alias gga='git gui citool --amend'
ggf() {
[[ "$#" != 1 ]] && local b="$(git_current_branch)"
git push --force origin "${b:=$1}"
}
ggfl() {
[[ "$#" != 1 ]] && local b="$(git_current_branch)"
git push --force-with-lease origin "${b:=$1}"
}
compdef _git ggf=git-checkout
ggl() {
if [[ "$#" != 0 ]] && [[ "$#" != 1 ]]; then
git pull origin "${*}"
else
[[ "$#" == 0 ]] && local b="$(git_current_branch)"
git pull origin "${b:=$1}"
fi
}
compdef _git ggl=git-checkout
ggp() {
if [[ "$#" != 0 ]] && [[ "$#" != 1 ]]; then
git push origin "${*}"
else
[[ "$#" == 0 ]] && local b="$(git_current_branch)"
git push origin "${b:=$1}"
fi
}
compdef _git ggp=git-checkout
ggpnp() {
if [[ "$#" == 0 ]]; then
ggl && ggp
else
ggl "${*}" && ggp "${*}"
fi
}
compdef _git ggpnp=git-checkout
ggu() {
[[ "$#" != 1 ]] && local b="$(git_current_branch)"
git pull --rebase origin "${b:=$1}"
}
compdef _git ggu=git-checkout
alias ggpur='ggu'
compdef _git ggpur=git-checkout
alias ggpull='git pull origin $(git_current_branch)'
compdef _git ggpull=git-checkout
alias ggpush='git push origin $(git_current_branch)'
compdef _git ggpush=git-checkout
alias ggsup='git branch --set-upstream-to=origin/$(git_current_branch)'
alias gpsup='git push --set-upstream origin $(git_current_branch)'
alias ghh='git help'
alias gignore='git update-index --assume-unchanged'
alias gignored='git ls-files -v | grep "^[[:lower:]]"'
alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
compdef _git git-svn-dcommit-push=git
alias gk='\gitk --all --branches'
compdef _git gk='gitk'
alias gke='\gitk --all $(git log -g --pretty=%h)'
compdef _git gke='gitk'
alias gl='git pull'
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'
alias glol="git log --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias glola="git log --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --all"
alias glog='git log --oneline --decorate --graph'
alias gloga='git log --oneline --decorate --graph --all'
alias glp="_git_log_prettily"
compdef _git glp=git-log
alias gm='git merge'
alias gmom='git merge origin/master'
alias gmt='git mergetool --no-prompt'
alias gmtvim='git mergetool --no-prompt --tool=vimdiff'
alias gmum='git merge upstream/master'
alias gma='git merge --abort'
alias gp='git push'
alias gpd='git push --dry-run'
alias gpoat='git push origin --all && git push origin --tags'
compdef _git gpoat=git-push
alias gpu='git push upstream'
alias gpv='git push -v'
alias gr='git remote'
alias gra='git remote add'
alias grb='git rebase'
alias grba='git rebase --abort'
alias grbc='git rebase --continue'
alias grbi='git rebase -i'
alias grbm='git rebase master'
alias grbs='git rebase --skip'
alias grh='git reset HEAD'
alias grhh='git reset HEAD --hard'
alias grmv='git remote rename'
alias grrm='git remote remove'
alias grset='git remote set-url'
alias grt='cd $(git rev-parse --show-toplevel || echo ".")'
alias gru='git reset --'
alias grup='git remote update'
alias grv='git remote -v'
alias gsb='git status -sb'
alias gsd='git svn dcommit'
alias gsi='git submodule init'
alias gsps='git show --pretty=short --show-signature'
alias gsr='git svn rebase'
alias gss='git status -s'
alias gst='git status'
alias gsta='git stash save'
alias gstaa='git stash apply'
alias gstc='git stash clear'
alias gstd='git stash drop'
alias gstl='git stash list'
alias gstp='git stash pop'
alias gsts='git stash show --text'
alias gsu='git submodule update'
alias gts='git tag -s'
alias gtv='git tag | sort -V'
alias gunignore='git update-index --no-assume-unchanged'
alias gunwip='git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1'
alias gup='git pull --rebase'
alias gupv='git pull --rebase -v'
alias glum='git pull upstream master'
alias gwch='git whatchanged -p --abbrev-commit --pretty=medium'
alias gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify -m "--wip-- [skip ci]"'
# Load all of your custom configurations from custom/
for config_file ($ZSH_CUSTOM/*.zsh(N)); do
source $config_file
done
# You can put files here to add functionality separated per file, which
# will be ignored by git.
# Files on the custom/ directory will be automatically loaded by the init
# script, in alphabetical order.
# For example: add yourself some shortcuts to projects you often work on.
#
# brainstormr=~/Projects/development/planetargon/brainstormr
# cd $brainstormr
#
unset config_file
# Load the theme
if [[ "$ZSH_THEME" == "random" ]]; then
if [[ "${(t)ZSH_THEME_RANDOM_CANDIDATES}" = "array" ]] && [[ "${#ZSH_THEME_RANDOM_CANDIDATES[@]}" -gt 0 ]]; then
themes=($ZSH/themes/${^ZSH_THEME_RANDOM_CANDIDATES}.zsh-theme)
else
themes=($ZSH/themes/*zsh-theme)
fi
N=${#themes[@]}
((N=(RANDOM%N)+1))
RANDOM_THEME=${themes[$N]}
source "$RANDOM_THEME"
echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
else
if [ ! "$ZSH_THEME" = "" ]; then
if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ]; then
source "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme"
elif [ -f "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme" ]; then
source "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme"
else
source "$ZSH/themes/$ZSH_THEME.zsh-theme"
fi
fi
fi
# the idea of this theme is to contain a lot of info in a small string, by
# compressing some parts and colorcoding, which bring useful visual cues,
# while limiting the amount of colors and such to keep it easy on the eyes.
# When a command exited >0, the timestamp will be in red and the exit code
# will be on the right edge.
# The exit code visual cues will only display once.
# (i.e. they will be reset, even if you hit enter a few times on empty command prompts)
typeset -A host_repr
# translate hostnames into shortened, colorcoded strings
host_repr=('dieter-ws-a7n8x-arch' "%{$fg_bold[green]%}ws" 'dieter-p4sci-arch' "%{$fg_bold[blue]%}p4")
# local time, color coded by last return code
time_enabled="%(?.%{$fg[green]%}.%{$fg[red]%})%*%{$reset_color%}"
time_disabled="%{$fg[green]%}%*%{$reset_color%}"
time=$time_enabled
# user part, color coded by privileges
local user="%(!.%{$fg[blue]%}.%{$fg[blue]%})%n%{$reset_color%}"
# Hostname part. compressed and colorcoded per host_repr array
# if not found, regular hostname in default color
local host="@${host_repr[$HOST]:-$HOST}%{$reset_color%}"
# Compacted $PWD
local pwd="%{$fg[blue]%}%c%{$reset_color%}"
PROMPT='${time} ${user}${host} ${pwd} $(git_prompt_info)'
# i would prefer 1 icon that shows the "most drastic" deviation from HEAD,
# but lets see how this works out
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%} %{$fg[yellow]%}?%{$fg[green]%}%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}"
# elaborate exitcode on the right when >0
return_code_enabled="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
return_code_disabled=
return_code=$return_code_enabled
RPS1='${return_code}'
function accept-line-or-clear-warning () {
if [[ -z $BUFFER ]]; then
time=$time_disabled
return_code=$return_code_disabled
else
time=$time_enabled
return_code=$return_code_enabled
fi
zle accept-line
}
zle -N accept-line-or-clear-warning
bindkey '^M' accept-line-or-clear-warning
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# ssh
# export SSH_KEY_PATH="~/.ssh/rsa_id"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
unset file
# /etc/zsh/zshenv: system-wide .zshenv file for zsh(1).
#
# This file is sourced on all invocations of the shell.
# If the -f flag is present or if the NO_RCS option is
# set within this file, all other initialization files
# are skipped.
#
# This file should contain commands to set the command
# search path, plus other important environment variables.
# This file should not contain commands that produce
# output or assume the shell is attached to a tty.
#
# Global Order: zshenv, zprofile, zshrc, zlogin
if [[ -z "$PATH" || "$PATH" == "/bin:/usr/bin" ]]
then
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/games"
fi
export PYTHONPATH=.:..
export TMPDIR=/tmp
export PATH=$PATH:/opt/1A/bin
umask 022
# /etc/zsh/zshrc: system-wide .zshrc file for zsh(1).
#
# This file is sourced only for interactive shells. It
# should contain commands to set up aliases, functions,
# options, key bindings, etc.
#
# Global Order: zshenv, zprofile, zshrc, zlogin
READNULLCMD=${PAGER:-/usr/bin/pager}
# An array to note missing features to ease diagnosis in case of problems.
typeset -ga debian_missing_features
if [[ -z "$DEBIAN_PREVENT_KEYBOARD_CHANGES" ]] &&
[[ "$TERM" != 'emacs' ]]
then
typeset -A key
key=(
BackSpace "${terminfo[kbs]}"
Home "${terminfo[khome]}"
End "${terminfo[kend]}"
Insert "${terminfo[kich1]}"
Delete "${terminfo[kdch1]}"
Up "${terminfo[kcuu1]}"
Down "${terminfo[kcud1]}"
Left "${terminfo[kcub1]}"
Right "${terminfo[kcuf1]}"
PageUp "${terminfo[kpp]}"
PageDown "${terminfo[knp]}"
)
function bind2maps () {
local i sequence widget
local -a maps
while [[ "$1" != "--" ]]; do
maps+=( "$1" )
shift
done
shift
sequence="${key[$1]}"
widget="$2"
[[ -z "$sequence" ]] && return 1
for i in "${maps[@]}"; do
bindkey -M "$i" "$sequence" "$widget"
done
}
bind2maps emacs -- BackSpace backward-delete-char
bind2maps viins -- BackSpace vi-backward-delete-char
bind2maps vicmd -- BackSpace vi-backward-char
bind2maps emacs -- Home beginning-of-line
bind2maps viins vicmd -- Home vi-beginning-of-line
bind2maps emacs -- End end-of-line
bind2maps viins vicmd -- End vi-end-of-line
bind2maps emacs viins -- Insert overwrite-mode
bind2maps vicmd -- Insert vi-insert
bind2maps emacs -- Delete delete-char
bind2maps viins vicmd -- Delete vi-delete-char
bind2maps emacs viins vicmd -- Up up-line-or-history
bind2maps emacs viins vicmd -- Down down-line-or-history
bind2maps emacs -- Left backward-char
bind2maps viins vicmd -- Left vi-backward-char
bind2maps emacs -- Right forward-char
bind2maps viins vicmd -- Right vi-forward-char
# Make sure the terminal is in application mode, when zle is
# active. Only then are the values from $terminfo valid.
if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
function zle-line-init () {
emulate -L zsh
printf '%s' ${terminfo[smkx]}
}
function zle-line-finish () {
emulate -L zsh
printf '%s' ${terminfo[rmkx]}
}
zle -N zle-line-init
zle -N zle-line-finish
else
for i in {s,r}mkx; do
(( ${+terminfo[$i]} )) || debian_missing_features+=($i)
done
unset i
fi
unfunction bind2maps
fi # [[ -z "$DEBIAN_PREVENT_KEYBOARD_CHANGES" ]] && [[ "$TERM" != 'emacs' ]]
zstyle ':completion:*:sudo:*' command-path /usr/local/sbin \
/usr/local/bin \
/usr/sbin \
/usr/bin \
/sbin \
/bin \
/usr/X11R6/bin
(( ${+aliases[run-help]} )) && unalias run-help
autoload -Uz run-help
# If you don't want compinit called here, place the line
# skip_global_compinit=1
# in your $ZDOTDIR/.zshenv or $ZDOTDIR/.zprofile
if [[ -z "$skip_global_compinit" ]]; then
autoload -U compinit
compinit
fi
#files: 769 version: 5.1.1
_comps=(
'-' '_precommand'
'.' '_source'
'5g' '_go'
'5l' '_go'
'6g' '_go'
'6l' '_go'
'8g' '_go'
'8l' '_go'
'a2dismod' '_a2utils'
'a2dissite' '_a2utils'
'a2enmod' '_a2utils'
'a2ensite' '_a2utils'
'a2ps' '_a2ps'
'aaaa' '_hosts'
'aap' '_aap'
'acpi' '_acpi'
'acpitool' '_acpitool'
'acroread' '_acroread'
'adb' '_adb'
'add-zsh-hook' '_add-zsh-hook'
'admin' '_sccs'
'ali' '_mh'
'alias' '_alias'
'amaya' '_webbrowser'
'analyseplugin' '_analyseplugin'
'animate' '_imagemagick'
'anno' '_mh'
'ant' '_ant'
'antiword' '_antiword'
'aoss' '_precommand'
'apache2ctl' '_apachectl'
'apachectl' '_apachectl'
'apm' '_apm'
'appletviewer' '_java'
'apropos' '_man'
'apt' '_apt'
'apt-cache' '_apt'
'apt-cdrom' '_apt'
'apt-config' '_apt'
'apt-file' '_apt-file'
'apt-get' '_apt'
'aptitude' '_aptitude'
'apt-mark' '_apt'
'apt-move' '_apt-move'
'apt-show-versions' '_apt-show-versions'
'apvlv' '_pdf'
'arena' '_webbrowser'
'arp' '_arp'
'arping' '_arping'
'-array-value-' '_value'
'-assign-parameter-' '_assign'
'at' '_at'
'atq' '_at'
'atrm' '_at'
'attr' '_attr'
'augtool' '_augeas'
'auto-apt' '_auto-apt'
'autoload' '_typeset'
'awk' '_awk'
'axi-cache' '_axi-cache'
'bash' '_sh'
'batch' '_at'
'baz' '_baz'
'beadm' '_beadm'
'_beep' '_beep'
'bg' '_jobs_bg'
'bindkey' '_bindkey'
'bison' '_bison'
'bmake' '_make'
'bogofilter' '_bogofilter'
'bogotune' '_bogofilter'
'bogoutil' '_bogofilter'
'bootctl' '_bootctl'
'bpython' '_bpython'
'bpython2' '_bpython'
'bpython2-gtk' '_bpython'
'bpython2-urwid' '_bpython'
'bpython3' '_bpython'
'bpython3-gtk' '_bpython'
'bpython3-urwid' '_bpython'
'bpython-gtk' '_bpython'
'bpython-urwid' '_bpython'
'-brace-parameter-' '_brace_parameter'
'brctl' '_brctl'
'bsdconfig' '_bsdconfig'
'bsdgrep' '_grep'
'bsdinstall' '_bsdinstall'
'btdownloadcurses' '_bittorrent'
'btdownloadgui' '_bittorrent'
'btdownloadheadless' '_bittorrent'
'btlaunchmany' '_bittorrent'
'btlaunchmanycurses' '_bittorrent'
'btmakemetafile' '_bittorrent'
'btreannounce' '_bittorrent'
'btrename' '_bittorrent'
'btrfs' '_btrfs'
'bts' '_bts'
'btshowmetainfo' '_bittorrent'
'bttrack' '_bittorrent'
'bug' '_bug'
'buildhash' '_ispell'
'builtin' '_builtin'
'bunzip2' '_bzip2'
'burst' '_mh'
'busctl' '_busctl'
'bzcat' '_bzip2'
'bzip2' '_bzip2'
'bzip2recover' '_bzip2'
'bzr' '_bzr'
'c++' '_gcc'
'cabal' '_cabal'
'cal' '_cal'
'calendar' '_calendar'
'cat' '_cat'
'catchsegv' '_precommand'
'cc' '_gcc'
'ccal' '_ccal'
'cd' '_cd'
'cdbs-edit-patch' '_cdbs-edit-patch'
'cdc' '_sccs'
'cdcd' '_cdcd'
'cdr' '_cdr'
'cdrdao' '_cdrdao'
'cdrecord' '_cdrecord'
'certtool' '_gnutls'
'cftp' '_twisted'
'chage' '_users'
'chdir' '_cd'
'chflags' '_chflags'
'chfn' '_users'
'chgrp' '_chown'
'chimera' '_webbrowser'
'chkconfig' '_chkconfig'
'chmod' '_chmod'
'chown' '_chown'
'chpass' '_chsh'
'chrt' '_chrt'
'chsh' '_chsh'
'ci' '_rcs'
'ckeygen' '_twisted'
'clang' '_gcc'
'clang++' '_gcc'
'clay' '_clay'
'clear' '_nothing'
'cmp' '_cmp'
'co' '_rcs'
'comb' '_sccs'
'combine' '_imagemagick'
'combinediff' '_patchutils'
'comm' '_comm'
'command' '_command'
'-command-' '_autocd'
'-command-line-' '_normal'
'comp' '_mh'
'compadd' '_compadd'
'compdef' '_compdef'
'composite' '_imagemagick'
'compress' '_compress'
'conch' '_twisted'
'-condition-' '_condition'
'config.status' '_configure'
'configure' '_configure'
'convert' '_imagemagick'
'coreadm' '_coreadm'
'cowsay' '_cowsay'
'cowthink' '_cowsay'
'cp' '_cp'
'cpio' '_cpio'
'cplay' '_cplay'
'crsh' '_cssh'
'cryptsetup' '_cryptsetup'
'csh' '_sh'
'cssh' '_cssh'
'csup' '_csup'
'curl' '_curl'
'cut' '_cut'
'cvs' '_cvs'
'cvsup' '_cvsup'
'cygcheck' '_cygcheck'
'cygcheck.exe' '_cygcheck'
'cygpath' '_cygpath'
'cygpath.exe' '_cygpath'
'cygrunsrv' '_cygrunsrv'
'cygrunsrv.exe' '_cygrunsrv'
'cygserver' '_cygserver'
'cygserver.exe' '_cygserver'
'cygstart' '_cygstart'
'cygstart.exe' '_cygstart'
'dak' '_dak'
'darcs' '_darcs'
'date' '_date'
'dbus-monitor' '_dbus'
'dbus-send' '_dbus'
'dch' '_debchange'
'dchroot' '_dchroot'
'dchroot-dsa' '_dchroot-dsa'
'dcop' '_dcop'
'dcopclient' '_dcop'
'dcopfind' '_dcop'
'dcopobject' '_dcop'
'dcopref' '_dcop'
'dcopstart' '_dcop'
'dcut' '_dcut'
'dd' '_dd'
'debchange' '_debchange'
'debcheckout' '_debcheckout'
'debdiff' '_debdiff'
'debfoster' '_debfoster'
'debsign' '_debsign'
'declare' '_typeset'
'-default-' '_default'
'defaults' '_defaults'
'delta' '_sccs'
'devtodo' '_devtodo'
'df' '_df'
'dhclient' '_dhclient'
'dhclient3' '_dhclient'
'dhcpinfo' '_dhcpinfo'
'dict' '_dict'
'diff' '_diff'
'diffstat' '_diffstat'
'dillo' '_webbrowser'
'dircmp' '_directories'
'dirs' '_dirs'
'disable' '_disable'
'disown' '_jobs_fg'
'display' '_imagemagick'
'dist' '_mh'
'django-admin' '_django'
'django-admin.py' '_django'
'dladm' '_dladm'
'dlocate' '_dlocate'
'dmake' '_make'
'dmidecode' '_dmidecode'
'dnf' '_dnf'
'docker' '_docker'
'docker-compose' '_docker-compose'
'dockerd' '_docker'
'domainname' '_yp'
'dosdel' '_floppy'
'dosread' '_floppy'
'dpatch-edit-patch' '_dpatch-edit-patch'
'dpkg' '_dpkg'
'dpkg-buildpackage' '_dpkg-buildpackage'
'dpkg-cross' '_dpkg-cross'
'dpkg-deb' '_dpkg'
'dpkg-query' '_dpkg'
'dpkg-reconfigure' '_dpkg'
'dpkg-repack' '_dpkg-repack'
'dpkg-source' '_dpkg_source'
'dput' '_dput'
'dsh' '_dsh'
'dtrace' '_dtrace'
'du' '_du'
'dumpadm' '_dumpadm'
'dumper' '_dumper'
'dumper.exe' '_dumper'
'dupload' '_dupload'
'dvibook' '_dvi'
'dviconcat' '_dvi'
'dvicopy' '_dvi'
'dvidvi' '_dvi'
'dvipdf' '_dvi'
'dvips' '_dvi'
'dviselect' '_dvi'
'dvitodvi' '_dvi'
'dvitype' '_dvi'
'dwb' '_webbrowser'
'ecasound' '_ecasound'
'echotc' '_echotc'
'echoti' '_echoti'
'egrep' '_grep'
'elfdump' '_elfdump'
'elinks' '_elinks'
'elm' '_elm'
'emulate' '_emulate'
'enable' '_enable'
'enscript' '_enscript'
'env' '_env'
'epdfview' '_pdf'
'epsffit' '_psutils'
'-equal-' '_equal'
'erb' '_ruby'
'espeak' '_espeak'
'etags' '_etags'
'ethtool' '_ethtool'
'eu-nm' '_nm'
'eu-readelf' '_readelf'
'eval' '_precommand'
'eview' '_vim'
'evim' '_vim'
'evince' '_pspdf'
'exec' '_precommand'
'explodepkg' '_pkgtool'
'export' '_typeset'
'express' '_webbrowser'
'extcheck' '_java'
'extractres' '_psutils'
'fakeroot' '_fakeroot'
'false' '_nothing'
'fc' '_fc'
'fc-list' '_xft_fonts'
'fc-match' '_xft_fonts'
'feh' '_feh'
'fetch' '_fetch'
'fetchmail' '_fetchmail'
'ffmpeg' '_ffmpeg'
'fg' '_jobs_fg'
'fgrep' '_grep'
'figlet' '_figlet'
'filterdiff' '_patchutils'
'find' '_find'
'findaffix' '_ispell'
'finger' '_finger'
'fink' '_fink'
'firefox' '_mozilla'
'-first-' '_first'
'fixdlsrps' '_psutils'
'fixfmps' '_psutils'
'fixmacps' '_psutils'
'fixpsditps' '_psutils'
'fixpspps' '_psutils'
'fixscribeps' '_psutils'
'fixtpps' '_psutils'
'fixwfwps' '_psutils'
'fixwpps' '_psutils'
'fixwwps' '_psutils'
'flasher' '_flasher'
'flex' '_flex'
'flipdiff' '_patchutils'
'flist' '_mh'
'flists' '_mh'
'float' '_typeset'
'flowadm' '_flowadm'
'fmadm' '_fmadm'
'fmttest' '_mh'
'fned' '_zed'
'fnext' '_mh'
'folder' '_mh'
'folders' '_mh'
'fortune' '_fortune'
'forw' '_mh'
'fprev' '_mh'
'freebsd-make' '_make'
'freebsd-update' '_freebsd-update'
'fsh' '_fsh'
'fstat' '_fstat'
'ftp' '_hosts'
'functions' '_typeset'
'fuser' '_fuser'
'fusermount' '_fusermount'
'fwhois' '_whois'
'g++' '_gcc'
'galeon' '_webbrowser'
'gcc' '_gcc'
'gccgo' '_go'
'gchmod' '_chmod'
'gcmp' '_cmp'
'gcomm' '_comm'
'gcore' '_gcore'
'gcp' '_cp'
'gdate' '_date'
'gdb' '_gdb'
'gdiff' '_diff'
'gdu' '_du'
'genisoimage' '_genisoimage'
'get' '_sccs'
'getafm' '_psutils'
'getclip' '_getclip'
'getclip.exe' '_getclip'
'getconf' '_getconf'
'getent' '_getent'
'getfacl' '_getfacl'
'getfacl.exe' '_getfacl'
'getfattr' '_attr'
'getmail' '_getmail'
'getopts' '_vars'
'gex' '_vim'
'gfind' '_find'
'ggv' '_gnome-gv'
'ghostscript' '_gs'
'ghostview' '_pspdf'
'gid' '_id'
'git' '_git'
'git-buildpackage' '_git-buildpackage'
'git-cvsserver' '_git'
'gitk' '_git'
'git-receive-pack' '_git'
'git-shell' '_git'
'git-upload-archive' '_git'
'git-upload-pack' '_git'
'gjoin' '_join'
'gln' '_ln'
'global' '_global'
'gls' '_ls'
'gm' '_graphicsmagick'
'gmake' '_make'
'gmd5sum' '_md5sum'
'gmkdir' '_mkdir'
'gmplayer' '_mplayer'
'gnl' '_nl'
'gnome-gv' '_gnome-gv'
'gnupod_addsong' '_gnupod'
'gnupod_addsong.pl' '_gnupod'
'gnupod_check' '_gnupod'
'gnupod_check.pl' '_gnupod'
'gnupod_INIT' '_gnupod'
'gnupod_INIT.pl' '_gnupod'
'gnupod_search' '_gnupod'
'gnupod_search.pl' '_gnupod'
'gnutls-cli' '_gnutls'
'gnutls-cli-debug' '_gnutls'
'god' '_od'
'gofmt' '_go'
'gpatch' '_patch'
'gpg' '_gpg'
'gpg2' '_gpg'
'gpgv' '_gpg'
'gpg-zip' '_gpg'
'gphoto2' '_gphoto2'
'gprof' '_gprof'
'gqview' '_gqview'
'gradle' '_gradle'
'gradlew' '_gradle'
'grail' '_webbrowser'
'grep' '_grep'
'grepdiff' '_patchutils'
'grep-excuses' '_grep-excuses'
'grm' '_rm'
'groff' '_groff'
'groupadd' '_user_admin'
'groupdel' '_groups'
'groupmod' '_user_admin'
'groups' '_users'
'growisofs' '_growisofs'
'gs' '_gs'
'gsbj' '_pspdf'
'gsdj' '_pspdf'
'gsdj500' '_pspdf'
'gsed' '_sed'
'gslj' '_pspdf'
'gslp' '_pspdf'
'gsnd' '_pspdf'
'gsort' '_sort'
'gtar' '_tar'
'guilt' '_guilt'
'guilt-add' '_guilt'
'guilt-applied' '_guilt'
'guilt-delete' '_guilt'
'guilt-files' '_guilt'
'guilt-fold' '_guilt'
'guilt-fork' '_guilt'
'guilt-header' '_guilt'
'guilt-help' '_guilt'
'guilt-import' '_guilt'
'guilt-import-commit' '_guilt'
'guilt-init' '_guilt'
'guilt-new' '_guilt'
'guilt-next' '_guilt'
'guilt-patchbomb' '_guilt'
'guilt-pop' '_guilt'
'guilt-prev' '_guilt'
'guilt-push' '_guilt'
'guilt-rebase' '_guilt'
'guilt-refresh' '_guilt'
'guilt-rm' '_guilt'
'guilt-series' '_guilt'
'guilt-status' '_guilt'
'guilt-top' '_guilt'
'guilt-unapplied' '_guilt'
'guniq' '_uniq'
'gunzip' '_gzip'
'gv' '_gv'
'gview' '_vim'
'gvim' '_vim'
'gvimdiff' '_vim'
'gwc' '_wc'
'gxargs' '_xargs'
'gzcat' '_gzip'
'gzilla' '_webbrowser'
'gzip' '_gzip'
'hash' '_hash'
'hdiutil' '_hdiutil'
'help' '_sccs'
'hg' '_hg'
'hilite' '_precommand'
'history' '_fc'
'host' '_hosts'
'hostnamectl' '_hostnamectl'
'hotjava' '_webbrowser'
'hwinfo' '_hwinfo'
'iceweasel' '_mozilla'
'icombine' '_ispell'
'iconv' '_iconv'
'id' '_id'
'identify' '_imagemagick'
'ifconfig' '_ifconfig'
'ifdown' '_net_interfaces'
'iftop' '_iftop'
'ifup' '_net_interfaces'
'ijoin' '_ispell'
'import' '_imagemagick'
'inc' '_mh'
'includeres' '_psutils'
'inetadm' '_inetadm'
'info' '_texinfo'
'infocmp' '_terminals'
'initctl' '_initctl'
'insmod' '_modutils'
'install-info' '_texinfo'
'installpkg' '_pkgtool'
'integer' '_typeset'
'interdiff' '_patchutils'
'invoke-rc.d' '_invoke-rc.d'
'ionice' '_ionice'
'ip' '_ip'
'ipadm' '_ipadm'
'ipset' '_ipset'
'iptables' '_iptables'
'iptables-restore' '_iptables'
'iptables-save' '_iptables'
'irb' '_ruby'
'irssi' '_irssi'
'ispell' '_ispell'
'iwconfig' '_iwconfig'
'jadetex' '_tex'
'jar' '_java'
'jarsigner' '_java'
'java' '_java'
'javac' '_java'
'javadoc' '_java'
'javah' '_java'
'javap' '_java'
'jdb' '_java'
'jexec' '_jexec'
'jls' '_jls'
'jobs' '_jobs_builtin'
'joe' '_joe'
'join' '_join'
'journalctl' '_journalctl'
'keytool' '_java'
'kfmclient' '_kfmclient'
'kill' '_kill'
'killall' '_killall'
'killall5' '_killall'
'kioclient' '_kfmclient'
'kldload' '_kld'
'kldunload' '_kld'
'knock' '_knock'
'konqueror' '_webbrowser'
'kpdf' '_pdf'
'ksh' '_sh'
'kvno' '_kvno'
'last' '_last'
'lastb' '_last'
'latex' '_tex'
'latexmk' '_tex'
'ldd' '_ldd'
'less' '_less'
'let' '_math'
'lftp' '_ncftp'
'lha' '_lha'
'light' '_webbrowser'
'lighty-disable-mod' '_lighttpd'
'lighty-enable-mod' '_lighttpd'
'limit' '_limit'
'links' '_links'
'lintian' '_lintian'
'lintian-info' '_lintian'
'linux' '_uml'
'llvm-g++' '_gcc'
'llvm-gcc' '_gcc'
'ln' '_ln'
'loadkeys' '_loadkeys'
'local' '_typeset'
'localectl' '_localectl'
'locate' '_locate'
'log' '_nothing'
'loginctl' '_loginctl'
'logname' '_nothing'
'look' '_look'
'lore' '_twisted'
'losetup' '_losetup'
'lp' '_lp'
'lpadmin' '_lp'
'lpinfo' '_lp'
'lpoptions' '_lp'
'lpq' '_lp'
'lpr' '_lp'
'lprm' '_lp'
'lpstat' '_lp'
'ls' '_ls'
'lscfg' '_lscfg'
'lsdev' '_lsdev'
'lsdiff' '_patchutils'
'lslv' '_lslv'
'lsmod' '_modutils'
'lsof' '_lsof'
'lspv' '_lspv'
'lsusb' '_lsusb'
'lsvg' '_lsvg'
'lynx' '_lynx'
'lzcat' '_xz'
'lzma' '_xz'
'lzop' '_lzop'
'm-a' '_module-assistant'
'madison' '_madison'
'mail' '_mail'
'Mail' '_mail'
'mailx' '_mail'
'make' '_make'
'makeinfo' '_texinfo'
'make-kpkg' '_make-kpkg'
'makepkg' '_pkgtool'
'man' '_man'
'manage.py' '_django'
'manhole' '_twisted'
'mark' '_mh'
'-math-' '_math'
'matlab' '_matlab'
'mattrib' '_mtools'
'mcd' '_mtools'
'mcopy' '_mtools'
'md5sum' '_md5sum'
'mdadm' '_mdadm'
'mdel' '_mtools'
'mdeltree' '_mtools'
'mdir' '_mtools'
'mdu' '_mtools'
'members' '_members'
'mencal' '_mencal'
'mere' '_mere'
'merge' '_rcs'
'mergechanges' '_mergechanges'
'metaflac' '_metaflac'
'mformat' '_mtools'
'mgv' '_pspdf'
'mhfixmsg' '_mh'
'mhlist' '_mh'
'mhmail' '_mh'
'mhn' '_mh'
'mhparam' '_mh'
'mhpath' '_mh'
'mhshow' '_mh'
'mhstore' '_mh'
'mii-tool' '_mii-tool'
'mixerctl' '_mixerctl'
'mkdir' '_mkdir'
'mkisofs' '_growisofs'
'mkshortcut' '_mkshortcut'
'mkshortcut.exe' '_mkshortcut'
'mktunes' '_gnupod'
'mktunes.pl' '_gnupod'
'mkzsh' '_mkzsh'
'mkzsh.exe' '_mkzsh'
'mlabel' '_mtools'
'mlocate' '_locate'
'mmd' '_mtools'
'mmm' '_webbrowser'
'mmount' '_mtools'
'mmove' '_mtools'
'modinfo' '_modutils'
'modprobe' '_modutils'
'module' '_module'
'module-assistant' '_module-assistant'
'mogrify' '_imagemagick'
'mondoarchive' '_mondo'
'montage' '_imagemagick'
'moosic' '_moosic'
'Mosaic' '_webbrowser'
'mosh' '_mosh'
'mount' '_mount'
'mozilla' '_mozilla'
'mozilla-firefox' '_mozilla'
'mozilla-xremote-client' '_mozilla'
'mpc' '_mpc'
'mplayer' '_mplayer'
'mrd' '_mtools'
'mread' '_mtools'
'mren' '_mtools'
'msgchk' '_mh'
'mt' '_mt'
'mtn' '_monotone'
'mtoolstest' '_mtools'
'mtr' '_mtr'
'mtype' '_mtools'
'munchlist' '_ispell'
'mupdf' '_pdf'
'mush' '_mail'
'mutt' '_mutt'
'mx' '_hosts'
'mysql' '_mysql_utils'
'mysqladmin' '_mysql_utils'
'mysqldiff' '_mysqldiff'
'mysqldump' '_mysql_utils'
'mysqlimport' '_mysql_utils'
'mysqlshow' '_mysql_utils'
'nail' '_mail'
'native2ascii' '_java'
'nautilus' '_nautilus'
'nc' '_netcat'
'ncal' '_cal'
'ncftp' '_ncftp'
'ncl' '_nedit'
'nedit' '_nedit'
'nedit-nc' '_nedit'
'netcat' '_netcat'
'netrik' '_webbrowser'
'netscape' '_netscape'
'netstat' '_netstat'
'new' '_mh'
'newgrp' '_groups'
'next' '_mh'
'nice' '_nice'
'nkf' '_nkf'
'nl' '_nl'
'nm' '_nm'
'nmap' '_nmap'
'nmblookup' '_samba'
'nmcli' '_nmcli'
'nocorrect' '_precommand'
'noglob' '_precommand'
'nohup' '_precommand'
'notmuch' '_notmuch'
'npm' '_npm'
'ns' '_hosts'
'nslookup' '_nslookup'
'ntalk' '_other_accounts'
'nvim' '_vim'
'od' '_od'
'odme' '_object_classes'
'odmget' '_object_classes'
'odmshow' '_object_classes'
'ogg123' '_vorbis'
'oggdec' '_vorbis'
'oggenc' '_vorbis'
'ogginfo' '_vorbis'
'okular' '_okular'
'open' '_open'
'opera' '_webbrowser'
'opera-next' '_webbrowser'
'osc' '_osc'
'p4' '_perforce'
'p4d' '_perforce'
'pacat' '_pulseaudio'
'pack' '_pack'
'packf' '_mh'
'pacmd' '_pulseaudio'
'pactl' '_pulseaudio'
'padsp' '_pulseaudio'
'paplay' '_pulseaudio'
'-parameter-' '_parameter'
'parec' '_pulseaudio'
'parecord' '_pulseaudio'
'parsehdlist' '_urpmi'
'passwd' '_users'
'pasuspender' '_pulseaudio'
'patch' '_patch'
'pax' '_pax'
'pbuilder' '_pbuilder'
'pcat' '_pack'
'pcred' '_pids'
'pdf2dsc' '_pdf'
'pdf2ps' '_pdf'
'pdffonts' '_pdf'
'pdfimages' '_pdf'
'pdfinfo' '_pdf'
'pdfjadetex' '_tex'
'pdflatex' '_tex'
'pdfopt' '_pdf'
'pdftex' '_tex'
'pdftk' '_pdftk'
'pdftopbm' '_pdf'
'pdftops' '_pdf'
'pdftotext' '_pdf'
'perl' '_perl'
'perldoc' '_perldoc'
'pfctl' '_pfctl'
'pfexec' '_pfexec'
'pfiles' '_pids'
'pflags' '_pids'
'pgrep' '_pgrep'
'php' '_php'
'pick' '_mh'
'pigz' '_gzip'
'pine' '_pine'
'pinef' '_pine'
'ping' '_ping'
'piuparts' '_piuparts'
'pkg' '_pkg5'
'pkgadd' '_pkgadd'
'pkg_add' '_bsd_pkg'
'pkg-config' '_pkg-config'
'pkg_create' '_bsd_pkg'
'pkg_delete' '_bsd_pkg'
'pkginfo' '_pkginfo'
'pkg_info' '_bsd_pkg'
'pkgrm' '_pkgrm'
'pkgtool' '_pkgtool'
'pkill' '_pgrep'
'pldd' '_pids'
'pmake' '_make'
'pman' '_perl_modules'
'pmap' '_pids'
'pmcat' '_perl_modules'
'pmdesc' '_perl_modules'
'pmeth' '_perl_modules'
'pmexp' '_perl_modules'
'pmfunc' '_perl_modules'
'pmload' '_perl_modules'
'pmls' '_perl_modules'
'pmpath' '_perl_modules'
'pmvers' '_perl_modules'
'podgrep' '_perl_modules'
'podpath' '_perl_modules'
'podtoc' '_perl_modules'
'poff' '_pon'
'policytool' '_java'
'pon' '_pon'
'popd' '_directory_stack'
'portaudit' '_portaudit'
'portlint' '_portlint'
'portmaster' '_portmaster'
'portsnap' '_portsnap'
'postsuper' '_postfix'
'powerd' '_powerd'
'prcs' '_prcs'
'prev' '_mh'
'print' '_print'
'printenv' '_printenv'
'printf' '_print'
'procstat' '_procstat'
'prompt' '_prompt'
'prove' '_prove'
'prs' '_sccs'
'prstat' '_prstat'
'prt' '_sccs'
'prun' '_pids'
'ps' '_ps'
'ps2ascii' '_pspdf'
'ps2epsi' '_postscript'
'ps2pdf' '_postscript'
'ps2pdf12' '_postscript'
'ps2pdf13' '_postscript'
'ps2pdf14' '_postscript'
'ps2pdfwr' '_postscript'
'ps2ps' '_postscript'
'psbook' '_psutils'
'pscp' '_pscp'
'pscp.exe' '_pscp'
'psed' '_sed'
'psig' '_pids'
'psmerge' '_psutils'
'psmulti' '_postscript'
'psnup' '_psutils'
'psresize' '_psutils'
'psselect' '_psutils'
'pstack' '_pids'
'pstoedit' '_pspdf'
'pstop' '_pids'
'pstops' '_psutils'
'pstotgif' '_pspdf'
'pswrap' '_postscript'
'ptree' '_ptree'
'pulseaudio' '_pulseaudio'
'pump' '_pump'
'pushd' '_cd'
'putclip' '_putclip'
'putclip.exe' '_putclip'
'pwait' '_pids'
'pwdx' '_pids'
'pyhtmlizer' '_twisted'
'qdbus' '_qdbus'
'qiv' '_qiv'
'qtplay' '_qtplay'
'querybts' '_bug'
'quilt' '_quilt'
'r' '_fc'
'raggle' '_raggle'
'rake' '_rake'
'ranlib' '_ranlib'
'rar' '_rar'
'rc' '_sh'
'rcp' '_rlogin'
'rcs' '_rcs'
'rcsdiff' '_rcs'
'rdesktop' '_rdesktop'
'read' '_read'
'readelf' '_readelf'
'readonly' '_typeset'
'readshortcut' '_readshortcut'
'readshortcut.exe' '_readshortcut'
'rebootin' '_rebootin'
'-redirect-' '_redirect'
'-redirect-,<,bunzip2' '_bzip2'
'-redirect-,<,bzip2' '_bzip2'
'-redirect-,>,bzip2' '_bzip2'
'-redirect-,<,compress' '_compress'
'-redirect-,>,compress' '_compress'
'-redirect-,-default-,-default-' '_files'
'-redirect-,<,gunzip' '_gzip'
'-redirect-,<,gzip' '_gzip'
'-redirect-,>,gzip' '_gzip'
'-redirect-,<,uncompress' '_compress'
'-redirect-,<,unxz' '_xz'
'-redirect-,<,xz' '_xz'
'-redirect-,>,xz' '_xz'
'refile' '_mh'
'rehash' '_hash'
'reload' '_initctl'
'removepkg' '_pkgtool'
'remsh' '_rlogin'
'renice' '_renice'
'repl' '_mh'
'reportbug' '_bug'
'reprepro' '_reprepro'
'restart' '_initctl'
'retawq' '_webbrowser'
'rgview' '_vim'
'rgvim' '_vim'
'ri' '_ri'
'rlogin' '_rlogin'
'rm' '_rm'
'rmadison' '_madison'
'rmdel' '_sccs'
'rmdir' '_directories'
'rmf' '_mh'
'rmic' '_java'
'rmid' '_java'
'rmiregistry' '_java'
'rmm' '_mh'
'rmmod' '_modutils'
'rpm' '_rpm'
'rpmbuild' '_rpmbuild'
'rrdtool' '_rrdtool'
'rsh' '_rlogin'
'rsync' '_rsync'
'rtin' '_tin'
'rubber' '_rubber'
'rubber-info' '_rubber'
'rubber-pipe' '_rubber'
'ruby' '_ruby'
'run-help' '_run-help'
'rup' '_hosts'
'rusage' '_precommand'
'rview' '_vim'
'rvim' '_vim'
'rwho' '_hosts'
'rxvt' '_urxvt'
's2p' '_sed'
'sabcmd' '_sablotron'
'sact' '_sccs'
'savecore' '_savecore'
'scan' '_mh'
'sccs' '_sccs'
'sccsdiff' '_sccs'
'sched' '_sched'
'schedtool' '_schedtool'
'schroot' '_schroot'
'scp' '_ssh'
'screen' '_screen'
'sed' '_sed'
'serialver' '_java'
'service' '_service'
'set' '_set'
'setfacl' '_setfacl'
'setfacl.exe' '_setfacl'
'setfattr' '_attr'
'setopt' '_setopt'
'sftp' '_ssh'
'sh' '_sh'
'shift' '_arrays'
'show' '_mh'
'showchar' '_psutils'
'showmount' '_showmount'
'sisu' '_sisu'
'skipstone' '_webbrowser'
'slitex' '_tex'
'slocate' '_locate'
'slogin' '_ssh'
'slrn' '_slrn'
'smbclient' '_samba'
'smbcontrol' '_samba'
'smbstatus' '_samba'
'smit' '_smit'
'smitty' '_smit'
'snoop' '_snoop'
'soa' '_hosts'
'socket' '_socket'
'sockstat' '_sockstat'
'softwareupdate' '_softwareupdate'
'sort' '_sort'
'sortm' '_mh'
'source' '_source'
'spamassassin' '_spamassassin'
'splitdiff' '_patchutils'
'sqlite' '_sqlite'
'sqlite3' '_sqlite'
'sqsh' '_sqsh'
'sr' '_surfraw'
'srptool' '_gnutls'
'ss' '_ss'
'ssh' '_ssh'
'ssh-add' '_ssh'
'ssh-agent' '_ssh'
'ssh-copy-id' '_ssh'
'sshfs' '_sshfs'
'ssh-keygen' '_ssh'
'star' '_tar'
'start' '_initctl'
'stat' '_stat'
'status' '_initctl'
'stg' '_stgit'
'stop' '_initctl'
'strace' '_strace'
'strftime' '_strftime'
'strip' '_strip'
'stty' '_stty'
'su' '_su'
'-subscript-' '_subscript'
'sudo' '_sudo'
'sudoedit' '_sudo'
'surfraw' '_surfraw'
'SuSEconfig' '_SUSEconfig'
'sv' '_runit'
'svcadm' '_svcadm'
'svccfg' '_svccfg'
'svcprop' '_svcprop'
'svcs' '_svcs'
'svn' '_subversion'
'svnadmin' '_subversion'
'svnadmin-static' '_subversion'
'svn-buildpackage' '_svn-buildpackage'
'sync' '_nothing'
'sysctl' '_sysctl'
'systat' '_systat'
'systemctl' '_systemctl'
'systemd-analyze' '_systemd-analyze'
'systemd-ask-password' '_systemd'
'systemd-cat' '_systemd'
'systemd-cgls' '_systemd'
'systemd-cgtop' '_systemd'
'systemd-delta' '_systemd-delta'
'systemd-detect-virt' '_systemd'
'systemd-inhibit' '_systemd-inhibit'
'systemd-machine-id-setup' '_systemd'
'systemd-notify' '_systemd'
'systemd-run' '_systemd-run'
'systemd-tmpfiles' '_systemd-tmpfiles'
'systemd-tty-ask-password-agent' '_systemd'
'system_profiler' '_system_profiler'
'talk' '_other_accounts'
'tap2deb' '_twisted'
'tap2rpm' '_twisted'
'tapconvert' '_twisted'
'tar' '_tar'
'tardy' '_tardy'
'tcpdump' '_tcpdump'
'tcp_open' '_tcpsys'
'tcptraceroute' '_tcptraceroute'
'tcsh' '_sh'
'tda' '_devtodo'
'tdd' '_devtodo'
'tde' '_devtodo'
'tdr' '_devtodo'
'telnet' '_telnet'
'tex' '_tex'
'texi2dvi' '_texinfo'
'texindex' '_texinfo'
'tg' '_topgit'
'tidy' '_tidy'
'tig' '_git'
'-tilde-' '_tilde'
'time' '_precommand'
'timedatectl' '_timedatectl'
'times' '_nothing'
'tin' '_tin'
'tkconch' '_twisted'
'tkinfo' '_texinfo'
'tla' '_tla'
'tmux' '_tmux'
'todo' '_devtodo'
'todo.sh' '_todo.sh'
'toilet' '_toilet'
'totdconfig' '_totd'
'tpb' '_tpb'
'tpconfig' '_tpconfig'
'tpkg-debarch' '_toolchain-source'
'tpkg-install' '_toolchain-source'
'tpkg-install-libc' '_toolchain-source'
'tpkg-make' '_toolchain-source'
'tpkg-update' '_toolchain-source'
'tracepath' '_tracepath'
'tracepath6' '_tracepath'
'traceroute' '_hosts'
'trap' '_trap'
'tree' '_tree'
'trial' '_twisted'
'true' '_nothing'
'tryaffix' '_ispell'
'ttyctl' '_ttyctl'
'tunctl' '_uml'
'tune2fs' '_tune2fs'
'tunes2pod' '_gnupod'
'tunes2pod.pl' '_gnupod'
'twidge' '_twidge'
'twistd' '_twisted'
'txt' '_hosts'
'type' '_which'
'typeset' '_typeset'
'udevadm' '_udevadm'
'ulimit' '_ulimit'
'uml_mconsole' '_uml'
'uml_moo' '_uml'
'uml_switch' '_uml'
'umount' '_mount'
'unace' '_unace'
'unalias' '_aliases'
'uname' '_uname'
'uncompress' '_compress'
'unexpand' '_unexpand'
'unfunction' '_functions'
'unget' '_sccs'
'unhash' '_unhash'
'uniq' '_uniq'
'unison' '_unison'
'units' '_units'
'unlimit' '_limits'
'unlzma' '_xz'
'unpack' '_pack'
'unpigz' '_gzip'
'unrar' '_rar'
'unset' '_vars'
'unsetopt' '_setopt'
'unwrapdiff' '_patchutils'
'unxz' '_xz'
'unzip' '_zip'
'update-alternatives' '_update-alternatives'
'update-rc.d' '_update-rc.d'
'upgradepkg' '_pkgtool'
'urpme' '_urpmi'
'urpmf' '_urpmi'
'urpmi' '_urpmi'
'urpmi.addmedia' '_urpmi'
'urpmi.removemedia' '_urpmi'
'urpmi.update' '_urpmi'
'urpmq' '_urpmi'
'urxvt' '_urxvt'
'urxvt256c' '_urxvt'
'urxvt256cc' '_urxvt'
'urxvt256c-ml' '_urxvt'
'urxvt256c-mlc' '_urxvt'
'urxvtc' '_urxvt'
'uscan' '_uscan'
'useradd' '_user_admin'
'userdel' '_users'
'usermod' '_user_admin'
'uzbl' '_uzbl'
'uzbl-browser' '_uzbl'
'uzbl-tabbed' '_uzbl'
'val' '_sccs'
'valgrind' '_valgrind'
'-value-' '_value'
'-value-,ADB_TRACE,-default-' '_adb'
'-value-,ANDROID_LOG_TAGS,-default-' '_adb'
'-value-,ANDROID_SERIAL,-default-' '_adb'
'-value-,ANT_ARGS,-default-' '_ant'
'-value-,CFLAGS,-default-' '_gcc'
'-value-,CPPFLAGS,-default-' '_gcc'
'-value-,CXXFLAGS,-default-' '_gcc'
'-value-,-default-,-command-' '_zargs'
'-value-,-default-,-default-' '_value'
'-value-,DISPLAY,-default-' '_x_display'
'-value-,GREP_OPTIONS,-default-' '_grep'
'-value-,GZIP,-default-' '_gzip'
'-value-,LANG,-default-' '_locales'
'-value-,LANGUAGE,-default-' '_locales'
'-value-,LD_DEBUG,-default-' '_ld_debug'
'-value-,LDFLAGS,-default-' '_gcc'
'-value-,LESSCHARSET,-default-' '_less'
'-value-,LESS,-default-' '_less'
'-value-,LPDEST,-default-' '_printers'
'-value-,P4CLIENT,-default-' '_perforce'
'-value-,P4MERGE,-default-' '_perforce'
'-value-,P4PORT,-default-' '_perforce'
'-value-,P4USER,-default-' '_perforce'
'-value-,PERLDOC,-default-' '_perldoc'
'-value-,PRINTER,-default-' '_printers'
'-value-,PROMPT2,-default-' '_ps1234'
'-value-,PROMPT3,-default-' '_ps1234'
'-value-,PROMPT4,-default-' '_ps1234'
'-value-,PROMPT,-default-' '_ps1234'
'-value-,PS1,-default-' '_ps1234'
'-value-,PS2,-default-' '_ps1234'
'-value-,PS3,-default-' '_ps1234'
'-value-,PS4,-default-' '_ps1234'
'-value-,RPROMPT2,-default-' '_ps1234'
'-value-,RPROMPT,-default-' '_ps1234'
'-value-,RPS1,-default-' '_ps1234'
'-value-,RPS2,-default-' '_ps1234'
'-value-,SPROMPT,-default-' '_ps1234'
'-value-,TERM,-default-' '_terminals'
'-value-,TERMINFO_DIRS,-default-' '_dir_list'
'-value-,TZ,-default-' '_time_zone'
'-value-,VALGRIND_OPTS,-default-' '_valgrind'
'-value-,WWW_HOME,-default-' '_urls'
'-value-,XML_CATALOG_FILES,-default-' '_xmlsoft'
'-value-,XZ_DEFAULTS,-default-' '_xz'
'-value-,XZ_OPT,-default-' '_xz'
'vared' '_vared'
'-vared-' '_in_vared'
'vcsh' '_vcsh'
'vim' '_vim'
'vim-addons' '_vim-addons'
'vimdiff' '_vim'
'vmstat' '_vmstat'
'vncserver' '_vnc'
'vncviewer' '_vnc'
'vorbiscomment' '_vorbiscomment'
'vserver' '_vserver'
'vux' '_vux'
'vuxctl' '_vux'
'w3m' '_w3m'
'wait' '_wait'
'wajig' '_wajig'
'wanna-build' '_wanna-build'
'watch' '_watch'
'wc' '_wc'
'wget' '_wget'
'what' '_sccs'
'whatis' '_man'
'whence' '_which'
'where' '_which'
'whereis' '_whereis'
'which' '_which'
'whoami' '_nothing'
'whois' '_whois'
'whom' '_mh'
'wiggle' '_wiggle'
'wodim' '_cdrecord'
'wpa_cli' '_wpa_cli'
'write' '_users_on'
'www' '_webbrowser'
'xargs' '_xargs'
'xauth' '_xauth'
'xautolock' '_xautolock'
'xclip' '_xclip'
'xdpyinfo' '_x_utils'
'xdvi' '_xdvi'
'xelatex' '_tex'
'xetex' '_tex'
'xev' '_x_utils'
'xfd' '_x_utils'
'xfig' '_xfig'
'xfontsel' '_x_utils'
'xhost' '_x_utils'
'xkill' '_x_utils'
'xli' '_xloadimage'
'xloadimage' '_xloadimage'
'xlsatoms' '_x_utils'
'xmllint' '_xmlsoft'
'xmms2' '_xmms2'
'xmodmap' '_xmodmap'
'xmosaic' '_webbrowser'
'xon' '_x_utils'
'xournal' '_xournal'
'xpdf' '_xpdf'
'xping' '_hosts'
'xprop' '_x_utils'
'xrandr' '_xrandr'
'xrdb' '_x_utils'
'xscreensaver-command' '_xscreensaver'
'xset' '_xset'
'xsetbg' '_xloadimage'
'xsetroot' '_x_utils'
'xsltproc' '_xmlsoft'
'xterm' '_xterm'
'xtightvncviewer' '_vnc'
'xtp' '_imagemagick'
'xv' '_xv'
'xview' '_xloadimage'
'xvnc4viewer' '_vnc'
'xvncviewer' '_vnc'
'xwd' '_x_utils'
'xwininfo' '_x_utils'
'xwit' '_xwit'
'xwud' '_x_utils'
'xxd' '_xxd'
'xz' '_xz'
'xzcat' '_xz'
'yast' '_yast'
'yast2' '_yast'
'ypbind' '_yp'
'ypcat' '_yp'
'ypmatch' '_yp'
'yppasswd' '_yp'
'yppoll' '_yp'
'yppush' '_yp'
'ypserv' '_yp'
'ypset' '_yp'
'ypwhich' '_yp'
'ypxfr' '_yp'
'ytalk' '_other_accounts'
'yum' '_yum'
'zargs' '_zargs'
'zathura' '_pspdf'
'zcalc' '_zcalc'
'-zcalc-line-' '_zcalc_line'
'zcat' '_zcat'
'zcompile' '_zcompile'
'zcp' '_zmv'
'zdelattr' '_zattr'
'zdump' '_zdump'
'zed' '_zed'
'zegrep,' '_grep'
'zen' '_webbrowser'
'zf_chgrp' '_chown'
'zf_chown' '_chown'
'zfgrep' '_grep'
'zf_ln' '_ln'
'zf_mkdir' '_mkdir'
'zf_rm' '_rm'
'zf_rmdir' '_directories'
'zfs' '_zfs'
'zgetattr' '_zattr'
'zgrep,' '_grep'
'zip' '_zip'
'zipinfo' '_zip'
'zle' '_zle'
'zlistattr' '_zattr'
'zln' '_zmv'
'zlogin' '_zlogin'
'zmail' '_mail'
'zmodload' '_zmodload'
'zmv' '_zmv'
'zone' '_hosts'
'zoneadm' '_zoneadm'
'zpool' '_zpool'
'zpty' '_zpty'
'zsetattr' '_zattr'
'zsh' '_sh'
'zsh-mime-handler' '_zsh-mime-handler'
'zstat' '_stat'
'zstyle' '_zstyle'
'ztodo' '_ztodo'
'zxpdf' '_xpdf'
'zypper' '_zypper'
)
_services=(
'bzcat' 'bunzip2'
'dch' 'debchange'
'gnupod_addsong.pl' 'gnupod_addsong'
'gnupod_check.pl' 'gnupod_check'
'gnupod_INIT.pl' 'gnupod_INIT'
'gnupod_search.pl' 'gnupod_search'
'gpg2' 'gpg'
'gzcat' 'gunzip'
'iceweasel' 'firefox'
'lzcat' 'unxz'
'lzma' 'xz'
'Mail' 'mail'
'mailx' 'mail'
'mktunes.pl' 'mktunes'
'nail' 'mail'
'ncl' 'nc'
'nedit-nc' 'nc'
'pcat' 'unpack'
'-redirect-,<,bunzip2' 'bunzip2'
'-redirect-,<,bzip2' 'bzip2'
'-redirect-,>,bzip2' 'bunzip2'
'-redirect-,<,compress' 'compress'
'-redirect-,>,compress' 'uncompress'
'-redirect-,<,gunzip' 'gunzip'
'-redirect-,<,gzip' 'gzip'
'-redirect-,>,gzip' 'gunzip'
'-redirect-,<,uncompress' 'uncompress'
'-redirect-,<,unxz' 'unxz'
'-redirect-,<,xz' 'xz'
'-redirect-,>,xz' 'unxz'
'remsh' 'rsh'
'slogin' 'ssh'
'svnadmin-static' 'svnadmin'
'tunes2pod.pl' 'tunes2pod'
'unlzma' 'unxz'
'xelatex' 'latex'
'xetex' 'tex'
'xzcat' 'unxz'
'zf_chgrp' 'chgrp'
'zf_chown' 'chown'
)
_patcomps=(
'*/(init|rc[0-9S]#).d/*' '_init_d'
'zf*' '_zftp'
)
_postpatcomps=(
'(|cifs)iostat' '_sysstat'
'isag' '_sysstat'
'mpstat' '_sysstat'
'(p[bgpn]m*|*top[bgpn]m)' '_pbm'
'pidstat' '_sysstat'
'pydoc[0-9.]#' '_pydoc'
'python[0-9.]#' '_python'
'qemu(|-system-*)' '_qemu'
'(ruby|[ei]rb)[0-9.]#' '_ruby'
'sadf' '_sysstat'
'sar' '_sysstat'
'(texi(2*|ndex))' '_texi'
'(tiff*|*2tiff|pal2rgb)' '_tiff'
'-value-,(ftp|http(|s))_proxy,-default-' '_urls'
'-value-,LC_*,-default-' '_locales'
'-value-,*path,-default-' '_directories'
'-value-,*PATH,-default-' '_dir_list'
'-value-,RUBY(LIB|OPT|PATH),-default-' '_ruby'
'*/X11(|R<4->)/*' '_x_arguments'
'yodl(|2*)' '_yodl'
)
_compautos=(
'_call_program' '+X'
)
zle -C _bash_complete-word .complete-word _bash_completions
zle -C _bash_list-choices .list-choices _bash_completions
zle -C _complete_debug .complete-word _complete_debug
zle -C _complete_help .complete-word _complete_help
zle -C _complete_tag .complete-word _complete_tag
zle -C _correct_filename .complete-word _correct_filename
zle -C _correct_word .complete-word _correct_word
zle -C _expand_alias .complete-word _expand_alias
zle -C _expand_word .complete-word _expand_word
zle -C _history-complete-newer .complete-word _history_complete_word
zle -C _history-complete-older .complete-word _history_complete_word
zle -C _list_expansions .list-choices _expand_word
zle -C _most_recent_file .complete-word _most_recent_file
zle -C _next_tags .list-choices _next_tags
zle -C _read_comp .complete-word _read_comp
bindkey '^X^R' _read_comp
bindkey '^X?' _complete_debug
bindkey '^XC' _correct_filename
bindkey '^Xa' _expand_alias
bindkey '^Xc' _correct_word
bindkey '^Xd' _list_expansions
bindkey '^Xe' _expand_word
bindkey '^Xh' _complete_help
bindkey '^Xm' _most_recent_file
bindkey '^Xn' _next_tags
bindkey '^Xt' _complete_tag
bindkey '^X~' _bash_list-choices
bindkey '^[,' _history-complete-newer
bindkey '^[/' _history-complete-older
bindkey '^[~' _bash_complete-word
autoload -Uz _a2ps _a2utils _aap _acpi _acpitool \
_acroread _adb _add-zsh-hook _alias _aliases \
_all_labels _all_matches _alternative _analyseplugin _ant \
_antiword _apachectl _apm _approximate _apt \
_apt-file _aptitude _apt-move _apt-show-versions _arch_archives \
_arch_namespace _arg_compile _arguments _arp _arping \
_arrays _assign _at _attr _augeas \
_auto-apt _autocd _awk _axi-cache _bash_completions \
_baz _beadm _beep _be_name _bind_addresses \
_bindkey _bison _bittorrent _bogofilter _bootctl \
_bpython _brace_parameter _brctl _bsdconfig _bsdinstall \
_bsd_pkg _btrfs _bts _bug _builtin \
_busctl _bzip2 _bzr _cabal _cache_invalid \
_cal _calendar _call_function _canonical_paths _cat \
_ccal _cd _cdbs-edit-patch _cdcd _cdr \
_cdrdao _cdrecord _chflags _chkconfig _chmod \
_chown _chrt _chsh _clay _cmdstring \
_cmp _combination _comm _command _command_names \
_compadd _compdef _complete _complete_debug _complete_help \
_complete_help_generic _complete_tag _comp_locale _compress _condition \
_configure _coreadm _correct _correct_filename _correct_word \
_cowsay _cp _cpio _cplay _cryptsetup \
_cssh _csup _ctags_tags _curl _cut \
_cvs _cvsup _cygcheck _cygpath _cygrunsrv \
_cygserver _cygstart _dak _darcs _date \
_date_formats _dates _dbus _dchroot _dchroot-dsa \
_dcop _dcut _dd _deb_architectures _debchange \
_debcheckout _debdiff _debfoster _deb_packages _debsign \
_default _defaults _delimiters _describe _description \
_devtodo _df _dhclient _dhcpinfo _dict \
_dict_words _diff _diff_options _diffstat _directories \
_directory_stack _dir_list _dirs _disable _dispatch \
_django _dladm _dlocate _dmidecode _dnf \
_docker _docker-compose _domains _dpatch-edit-patch _dpkg \
_dpkg-buildpackage _dpkg-cross _dpkg-repack _dpkg_source _dput \
_dsh _dtrace _du _dumpadm _dumper \
_dupload _dvi _dynamic_directory_name _ecasound _echotc \
_echoti _elfdump _elinks _elm _email_addresses \
_emulate _enable _enscript _env _equal \
_espeak _etags _ethtool _expand _expand_alias \
_expand_word _extensions _external_pwds _fakeroot _fc \
_feh _fetch _fetchmail _ffmpeg _figlet \
_file_descriptors _files _file_systems _find _find_net_interfaces \
_finger _fink _first _flasher _flex \
_floppy _flowadm _fmadm _fortune _freebsd-update \
_fsh _fstat _functions _fuse_arguments _fuser \
_fusermount _fuse_values _gcc _gcore _gdb \
_generic _genisoimage _getclip _getconf _getent \
_getfacl _getmail _git _git-buildpackage _global \
_global_tags _globflags _globqual_delims _globquals _gnome-gv \
_gnu_generic _gnupod _gnutls _go _gpg \
_gphoto2 _gprof _gqview _gradle _graphicsmagick \
_grep _grep-excuses _groff _groups _growisofs \
_gs _guard _guilt _gv _gzip \
_hash _have_glob_qual _hdiutil _hg _history \
_history_complete_word _history_modifiers _hostnamectl _hosts _hwinfo \
_iconv _id _ifconfig _iftop _ignored \
_imagemagick _inetadm _initctl _init_d _in_vared \
_invoke-rc.d _ionice _ip _ipadm _ipset \
_iptables _irssi _ispell _iwconfig _jails \
_java _java_class _jexec _jls _jobs \
_jobs_bg _jobs_builtin _jobs_fg _joe _join \
_journalctl _kfmclient _kill _killall _kld \
_knock _kvno _last _ldd _ld_debug \
_less _lha _lighttpd _limit _limits \
_links _lintian _list _list_files _ln \
_loadkeys _localectl _locales _locate _logical_volumes \
_loginctl _look _losetup _lp _ls \
_lscfg _lsdev _lslv _lsof _lspv \
_lsusb _lsvg _lynx _lzop _mac_applications \
_mac_files_for_application _madison _mail _mailboxes _main_complete \
_make _make-kpkg _man _match _math \
_math_params _matlab _md5sum _mdadm _members \
_mencal _menu _mere _mergechanges _message \
_metaflac _mh _mii-tool _mime_types _mixerctl \
_mkdir _mkshortcut _mkzsh _module _module-assistant \
_module_math_func _modutils _mondo _monotone _moosic \
_mosh _most_recent_file _mount _mozilla _mpc \
_mplayer _mt _mtools _mtr _multi_parts \
_mutt _my_accounts _mysqldiff _mysql_utils _nautilus \
_ncftp _nedit _netcat _net_interfaces _netscape \
_netstat _newsgroups _next_label _next_tags _nice \
_nkf _nl _nm _nmap _nmcli \
_normal _nothing _notmuch _npm _nslookup \
_object_classes _od _okular _oldlist _open \
_options _options_set _options_unset _osc _other_accounts \
_pack _parameter _parameters _patch _patchutils \
_path_commands _path_files _pax _pbm _pbuilder \
_pdf _pdftk _perforce _perl _perl_basepods \
_perldoc _perl_modules _pfctl _pfexec _pgrep \
_php _physical_volumes _pick_variant _pids _pine \
_ping _piuparts _pkg5 _pkgadd _pkg-config \
_pkginfo _pkg_instance _pkgrm _pkgtool _pon \
_portaudit _portlint _portmaster _ports _portsnap \
_postfix _postscript _powerd _prcs _precommand \
_prefix _print _printenv _printers _procstat \
_prompt _prove _prstat _ps _ps1234 \
_pscp _pspdf _psutils _ptree _pulseaudio \
_pump _putclip _pydoc _python _python_modules \
_qdbus _qemu _qiv _qtplay _quilt \
_raggle _rake _ranlib _rar _rcs \
_rdesktop _read _read_comp _readelf _readshortcut \
_rebootin _redirect _regex_arguments _regex_words _remote_files \
_renice _reprepro _requested _retrieve_cache _retrieve_mac_apps \
_ri _rlogin _rm _rpm _rpmbuild \
_rrdtool _rsync _rubber _ruby _run-help \
_runit _sablotron _samba _savecore _sccs \
_sched _schedtool _schroot _screen _sd_hosts_or_user_at_host \
_sd_outputmodes _sd_unit_files _sed _sep_parts _sequence \
_service _services _set _set_command _setfacl \
_setopt _setup _sh _showmount _signals \
_sisu _slrn _smit _snoop _socket \
_sockstat _softwareupdate _sort _source _spamassassin \
_sqlite _sqsh _ss _ssh _sshfs \
_stat _stgit _store_cache _strace _strftime \
_strip _stty _su _sub_commands _subscript \
_subversion _sudo _suffix_alias_files _surfraw _SUSEconfig \
_svcadm _svccfg _svcprop _svcs _svcs_fmri \
_svn-buildpackage _sysctl _sysstat _systat _systemctl \
_systemd _systemd-analyze _systemd-delta _systemd-inhibit _systemd-run \
_systemd-tmpfiles _system_profiler _tags _tar _tar_archive \
_tardy _tcpdump _tcpsys _tcptraceroute _telnet \
_terminals _tex _texi _texinfo _tidy \
_tiff _tilde _tilde_files _timedatectl _time_zone \
_tin _tla _tmux _todo.sh _toilet \
_toolchain-source _topgit _totd _tpb _tpconfig \
_tracepath _trap _tree _ttyctl _ttys \
_tune2fs _twidge _twisted _typeset _udevadm \
_ulimit _uml _unace _uname _unexpand \
_unhash _uniq _unison _units _update-alternatives \
_update-rc.d _urls _urpmi _urxvt _uscan \
_user_admin _user_at_host _user_expand _user_math_func _users \
_users_on _uzbl _valgrind _value _values \
_vared _vars _vcsh _vim _vim-addons \
_vmstat _vnc _volume_groups _vorbis _vorbiscomment \
_vserver _vux _w3m _wait _wajig \
_wakeup_capable_devices _wanna-build _wanted _watch _watch-snoop \
_wc _webbrowser _wget _whereis _which \
_whois _wiggle _wpa_cli _xargs _x_arguments \
_xauth _xautolock _x_borderwidth _xclip _x_color \
_x_colormapid _x_cursor _x_display _xdvi _x_extension \
_xfig _x_font _xft_fonts _x_geometry _x_keysym \
_xloadimage _x_locale _xmlsoft _xmms2 _x_modifier \
_xmodmap _x_name _xournal _xpdf _xrandr \
_x_resource _xscreensaver _x_selection_timeout _xset _xt_arguments \
_xterm _x_title _xt_session_id _x_utils _xv \
_x_visual _x_window _xwit _xxd _xz \
_yast _yodl _yp _yum _zargs \
_zattr _zcalc _zcalc_line _zcat _zcompile \
_zdump _zed _zfs _zfs_dataset _zfs_keysource_props \
_zfs_pool _zftp _zip _zle _zlogin \
_zmodload _zmv _zoneadm _zones _zpool \
_zpty _zsh-mime-handler _zstyle _ztodo _zypper
autoload -Uz +X _call_program
typeset -gUa _comp_assocs
_comp_assocs=( '' )
export TERM=xterm-256color
export POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(time context dir rbenv root_indicator)
export POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status virtualenv vcs root_indicator background_jobs history)
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/home/wollivier/.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.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="random"
ZSH_THEME="dieter"
ZSH_THEME="powerlevel9k"
#ZSH_THEME="xxf"
#ZSH_THEME="bullet-train"
# 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.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# 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"
# 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/*)
# 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.
plugins=(python)
source $ZSH/oh-my-zsh.sh
# Check for updates on initial load...
if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then
env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f $ZSH/tools/check_for_upgrade.sh
fi
# Initializes Oh My Zsh
# add a function path
fpath=($ZSH/functions $ZSH/completions $fpath)
# Load all stock functions (from $fpath files) called below.
autoload -U compaudit compinit
: ${ZSH_DISABLE_COMPFIX:=true}
# Set ZSH_CUSTOM to the path where your custom config files
# and plugins exists, or else we will use the default custom/
if [[ -z "$ZSH_CUSTOM" ]]; then
ZSH_CUSTOM="$ZSH/custom"
fi
# Set ZSH_CACHE_DIR to the path where cache files should be created
# or else we will use the default cache/
if [[ -z "$ZSH_CACHE_DIR" ]]; then
ZSH_CACHE_DIR="$ZSH/cache"
fi
# Load all of the config files in ~/oh-my-zsh that end in .zsh
# TIP: Add files you don't want in git to .gitignore
for config_file ($ZSH/lib/*.zsh); do
custom_config_file="${ZSH_CUSTOM}/lib/${config_file:t}"
[ -f "${custom_config_file}" ] && config_file=${custom_config_file}
source $config_file
done
## Bazaar integration
## Just works with the GIT integration just add $(bzr_prompt_info) to the PROMPT
function bzr_prompt_info() {
BZR_CB=`bzr nick 2> /dev/null | grep -v "ERROR" | cut -d ":" -f2 | awk -F / '{print "bzr::"$1}'`
if [ -n "$BZR_CB" ]; then
BZR_DIRTY=""
[[ -n `bzr status` ]] && BZR_DIRTY=" %{$fg[red]%} * %{$fg[green]%}"
echo "$ZSH_THEME_SCM_PROMPT_PREFIX$BZR_CB$BZR_DIRTY$ZSH_THEME_GIT_PROMPT_SUFFIX"
fi
}# System clipboard integration
#
# This file has support for doing system clipboard copy and paste operations
# from the command line in a generic cross-platform fashion.
#
# On OS X and Windows, the main system clipboard or "pasteboard" is used. On other
# Unix-like OSes, this considers the X Windows CLIPBOARD selection to be the
# "system clipboard", and the X Windows `xclip` command must be installed.
# clipcopy - Copy data to clipboard
#
# Usage:
#
# <command> | clipcopy - copies stdin to clipboard
#
# clipcopy <file> - copies a file's contents to clipboard
#
function clipcopy() {
emulate -L zsh
local file=$1
if [[ $OSTYPE == darwin* ]]; then
if [[ -z $file ]]; then
pbcopy
else
cat $file | pbcopy
fi
elif [[ $OSTYPE == cygwin* ]]; then
if [[ -z $file ]]; then
cat > /dev/clipboard
else
cat $file > /dev/clipboard
fi
else
if (( $+commands[xclip] )); then
if [[ -z $file ]]; then
xclip -in -selection clipboard
else
xclip -in -selection clipboard $file
fi
elif (( $+commands[xsel] )); then
if [[ -z $file ]]; then
xsel --clipboard --input
else
cat "$file" | xsel --clipboard --input
fi
else
print "clipcopy: Platform $OSTYPE not supported or xclip/xsel not installed" >&2
return 1
fi
fi
}
# clippaste - "Paste" data from clipboard to stdout
#
# Usage:
#
# clippaste - writes clipboard's contents to stdout
#
# clippaste | <command> - pastes contents and pipes it to another process
#
# clippaste > <file> - paste contents to a file
#
# Examples:
#
# # Pipe to another process
# clippaste | grep foo
#
# # Paste to a file
# clippaste > file.txt
function clippaste() {
emulate -L zsh
if [[ $OSTYPE == darwin* ]]; then
pbpaste
elif [[ $OSTYPE == cygwin* ]]; then
cat /dev/clipboard
else
if (( $+commands[xclip] )); then
xclip -out -selection clipboard
elif (( $+commands[xsel] )); then
xsel --clipboard --output
else
print "clipcopy: Platform $OSTYPE not supported or xclip/xsel not installed" >&2
return 1
fi
fi
}
# Handle completions insecurities (i.e., completion-dependent directories with
# insecure ownership or permissions) by:
#
# * Human-readably notifying the user of these insecurities.
# * Moving away all existing completion caches to a temporary directory. Since
# any of these caches may have been generated from insecure directories, they
# are all suspect now. Failing to do so typically causes subsequent compinit()
# calls to fail with "command not found: compdef" errors. (That's bad.)
function handle_completion_insecurities() {
# List of the absolute paths of all unique insecure directories, split on
# newline from compaudit()'s output resembling:
#
# There are insecure directories:
# /usr/share/zsh/site-functions
# /usr/share/zsh/5.0.6/functions
# /usr/share/zsh
# /usr/share/zsh/5.0.6
#
# Since the ignorable first line is printed to stderr and thus not captured,
# stderr is squelched to prevent this output from leaking to the user.
local -aU insecure_dirs
insecure_dirs=( ${(f@):-"$(compaudit 2>/dev/null)"} )
# If no such directories exist, get us out of here.
if (( ! ${#insecure_dirs} )); then
print "[oh-my-zsh] No insecure completion-dependent directories detected."
return
fi
# List ownership and permissions of all insecure directories.
print "[oh-my-zsh] Insecure completion-dependent directories detected:"
ls -ld "${(@)insecure_dirs}"
print "[oh-my-zsh] For safety, completions will be disabled until you manually fix all"
print "[oh-my-zsh] insecure directory permissions and ownership and restart oh-my-zsh."
print "[oh-my-zsh] See the above list for directories with group or other writability.\n"
# Locally enable the "NULL_GLOB" option, thus removing unmatched filename
# globs from argument lists *AND* printing no warning when doing so. Failing
# to do so prints an unreadable warning if no completion caches exist below.
setopt local_options null_glob
# List of the absolute paths of all unique existing completion caches.
local -aU zcompdump_files
zcompdump_files=( "${ZSH_COMPDUMP}"(.) "${ZDOTDIR:-${HOME}}"/.zcompdump* )
# Move such caches to a temporary directory.
if (( ${#zcompdump_files} )); then
# Absolute path of the directory to which such files will be moved.
local ZSH_ZCOMPDUMP_BAD_DIR="${ZSH_CACHE_DIR}/zcompdump-bad"
# List such files first.
print "[oh-my-zsh] Insecure completion caches also detected:"
ls -l "${(@)zcompdump_files}"
# For safety, move rather than permanently remove such files.
print "[oh-my-zsh] Moving to \"${ZSH_ZCOMPDUMP_BAD_DIR}/\"...\n"
mkdir -p "${ZSH_ZCOMPDUMP_BAD_DIR}"
mv "${(@)zcompdump_files}" "${ZSH_ZCOMPDUMP_BAD_DIR}/"
fi
}
# fixme - the load process here seems a bit bizarre
zmodload -i zsh/complist
WORDCHARS=''
unsetopt menu_complete # do not autoselect the first completion entry
unsetopt flowcontrol
setopt auto_menu # show completion menu on successive tab press
setopt complete_in_word
setopt always_to_end
# should this be in keybindings?
bindkey -M menuselect '^o' accept-and-infer-next-history
zstyle ':completion:*:*:*:*:*' menu select
# case insensitive (all), partial-word and substring completion
if [[ "$CASE_SENSITIVE" = true ]]; then
zstyle ':completion:*' matcher-list 'r:|=*' 'l:|=* r:|=*'
else
if [[ "$HYPHEN_INSENSITIVE" = true ]]; then
zstyle ':completion:*' matcher-list 'm:{a-zA-Z-_}={A-Za-z_-}' 'r:|=*' 'l:|=* r:|=*'
else
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*'
fi
fi
unset CASE_SENSITIVE HYPHEN_INSENSITIVE
zstyle ':completion:*' list-colors ''
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
if [[ "$OSTYPE" = solaris* ]]; then
zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm"
else
zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm -w -w"
fi
# disable named-directories autocompletion
zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
# Use caching so that commands like apt and dpkg complete are useable
zstyle ':completion::complete:*' use-cache 1
zstyle ':completion::complete:*' cache-path $ZSH_CACHE_DIR
# Don't complete uninteresting users
zstyle ':completion:*:*:*:users' ignored-patterns \
adm amanda apache at avahi avahi-autoipd beaglidx bin cacti canna \
clamav daemon dbus distcache dnsmasq dovecot fax ftp games gdm \
gkrellmd gopher hacluster haldaemon halt hsqldb ident junkbust kdm \
ldap lp mail mailman mailnull man messagebus mldonkey mysql nagios \
named netdump news nfsnobody nobody nscd ntp nut nx obsrun openvpn \
operator pcap polkitd postfix postgres privoxy pulse pvm quagga radvd \
rpc rpcuser rpm rtkit scard shutdown squid sshd statd svn sync tftp \
usbmux uucp vcsa wwwrun xfs '_*'
# ... unless we really want to.
zstyle '*' single-ignored show
if [[ $COMPLETION_WAITING_DOTS = true ]]; then
expand-or-complete-with-dots() {
# toggle line-wrapping off and back on again
[[ -n "$terminfo[rmam]" && -n "$terminfo[smam]" ]] && echoti rmam
print -Pn "%{%F{red}......%f%}"
[[ -n "$terminfo[rmam]" && -n "$terminfo[smam]" ]] && echoti smam
zle expand-or-complete
zle redisplay
}
zle -N expand-or-complete-with-dots
bindkey "^I" expand-or-complete-with-dots
fi
if [[ "$ENABLE_CORRECTION" == "true" ]]; then
alias ebuild='nocorrect ebuild'
alias gist='nocorrect gist'
alias heroku='nocorrect heroku'
alias hpodder='nocorrect hpodder'
alias man='nocorrect man'
alias mkdir='nocorrect mkdir'
alias mv='nocorrect mv'
alias mysql='nocorrect mysql'
alias sudo='nocorrect sudo'
setopt correct_all
fi
# diagnostics.zsh
#
# Diagnostic and debugging support for oh-my-zsh
# omz_diagnostic_dump()
#
# Author: Andrew Janke <andrew@apjanke.net>
#
# Usage:
#
# omz_diagnostic_dump [-v] [-V] [file]
#
# NOTE: This is a work in progress. Its interface and behavior are going to change,
# and probably in non-back-compatible ways.
#
# Outputs a bunch of information about the state and configuration of
# oh-my-zsh, zsh, and the user's system. This is intended to provide a
# bunch of context for diagnosing your own or a third party's problems, and to
# be suitable for posting to public bug reports.
#
# The output is human-readable and its format may change over time. It is not
# suitable for parsing. All the output is in one single file so it can be posted
# as a gist or bug comment on GitHub. GitHub doesn't support attaching tarballs
# or other files to bugs; otherwise, this would probably have an option to produce
# tarballs that contain copies of the config and customization files instead of
# catting them all in to one file.
#
# This is intended to be widely portable, and run anywhere that oh-my-zsh does.
# Feel free to report any portability issues as bugs.
#
# This is written in a defensive style so it still works (and can detect) cases when
# basic functionality like echo and which have been redefined. In particular, almost
# everything is invoked with "builtin" or "command", to work in the face of user
# redefinitions.
#
# OPTIONS
#
# [file] Specifies the output file. If not given, a file in the current directory
# is selected automatically.
#
# -v Increase the verbosity of the dump output. May be specified multiple times.
# Verbosity levels:
# 0 - Basic info, shell state, omz configuration, git state
# 1 - (default) Adds key binding info and configuration file contents
# 2 - Adds zcompdump file contents
#
# -V Reduce the verbosity of the dump output. May be specified multiple times.
#
# TODO:
# * Multi-file capture
# * Add automatic gist uploading
# * Consider whether to move default output file location to TMPDIR. More robust
# but less user friendly.
#
autoload -Uz is-at-least
function omz_diagnostic_dump() {
emulate -L zsh
builtin echo "Generating diagnostic dump; please be patient..."
local thisfcn=omz_diagnostic_dump
local -A opts
local opt_verbose opt_noverbose opt_outfile
local timestamp=$(date +%Y%m%d-%H%M%S)
local outfile=omz_diagdump_$timestamp.txt
builtin zparseopts -A opts -D -- "v+=opt_verbose" "V+=opt_noverbose"
local verbose n_verbose=${#opt_verbose} n_noverbose=${#opt_noverbose}
(( verbose = 1 + n_verbose - n_noverbose ))
if [[ ${#*} > 0 ]]; then
opt_outfile=$1
fi
if [[ ${#*} > 1 ]]; then
builtin echo "$thisfcn: error: too many arguments" >&2
return 1
fi
if [[ -n "$opt_outfile" ]]; then
outfile="$opt_outfile"
fi
# Always write directly to a file so terminal escape sequences are
# captured cleanly
_omz_diag_dump_one_big_text &> "$outfile"
if [[ $? != 0 ]]; then
builtin echo "$thisfcn: error while creating diagnostic dump; see $outfile for details"
fi
builtin echo
builtin echo Diagnostic dump file created at: "$outfile"
builtin echo
builtin echo To share this with OMZ developers, post it as a gist on GitHub
builtin echo at "https://gist.github.com" and share the link to the gist.
builtin echo
builtin echo "WARNING: This dump file contains all your zsh and omz configuration files,"
builtin echo "so don't share it publicly if there's sensitive information in them."
builtin echo
}
function _omz_diag_dump_one_big_text() {
local program programs progfile md5
builtin echo oh-my-zsh diagnostic dump
builtin echo
builtin echo $outfile
builtin echo
# Basic system and zsh information
command date
command uname -a
builtin echo OSTYPE=$OSTYPE
builtin echo ZSH_VERSION=$ZSH_VERSION
builtin echo User: $USER
builtin echo umask: $(umask)
builtin echo
_omz_diag_dump_os_specific_version
builtin echo
# Installed programs
programs=(sh zsh ksh bash sed cat grep ls find git posh)
local progfile="" extra_str="" sha_str=""
for program in $programs; do
extra_str="" sha_str=""
progfile=$(builtin which $program)
if [[ $? == 0 ]]; then
if [[ -e $progfile ]]; then
if builtin whence shasum &>/dev/null; then
sha_str=($(command shasum $progfile))
sha_str=$sha_str[1]
extra_str+=" SHA $sha_str"
fi
if [[ -h "$progfile" ]]; then
extra_str+=" ( -> ${progfile:A} )"
fi
fi
builtin printf '%-9s %-20s %s\n' "$program is" "$progfile" "$extra_str"
else
builtin echo "$program: not found"
fi
done
builtin echo
builtin echo Command Versions:
builtin echo "zsh: $(zsh --version)"
builtin echo "this zsh session: $ZSH_VERSION"
builtin echo "bash: $(bash --version | command grep bash)"
builtin echo "git: $(git --version)"
builtin echo "grep: $(grep --version)"
builtin echo
# Core command definitions
_omz_diag_dump_check_core_commands || return 1
builtin echo
# ZSH Process state
builtin echo Process state:
builtin echo pwd: $PWD
if builtin whence pstree &>/dev/null; then
builtin echo Process tree for this shell:
pstree -p $$
else
ps -fT
fi
builtin set | command grep -a '^\(ZSH\|plugins\|TERM\|LC_\|LANG\|precmd\|chpwd\|preexec\|FPATH\|TTY\|DISPLAY\|PATH\)\|OMZ'
builtin echo
#TODO: Should this include `env` instead of or in addition to `export`?
builtin echo Exported:
builtin echo $(builtin export | command sed 's/=.*//')
builtin echo
builtin echo Locale:
command locale
builtin echo
# Zsh installation and configuration
builtin echo Zsh configuration:
builtin echo setopt: $(builtin setopt)
builtin echo
builtin echo zstyle:
builtin zstyle
builtin echo
builtin echo 'compaudit output:'
compaudit
builtin echo
builtin echo '$fpath directories:'
command ls -lad $fpath
builtin echo
# Oh-my-zsh installation
builtin echo oh-my-zsh installation:
command ls -ld ~/.z*
command ls -ld ~/.oh*
builtin echo
builtin echo oh-my-zsh git state:
(cd $ZSH && builtin echo "HEAD: $(git rev-parse HEAD)" && git remote -v && git status | command grep "[^[:space:]]")
if [[ $verbose -ge 1 ]]; then
(cd $ZSH && git reflog --date=default | command grep pull)
fi
builtin echo
if [[ -e $ZSH_CUSTOM ]]; then
local custom_dir=$ZSH_CUSTOM
if [[ -h $custom_dir ]]; then
custom_dir=$(cd $custom_dir && pwd -P)
fi
builtin echo "oh-my-zsh custom dir:"
builtin echo " $ZSH_CUSTOM ($custom_dir)"
(cd ${custom_dir:h} && command find ${custom_dir:t} -name .git -prune -o -print)
builtin echo
fi
# Key binding and terminal info
if [[ $verbose -ge 1 ]]; then
builtin echo "bindkey:"
builtin bindkey
builtin echo
builtin echo "infocmp:"
command infocmp -L
builtin echo
fi
# Configuration file info
local zdotdir=${ZDOTDIR:-$HOME}
builtin echo "Zsh configuration files:"
local cfgfile cfgfiles
# Some files for bash that zsh does not use are intentionally included
# to help with diagnosing behavior differences between bash and zsh
cfgfiles=( /etc/zshenv /etc/zprofile /etc/zshrc /etc/zlogin /etc/zlogout
$zdotdir/.zshenv $zdotdir/.zprofile $zdotdir/.zshrc $zdotdir/.zlogin $zdotdir/.zlogout
~/.zsh.pre-oh-my-zsh
/etc/bashrc /etc/profile ~/.bashrc ~/.profile ~/.bash_profile ~/.bash_logout )
command ls -lad $cfgfiles 2>&1
builtin echo
if [[ $verbose -ge 1 ]]; then
for cfgfile in $cfgfiles; do
_omz_diag_dump_echo_file_w_header $cfgfile
done
fi
builtin echo
builtin echo "Zsh compdump files:"
local dumpfile dumpfiles
command ls -lad $zdotdir/.zcompdump*
dumpfiles=( $zdotdir/.zcompdump*(N) )
if [[ $verbose -ge 2 ]]; then
for dumpfile in $dumpfiles; do
_omz_diag_dump_echo_file_w_header $dumpfile
done
fi
}
function _omz_diag_dump_check_core_commands() {
builtin echo "Core command check:"
local redefined name builtins externals reserved_words
redefined=()
# All the zsh non-module builtin commands
# These are taken from the zsh reference manual for 5.0.2
# Commands from modules should not be included.
# (For back-compatibility, if any of these are newish, they should be removed,
# or at least made conditional on the version of the current running zsh.)
# "history" is also excluded because OMZ is known to redefine that
reserved_words=( do done esac then elif else fi for case if while function
repeat time until select coproc nocorrect foreach end '!' '[[' '{' '}'
)
builtins=( alias autoload bg bindkey break builtin bye cd chdir command
comparguments compcall compctl compdescribe compfiles compgroups compquote comptags
comptry compvalues continue dirs disable disown echo echotc echoti emulate
enable eval exec exit false fc fg functions getln getopts hash
jobs kill let limit log logout noglob popd print printf
pushd pushln pwd r read rehash return sched set setopt shift
source suspend test times trap true ttyctl type ulimit umask unalias
unfunction unhash unlimit unset unsetopt vared wait whence where which zcompile
zle zmodload zparseopts zregexparse zstyle )
if is-at-least 5.1; then
reserved_word+=( declare export integer float local readonly typeset )
else
builtins+=( declare export integer float local readonly typeset )
fi
builtins_fatal=( builtin command local )
externals=( zsh )
for name in $reserved_words; do
if [[ $(builtin whence -w $name) != "$name: reserved" ]]; then
builtin echo "reserved word '$name' has been redefined"
builtin which $name
redefined+=$name
fi
done
for name in $builtins; do
if [[ $(builtin whence -w $name) != "$name: builtin" ]]; then
builtin echo "builtin '$name' has been redefined"
builtin which $name
redefined+=$name
fi
done
for name in $externals; do
if [[ $(builtin whence -w $name) != "$name: command" ]]; then
builtin echo "command '$name' has been redefined"
builtin which $name
redefined+=$name
fi
done
if [[ -n "$redefined" ]]; then
builtin echo "SOME CORE COMMANDS HAVE BEEN REDEFINED: $redefined"
else
builtin echo "All core commands are defined normally"
fi
}
function _omz_diag_dump_echo_file_w_header() {
local file=$1
if [[ ( -f $file || -h $file ) ]]; then
builtin echo "========== $file =========="
if [[ -h $file ]]; then
builtin echo "========== ( => ${file:A} ) =========="
fi
command cat $file
builtin echo "========== end $file =========="
builtin echo
elif [[ -d $file ]]; then
builtin echo "File '$file' is a directory"
elif [[ ! -e $file ]]; then
builtin echo "File '$file' does not exist"
else
command ls -lad "$file"
fi
}
function _omz_diag_dump_os_specific_version() {
local osname osver version_file version_files
case "$OSTYPE" in
darwin*)
osname=$(command sw_vers -productName)
osver=$(command sw_vers -productVersion)
builtin echo "OS Version: $osname $osver build $(sw_vers -buildVersion)"
;;
cygwin)
command systeminfo | command head -4 | command tail -2
;;
esac
if builtin which lsb_release >/dev/null; then
builtin echo "OS Release: $(command lsb_release -s -d)"
fi
version_files=( /etc/*-release(N) /etc/*-version(N) /etc/*_version(N) )
for version_file in $version_files; do
builtin echo "$version_file:"
command cat "$version_file"
builtin echo
done
}
# Changing/making/removing directory
setopt auto_pushd
setopt pushd_ignore_dups
setopt pushdminus
alias -g ...='../..'
alias -g ....='../../..'
alias -g .....='../../../..'
alias -g ......='../../../../..'
alias -- -='cd -'
alias 1='cd -'
alias 2='cd -2'
alias 3='cd -3'
alias 4='cd -4'
alias 5='cd -5'
alias 6='cd -6'
alias 7='cd -7'
alias 8='cd -8'
alias 9='cd -9'
alias md='mkdir -p'
alias rd=rmdir
alias d='dirs -v | head -10'
# List directory contents
alias lsa='ls -lah'
alias l='ls -lah'
alias ll='ls -lh'
alias la='ls -lAh'
# Push and pop directories on directory stack
alias pu='pushd'
alias po='popd'
function zsh_stats() {
fc -l 1 | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20
}
function uninstall_oh_my_zsh() {
env ZSH=$ZSH sh $ZSH/tools/uninstall.sh
}
function upgrade_oh_my_zsh() {
env ZSH=$ZSH sh $ZSH/tools/upgrade.sh
}
function take() {
mkdir -p $1
cd $1
}
function open_command() {
emulate -L zsh
setopt shwordsplit
local open_cmd
# define the open command
case "$OSTYPE" in
darwin*) open_cmd='open' ;;
cygwin*) open_cmd='cygstart' ;;
linux*) open_cmd='xdg-open' ;;
msys*) open_cmd='start ""' ;;
*) echo "Platform $OSTYPE not supported"
return 1
;;
esac
# don't use nohup on OSX
if [[ "$OSTYPE" == darwin* ]]; then
$open_cmd "$@" &>/dev/null
else
nohup $open_cmd "$@" &>/dev/null
fi
}
#
# Get the value of an alias.
#
# Arguments:
# 1. alias - The alias to get its value from
# STDOUT:
# The value of alias $1 (if it has one).
# Return value:
# 0 if the alias was found,
# 1 if it does not exist
#
function alias_value() {
alias "$1" | sed "s/^$1='\(.*\)'$/\1/"
test $(alias "$1")
}
#
# Try to get the value of an alias,
# otherwise return the input.
#
# Arguments:
# 1. alias - The alias to get its value from
# STDOUT:
# The value of alias $1, or $1 if there is no alias $1.
# Return value:
# Always 0
#
function try_alias_value() {
alias_value "$1" || echo "$1"
}
#
# Set variable "$1" to default value "$2" if "$1" is not yet defined.
#
# Arguments:
# 1. name - The variable to set
# 2. val - The default value
# Return value:
# 0 if the variable exists, 3 if it was set
#
function default() {
test `typeset +m "$1"` && return 0
typeset -g "$1"="$2" && return 3
}
#
# Set environment variable "$1" to default value "$2" if "$1" is not yet defined.
#
# Arguments:
# 1. name - The env variable to set
# 2. val - The default value
# Return value:
# 0 if the env variable exists, 3 if it was set
#
function env_default() {
env | grep -q "^$1=" && return 0
export "$1=$2" && return 3
}
# Required for $langinfo
zmodload zsh/langinfo
# URL-encode a string
#
# Encodes a string using RFC 2396 URL-encoding (%-escaped).
# See: https://www.ietf.org/rfc/rfc2396.txt
#
# By default, reserved characters and unreserved "mark" characters are
# not escaped by this function. This allows the common usage of passing
# an entire URL in, and encoding just special characters in it, with
# the expectation that reserved and mark characters are used appropriately.
# The -r and -m options turn on escaping of the reserved and mark characters,
# respectively, which allows arbitrary strings to be fully escaped for
# embedding inside URLs, where reserved characters might be misinterpreted.
#
# Prints the encoded string on stdout.
# Returns nonzero if encoding failed.
#
# Usage:
# omz_urlencode [-r] [-m] [-P] <string>
#
# -r causes reserved characters (;/?:@&=+$,) to be escaped
#
# -m causes "mark" characters (_.!~*''()-) to be escaped
#
# -P causes spaces to be encoded as '%20' instead of '+'
function omz_urlencode() {
emulate -L zsh
zparseopts -D -E -a opts r m P
local in_str=$1
local url_str=""
local spaces_as_plus
if [[ -z $opts[(r)-P] ]]; then spaces_as_plus=1; fi
local str="$in_str"
# URLs must use UTF-8 encoding; convert str to UTF-8 if required
local encoding=$langinfo[CODESET]
local safe_encodings
safe_encodings=(UTF-8 utf8 US-ASCII)
if [[ -z ${safe_encodings[(r)$encoding]} ]]; then
str=$(echo -E "$str" | iconv -f $encoding -t UTF-8)
if [[ $? != 0 ]]; then
echo "Error converting string from $encoding to UTF-8" >&2
return 1
fi
fi
# Use LC_CTYPE=C to process text byte-by-byte
local i byte ord LC_ALL=C
export LC_ALL
local reserved=';/?:@&=+$,'
local mark='_.!~*''()-'
local dont_escape="[A-Za-z0-9"
if [[ -z $opts[(r)-r] ]]; then
dont_escape+=$reserved
fi
# $mark must be last because of the "-"
if [[ -z $opts[(r)-m] ]]; then
dont_escape+=$mark
fi
dont_escape+="]"
# Implemented to use a single printf call and avoid subshells in the loop,
# for performance (primarily on Windows).
local url_str=""
for (( i = 1; i <= ${#str}; ++i )); do
byte="$str[i]"
if [[ "$byte" =~ "$dont_escape" ]]; then
url_str+="$byte"
else
if [[ "$byte" == " " && -n $spaces_as_plus ]]; then
url_str+="+"
else
ord=$(( [##16] #byte ))
url_str+="%$ord"
fi
fi
done
echo -E "$url_str"
}
# URL-decode a string
#
# Decodes a RFC 2396 URL-encoded (%-escaped) string.
# This decodes the '+' and '%' escapes in the input string, and leaves
# other characters unchanged. Does not enforce that the input is a
# valid URL-encoded string. This is a convenience to allow callers to
# pass in a full URL or similar strings and decode them for human
# presentation.
#
# Outputs the encoded string on stdout.
# Returns nonzero if encoding failed.
#
# Usage:
# omz_urldecode <urlstring> - prints decoded string followed by a newline
function omz_urldecode {
emulate -L zsh
local encoded_url=$1
# Work bytewise, since URLs escape UTF-8 octets
local caller_encoding=$langinfo[CODESET]
local LC_ALL=C
export LC_ALL
# Change + back to ' '
local tmp=${encoded_url:gs/+/ /}
# Protect other escapes to pass through the printf unchanged
tmp=${tmp:gs/\\/\\\\/}
# Handle %-escapes by turning them into `\xXX` printf escapes
tmp=${tmp:gs/%/\\x/}
local decoded
eval "decoded=\$'$tmp'"
# Now we have a UTF-8 encoded string in the variable. We need to re-encode
# it if caller is in a non-UTF-8 locale.
local safe_encodings
safe_encodings=(UTF-8 utf8 US-ASCII)
if [[ -z ${safe_encodings[(r)$caller_encoding]} ]]; then
decoded=$(echo -E "$decoded" | iconv -f UTF-8 -t $caller_encoding)
if [[ $? != 0 ]]; then
echo "Error converting string from UTF-8 to $caller_encoding" >&2
return 1
fi
fi
echo -E "$decoded"
}
# Outputs current branch info in prompt format
function git_prompt_info() {
local ref
if [[ "$(command git config --get oh-my-zsh.hide-status 2>/dev/null)" != "1" ]]; then
ref=$(command git symbolic-ref HEAD 2> /dev/null) || \
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return 0
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
fi
}
# Checks if working tree is dirty
function parse_git_dirty() {
local STATUS=''
local -a FLAGS
FLAGS=('--porcelain')
if [[ "$(command git config --get oh-my-zsh.hide-dirty)" != "1" ]]; then
if [[ $POST_1_7_2_GIT -gt 0 ]]; then
FLAGS+='--ignore-submodules=dirty'
fi
if [[ "$DISABLE_UNTRACKED_FILES_DIRTY" == "true" ]]; then
FLAGS+='--untracked-files=no'
fi
STATUS=$(command git status ${FLAGS} 2> /dev/null | tail -n1)
fi
if [[ -n $STATUS ]]; then
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
else
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
fi
}
# Gets the difference between the local and remote branches
function git_remote_status() {
local remote ahead behind git_remote_status git_remote_status_detailed
remote=${$(command git rev-parse --verify ${hook_com[branch]}@{upstream} --symbolic-full-name 2>/dev/null)/refs\/remotes\/}
if [[ -n ${remote} ]]; then
ahead=$(command git rev-list ${hook_com[branch]}@{upstream}..HEAD 2>/dev/null | wc -l)
behind=$(command git rev-list HEAD..${hook_com[branch]}@{upstream} 2>/dev/null | wc -l)
if [[ $ahead -eq 0 ]] && [[ $behind -eq 0 ]]; then
git_remote_status="$ZSH_THEME_GIT_PROMPT_EQUAL_REMOTE"
elif [[ $ahead -gt 0 ]] && [[ $behind -eq 0 ]]; then
git_remote_status="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE"
git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}"
elif [[ $behind -gt 0 ]] && [[ $ahead -eq 0 ]]; then
git_remote_status="$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE"
git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}"
elif [[ $ahead -gt 0 ]] && [[ $behind -gt 0 ]]; then
git_remote_status="$ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE"
git_remote_status_detailed="$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE$((ahead))%{$reset_color%}$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR$ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE$((behind))%{$reset_color%}"
fi
if [[ -n $ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_DETAILED ]]; then
git_remote_status="$ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_PREFIX$remote$git_remote_status_detailed$ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_SUFFIX"
fi
echo $git_remote_status
fi
}
# Outputs the name of the current branch
# Usage example: git pull origin $(git_current_branch)
# Using '--quiet' with 'symbolic-ref' will not cause a fatal error (128) if
# it's not a symbolic ref, but in a Git repo.
function git_current_branch() {
local ref
ref=$(command git symbolic-ref --quiet HEAD 2> /dev/null)
local ret=$?
if [[ $ret != 0 ]]; then
[[ $ret == 128 ]] && return # no git repo.
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
fi
echo ${ref#refs/heads/}
}
# Gets the number of commits ahead from remote
function git_commits_ahead() {
if command git rev-parse --git-dir &>/dev/null; then
local commits="$(git rev-list --count @{upstream}..HEAD)"
if [[ "$commits" != 0 ]]; then
echo "$ZSH_THEME_GIT_COMMITS_AHEAD_PREFIX$commits$ZSH_THEME_GIT_COMMITS_AHEAD_SUFFIX"
fi
fi
}
# Gets the number of commits behind remote
function git_commits_behind() {
if command git rev-parse --git-dir &>/dev/null; then
local commits="$(git rev-list --count HEAD..@{upstream})"
if [[ "$commits" != 0 ]]; then
echo "$ZSH_THEME_GIT_COMMITS_BEHIND_PREFIX$commits$ZSH_THEME_GIT_COMMITS_BEHIND_SUFFIX"
fi
fi
}
# Outputs if current branch is ahead of remote
function git_prompt_ahead() {
if [[ -n "$(command git rev-list origin/$(git_current_branch)..HEAD 2> /dev/null)" ]]; then
echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
fi
}
# Outputs if current branch is behind remote
function git_prompt_behind() {
if [[ -n "$(command git rev-list HEAD..origin/$(git_current_branch) 2> /dev/null)" ]]; then
echo "$ZSH_THEME_GIT_PROMPT_BEHIND"
fi
}
# Outputs if current branch exists on remote or not
function git_prompt_remote() {
if [[ -n "$(command git show-ref origin/$(git_current_branch) 2> /dev/null)" ]]; then
echo "$ZSH_THEME_GIT_PROMPT_REMOTE_EXISTS"
else
echo "$ZSH_THEME_GIT_PROMPT_REMOTE_MISSING"
fi
}
# Formats prompt string for current git commit short SHA
function git_prompt_short_sha() {
local SHA
SHA=$(command git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
}
# Formats prompt string for current git commit long SHA
function git_prompt_long_sha() {
local SHA
SHA=$(command git rev-parse HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
}
# Get the status of the working tree
function git_prompt_status() {
local INDEX STATUS
INDEX=$(command git status --porcelain -b 2> /dev/null)
STATUS=""
if $(echo "$INDEX" | command grep -E '^\?\? ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_UNTRACKED$STATUS"
fi
if $(echo "$INDEX" | grep '^A ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
elif $(echo "$INDEX" | grep '^M ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_ADDED$STATUS"
fi
if $(echo "$INDEX" | grep '^ M ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
elif $(echo "$INDEX" | grep '^AM ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
elif $(echo "$INDEX" | grep '^ T ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_MODIFIED$STATUS"
fi
if $(echo "$INDEX" | grep '^R ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_RENAMED$STATUS"
fi
if $(echo "$INDEX" | grep '^ D ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
elif $(echo "$INDEX" | grep '^D ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
elif $(echo "$INDEX" | grep '^AD ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
fi
if $(command git rev-parse --verify refs/stash >/dev/null 2>&1); then
STATUS="$ZSH_THEME_GIT_PROMPT_STASHED$STATUS"
fi
if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
fi
if $(echo "$INDEX" | grep '^## [^ ]\+ .*ahead' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_AHEAD$STATUS"
fi
if $(echo "$INDEX" | grep '^## [^ ]\+ .*behind' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_BEHIND$STATUS"
fi
if $(echo "$INDEX" | grep '^## [^ ]\+ .*diverged' &> /dev/null); then
STATUS="$ZSH_THEME_GIT_PROMPT_DIVERGED$STATUS"
fi
echo $STATUS
}
# Compares the provided version of git to the version installed and on path
# Outputs -1, 0, or 1 if the installed version is less than, equal to, or
# greater than the input version, respectively.
function git_compare_version() {
local INPUT_GIT_VERSION INSTALLED_GIT_VERSION
INPUT_GIT_VERSION=(${(s/./)1})
INSTALLED_GIT_VERSION=($(command git --version 2>/dev/null))
INSTALLED_GIT_VERSION=(${(s/./)INSTALLED_GIT_VERSION[3]})
for i in {1..3}; do
if [[ $INSTALLED_GIT_VERSION[$i] -gt $INPUT_GIT_VERSION[$i] ]]; then
echo 1
return 0
fi
if [[ $INSTALLED_GIT_VERSION[$i] -lt $INPUT_GIT_VERSION[$i] ]]; then
echo -1
return 0
fi
done
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
unfunction git_compare_version
# is x grep argument available?
grep-flag-available() {
echo | grep $1 "" >/dev/null 2>&1
}
GREP_OPTIONS=""
# color grep results
if grep-flag-available --color=auto; then
GREP_OPTIONS+=" --color=auto"
fi
# ignore VCS folders (if the necessary grep flags are available)
VCS_FOLDERS="{.bzr,CVS,.git,.hg,.svn}"
if grep-flag-available --exclude-dir=.cvs; then
GREP_OPTIONS+=" --exclude-dir=$VCS_FOLDERS"
elif grep-flag-available --exclude=.cvs; then
GREP_OPTIONS+=" --exclude=$VCS_FOLDERS"
fi
# export grep settings
alias grep="grep $GREP_OPTIONS"
# clean up
unset GREP_OPTIONS
unset VCS_FOLDERS
unfunction grep-flag-available
## Command history configuration
if [ -z "$HISTFILE" ]; then
HISTFILE=$HOME/.zsh_history
fi
HISTSIZE=10000
SAVEHIST=10000
# Show history
case $HIST_STAMPS in
"mm/dd/yyyy") alias history='fc -fl 1' ;;
"dd.mm.yyyy") alias history='fc -El 1' ;;
"yyyy-mm-dd") alias history='fc -il 1' ;;
*) alias history='fc -l 1' ;;
esac
setopt append_history
setopt extended_history
setopt hist_expire_dups_first
setopt hist_ignore_dups # ignore duplication command history list
setopt hist_ignore_space
setopt hist_verify
setopt inc_append_history
setopt share_history # share command history data
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Zle-Builtins
# http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Standard-Widgets
# Make sure that the terminal is in application mode when zle is active, since
# only then values from $terminfo are valid
if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
function zle-line-init() {
echoti smkx
}
function zle-line-finish() {
echoti rmkx
}
zle -N zle-line-init
zle -N zle-line-finish
fi
bindkey -e # Use emacs key bindings
bindkey '\ew' kill-region # [Esc-w] - Kill from the cursor to the mark
bindkey -s '\el' 'ls\n' # [Esc-l] - run command: ls
bindkey '^r' history-incremental-search-backward # [Ctrl-r] - Search backward incrementally for a specified string. The string may begin with ^ to anchor the search to the beginning of the line.
if [[ "${terminfo[kpp]}" != "" ]]; then
bindkey "${terminfo[kpp]}" up-line-or-history # [PageUp] - Up a line of history
fi
if [[ "${terminfo[knp]}" != "" ]]; then
bindkey "${terminfo[knp]}" down-line-or-history # [PageDown] - Down a line of history
fi
# start typing + [Up-Arrow] - fuzzy find history forward
if [[ "${terminfo[kcuu1]}" != "" ]]; then
autoload -U up-line-or-beginning-search
zle -N up-line-or-beginning-search
bindkey "${terminfo[kcuu1]}" up-line-or-beginning-search
fi
# start typing + [Down-Arrow] - fuzzy find history backward
if [[ "${terminfo[kcud1]}" != "" ]]; then
autoload -U down-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey "${terminfo[kcud1]}" down-line-or-beginning-search
fi
if [[ "${terminfo[khome]}" != "" ]]; then
bindkey "${terminfo[khome]}" beginning-of-line # [Home] - Go to beginning of line
fi
if [[ "${terminfo[kend]}" != "" ]]; then
bindkey "${terminfo[kend]}" end-of-line # [End] - Go to end of line
fi
bindkey ' ' magic-space # [Space] - do history expansion
bindkey '^[[1;5C' forward-word # [Ctrl-RightArrow] - move forward one word
bindkey '^[[1;5D' backward-word # [Ctrl-LeftArrow] - move backward one word
if [[ "${terminfo[kcbt]}" != "" ]]; then
bindkey "${terminfo[kcbt]}" reverse-menu-complete # [Shift-Tab] - move through the completion menu backwards
fi
bindkey '^?' backward-delete-char # [Backspace] - delete backward
if [[ "${terminfo[kdch1]}" != "" ]]; then
bindkey "${terminfo[kdch1]}" delete-char # [Delete] - delete forward
else
bindkey "^[[3~" delete-char
bindkey "^[3;5~" delete-char
bindkey "\e[3~" delete-char
fi
# Edit the current command line in $EDITOR
autoload -U edit-command-line
zle -N edit-command-line
bindkey '\C-x\C-e' edit-command-line
# file rename magick
bindkey "^[m" copy-prev-shell-word
# consider emacs keybindings:
#bindkey -e ## emacs key bindings
#
#bindkey '^[[A' up-line-or-search
#bindkey '^[[B' down-line-or-search
#bindkey '^[^[[C' emacs-forward-word
#bindkey '^[^[[D' emacs-backward-word
#
#bindkey -s '^X^Z' '%-^M'
#bindkey '^[e' expand-cmd-path
#bindkey '^[^I' reverse-menu-complete
#bindkey '^X^N' accept-and-infer-next-history
#bindkey '^W' kill-region
#bindkey '^I' complete-word
## Fix weird sequence that rxvt produces
#bindkey -s '^[[Z' '\t'
#
## Load smart urls if available
# bracketed-paste-magic is known buggy in zsh 5.1.1 (only), so skip it there; see #4434
autoload -Uz is-at-least
if [[ $ZSH_VERSION != 5.1.1 ]]; then
for d in $fpath; do
if [[ -e "$d/url-quote-magic" ]]; then
if is-at-least 5.1; then
autoload -Uz bracketed-paste-magic
zle -N bracketed-paste bracketed-paste-magic
fi
autoload -Uz url-quote-magic
zle -N self-insert url-quote-magic
break
fi
done
fi
## jobs
setopt long_list_jobs
## pager
env_default PAGER 'less'
env_default LESS '-R'
## super user alias
alias _='sudo'
alias please='sudo'
## more intelligent acking for ubuntu users
if which ack-grep &> /dev/null; then
alias afind='ack-grep -il'
else
alias afind='ack -il'
fi
# only define LC_CTYPE if undefined
if [[ -z "$LC_CTYPE" && -z "$LC_ALL" ]]; then
export LC_CTYPE=${LANG%%:*} # pick the first entry from LANG
fi
# recognize comments
setopt interactivecomments
# get the node.js version
function nvm_prompt_info() {
[[ -f "$NVM_DIR/nvm.sh" ]] || return
local nvm_prompt
nvm_prompt=$(node -v 2>/dev/null)
[[ "${nvm_prompt}x" == "x" ]] && return
nvm_prompt=${nvm_prompt:1}
echo "${ZSH_THEME_NVM_PROMPT_PREFIX}${nvm_prompt}${ZSH_THEME_NVM_PROMPT_SUFFIX}"
}
# *_prompt_info functions for usage in your prompt
#
# Plugin creators, please add your *_prompt_info function to the list
# of dummy implementations to help theme creators not receiving errors
# without the need of implementing conditional clauses.
#
# See also lib/bzr.zsh, lib/git.zsh and lib/nvm.zsh for
# git_prompt_info, bzr_prompt_info and nvm_prompt_info
# Dummy implementations that return false to prevent command_not_found
# errors with themes, that implement these functions
# Real implementations will be used when the respective plugins are loaded
function chruby_prompt_info hg_prompt_info pyenv_prompt_info \
rbenv_prompt_info svn_prompt_info vi_mode_prompt_info \
virtualenv_prompt_info {
return 1
}
# oh-my-zsh supports an rvm prompt by default
# get the name of the rvm ruby version
function rvm_prompt_info() {
[ -f $HOME/.rvm/bin/rvm-prompt ] || return 1
local rvm_prompt
rvm_prompt=$($HOME/.rvm/bin/rvm-prompt ${=ZSH_THEME_RVM_PROMPT_OPTIONS} 2>/dev/null)
[[ "${rvm_prompt}x" == "x" ]] && return 1
echo "${ZSH_THEME_RVM_PROMPT_PREFIX:=(}${rvm_prompt}${ZSH_THEME_RVM_PROMPT_SUFFIX:=)}"
}
# use this to enable users to see their ruby version, no matter which
# version management system they use
function ruby_prompt_info() {
echo $(rvm_prompt_info || rbenv_prompt_info || chruby_prompt_info)
}
#! /bin/zsh
# A script to make using 256 colors in zsh less painful.
# P.C. Shyamshankar <sykora@lucentbeing.com>
# Copied from http://github.com/sykora/etc/blob/master/zsh/functions/spectrum/
typeset -AHg FX FG BG
FX=(
reset "%{%}"
bold "%{%}" no-bold "%{%}"
italic "%{%}" no-italic "%{%}"
underline "%{%}" no-underline "%{%}"
blink "%{%}" no-blink "%{%}"
reverse "%{%}" no-reverse "%{%}"
)
for color in {000..255}; do
FG[$color]="%{[38;5;${color}m%}"
BG[$color]="%{[48;5;${color}m%}"
done
ZSH_SPECTRUM_TEXT=${ZSH_SPECTRUM_TEXT:-Arma virumque cano Troiae qui primus ab oris}
# Show all 256 colors with color number
function spectrum_ls() {
for code in {000..255}; do
print -P -- "$code: %{$FG[$code]%}$ZSH_SPECTRUM_TEXT%{$reset_color%}"
done
}
# Show all 256 colors where the background is set to specific color
function spectrum_bls() {
for code in {000..255}; do
print -P -- "$code: %{$BG[$code]%}$ZSH_SPECTRUM_TEXT%{$reset_color%}"
done
}
# Set terminal window and tab/icon title
#
# usage: title short_tab_title [long_window_title]
#
# See: http://www.faqs.org/docs/Linux-mini/Xterm-Title.html#ss3.1
# Fully supports screen, iterm, and probably most modern xterm and rxvt
# (In screen, only short_tab_title is used)
# Limited support for Apple Terminal (Terminal can't set window and tab separately)
function title {
emulate -L zsh
setopt prompt_subst
[[ "$EMACS" == *term* ]] && return
# if $2 is unset use $1 as default
# if it is set and empty, leave it as is
: ${2=$1}
case "$TERM" in
cygwin|xterm*|putty*|rxvt*|ansi)
print -Pn "\e]2;$2:q\a" # set window name
print -Pn "\e]1;$1:q\a" # set tab name
;;
screen*)
print -Pn "\ek$1:q\e\\" # set screen hardstatus
;;
*)
if [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
print -Pn "\e]2;$2:q\a" # set window name
print -Pn "\e]1;$1:q\a" # set tab name
else
# Try to use terminfo to set the title
# If the feature is available set title
if [[ -n "$terminfo[fsl]" ]] && [[ -n "$terminfo[tsl]" ]]; then
echoti tsl
print -Pn "$1"
echoti fsl
fi
fi
;;
esac
}
ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD
ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~"
# Avoid duplication of directory in terminals with independent dir display
if [[ "$TERM_PROGRAM" == Apple_Terminal ]]; then
ZSH_THEME_TERM_TITLE_IDLE="%n@%m"
fi
# Runs before showing the prompt
function omz_termsupport_precmd {
emulate -L zsh
if [[ "$DISABLE_AUTO_TITLE" == true ]]; then
return
fi
title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE
}
# Runs before executing the command
function omz_termsupport_preexec {
emulate -L zsh
setopt extended_glob
if [[ "$DISABLE_AUTO_TITLE" == true ]]; then
return
fi
# cmd name only, or if this is sudo or ssh, the next cmd
local CMD=${1[(wr)^(*=*|sudo|ssh|mosh|rake|-*)]:gs/%/%%}
local LINE="${2:gs/%/%%}"
title '$CMD' '%100>...>$LINE%<<'
}
precmd_functions+=(omz_termsupport_precmd)
preexec_functions+=(omz_termsupport_preexec)
# Keep Apple Terminal.app's current working directory updated
# Based on this answer: http://superuser.com/a/315029
# With extra fixes to handle multibyte chars and non-UTF-8 locales
if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then
# Emits the control sequence to notify Terminal.app of the cwd
# Identifies the directory using a file: URI scheme, including
# the host name to disambiguate local vs. remote paths.
function update_terminalapp_cwd() {
emulate -L zsh
# Percent-encode the pathname.
local URL_PATH="$(omz_urlencode -P $PWD)"
[[ $? != 0 ]] && return 1
# Undocumented Terminal.app-specific control sequence
printf '\e]7;%s\a' "file://$HOST$URL_PATH"
}
# Use a precmd hook instead of a chpwd hook to avoid contaminating output
precmd_functions+=(update_terminalapp_cwd)
# Run once to get initial cwd set
update_terminalapp_cwd
fi
# ls colors
autoload -U colors && colors
# Enable ls colors
export LSCOLORS="Gxfxcxdxbxegedabagacad"
# TODO organise this chaotic logic
if [[ "$DISABLE_LS_COLORS" != "true" ]]; then
# Find the option for using colors in ls, depending on the version
if [[ "$OSTYPE" == 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 && alias ls='gls --color=tty'
elif [[ "$OSTYPE" == openbsd* ]]; then
# On OpenBSD, "gls" (ls from GNU coreutils) and "colorls" (ls from base,
# with color and multibyte support) are available from ports. "colorls"
# will be installed on purpose and can't be pulled in by installing
# coreutils, so prefer it to "gls".
gls --color -d . &>/dev/null && alias ls='gls --color=tty'
colorls -G -d . &>/dev/null && alias ls='colorls -G'
elif [[ "$OSTYPE" == darwin* ]]; then
# this is a good alias, it works by default just using $LSCOLORS
ls -G . &>/dev/null && alias ls='ls -G'
# only use coreutils ls if there is a dircolors customization present ($LS_COLORS or .dircolors file)
# otherwise, gls will use the default color scheme which is ugly af
[[ -n "$LS_COLORS" || -f "$HOME/.dircolors" ]] && gls --color -d . &>/dev/null && alias ls='gls --color=tty'
else
# For GNU ls, we use the default ls color theme. They can later be overwritten by themes.
if [[ -z "$LS_COLORS" ]]; then
(( $+commands[dircolors] )) && eval "$(dircolors -b)"
fi
ls --color -d . &>/dev/null && alias ls='ls --color=tty' || { ls -G . &>/dev/null && alias ls='ls -G' }
# Take advantage of $LS_COLORS for completion as well.
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
fi
fi
setopt auto_cd
setopt multios
setopt prompt_subst
[[ -n "$WINDOW" ]] && SCREEN_NO="%B$WINDOW%b " || SCREEN_NO=""
# Apply theming defaults
PS1="%n@%m:%~%# "
# git theming default: Variables for theming the git info prompt
ZSH_THEME_GIT_PROMPT_PREFIX="git:(" # Prefix at the very beginning of the prompt, before the branch name
ZSH_THEME_GIT_PROMPT_SUFFIX=")" # At the very end of the prompt
ZSH_THEME_GIT_PROMPT_DIRTY="*" # Text to display if the branch is dirty
ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is clean
is_plugin() {
local base_dir=$1
local name=$2
test -f $base_dir/plugins/$name/$name.plugin.zsh \
|| test -f $base_dir/plugins/$name/_$name
}
# Add all defined plugins to fpath. This must be done
# before running compinit.
for plugin ($plugins); do
if is_plugin $ZSH_CUSTOM $plugin; then
fpath=($ZSH_CUSTOM/plugins/$plugin $fpath)
elif is_plugin $ZSH $plugin; then
fpath=($ZSH/plugins/$plugin $fpath)
fi
done
# Figure out the SHORT hostname
if [[ "$OSTYPE" = darwin* ]]; then
# macOS's $HOST changes with dhcp, etc. Use ComputerName if possible.
SHORT_HOST=$(scutil --get ComputerName 2>/dev/null) || SHORT_HOST=${HOST/.*/}
else
SHORT_HOST=${HOST/.*/}
fi
# Save the location of the current completion dump file.
if [ -z "$ZSH_COMPDUMP" ]; then
ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
fi
if [[ $ZSH_DISABLE_COMPFIX != true ]]; then
# If completion insecurities exist, warn the user without enabling completions.
if ! compaudit &>/dev/null; then
# This function resides in the "lib/compfix.zsh" script sourced above.
handle_completion_insecurities
# Else, enable and cache completions to the desired file.
else
compinit -d "${ZSH_COMPDUMP}"
fi
else
compinit -i -d "${ZSH_COMPDUMP}"
fi
#files: 770 version: 5.1.1
_comps=(
'-' '_precommand'
'.' '_source'
'5g' '_go'
'5l' '_go'
'6g' '_go'
'6l' '_go'
'8g' '_go'
'8l' '_go'
'a2dismod' '_a2utils'
'a2dissite' '_a2utils'
'a2enmod' '_a2utils'
'a2ensite' '_a2utils'
'a2ps' '_a2ps'
'aaaa' '_hosts'
'aap' '_aap'
'acpi' '_acpi'
'acpitool' '_acpitool'
'acroread' '_acroread'
'adb' '_adb'
'add-zsh-hook' '_add-zsh-hook'
'admin' '_sccs'
'ali' '_mh'
'alias' '_alias'
'amaya' '_webbrowser'
'analyseplugin' '_analyseplugin'
'animate' '_imagemagick'
'anno' '_mh'
'ant' '_ant'
'antiword' '_antiword'
'aoss' '_precommand'
'apache2ctl' '_apachectl'
'apachectl' '_apachectl'
'apm' '_apm'
'appletviewer' '_java'
'apropos' '_man'
'apt' '_apt'
'apt-cache' '_apt'
'apt-cdrom' '_apt'
'apt-config' '_apt'
'apt-file' '_apt-file'
'apt-get' '_apt'
'aptitude' '_aptitude'
'apt-mark' '_apt'
'apt-move' '_apt-move'
'apt-show-versions' '_apt-show-versions'
'apvlv' '_pdf'
'arena' '_webbrowser'
'arp' '_arp'
'arping' '_arping'
'-array-value-' '_value'
'-assign-parameter-' '_assign'
'at' '_at'
'atq' '_at'
'atrm' '_at'
'attr' '_attr'
'augtool' '_augeas'
'auto-apt' '_auto-apt'
'autoload' '_typeset'
'awk' '_awk'
'axi-cache' '_axi-cache'
'bash' '_sh'
'batch' '_at'
'baz' '_baz'
'beadm' '_beadm'
'_beep' '_beep'
'bg' '_jobs_bg'
'bindkey' '_bindkey'
'bison' '_bison'
'bmake' '_make'
'bogofilter' '_bogofilter'
'bogotune' '_bogofilter'
'bogoutil' '_bogofilter'
'bootctl' '_bootctl'
'bpython' '_bpython'
'bpython2' '_bpython'
'bpython2-gtk' '_bpython'
'bpython2-urwid' '_bpython'
'bpython3' '_bpython'
'bpython3-gtk' '_bpython'
'bpython3-urwid' '_bpython'
'bpython-gtk' '_bpython'
'bpython-urwid' '_bpython'
'-brace-parameter-' '_brace_parameter'
'brctl' '_brctl'
'bsdconfig' '_bsdconfig'
'bsdgrep' '_grep'
'bsdinstall' '_bsdinstall'
'btdownloadcurses' '_bittorrent'
'btdownloadgui' '_bittorrent'
'btdownloadheadless' '_bittorrent'
'btlaunchmany' '_bittorrent'
'btlaunchmanycurses' '_bittorrent'
'btmakemetafile' '_bittorrent'
'btreannounce' '_bittorrent'
'btrename' '_bittorrent'
'btrfs' '_btrfs'
'bts' '_bts'
'btshowmetainfo' '_bittorrent'
'bttrack' '_bittorrent'
'bug' '_bug'
'buildhash' '_ispell'
'builtin' '_builtin'
'bunzip2' '_bzip2'
'burst' '_mh'
'busctl' '_busctl'
'bzcat' '_bzip2'
'bzip2' '_bzip2'
'bzip2recover' '_bzip2'
'bzr' '_bzr'
'c++' '_gcc'
'cabal' '_cabal'
'cal' '_cal'
'calendar' '_calendar'
'cat' '_cat'
'catchsegv' '_precommand'
'cc' '_gcc'
'ccal' '_ccal'
'cd' '_cd'
'cdbs-edit-patch' '_cdbs-edit-patch'
'cdc' '_sccs'
'cdcd' '_cdcd'
'cdr' '_cdr'
'cdrdao' '_cdrdao'
'cdrecord' '_cdrecord'
'certtool' '_gnutls'
'cftp' '_twisted'
'chage' '_users'
'chdir' '_cd'
'chflags' '_chflags'
'chfn' '_users'
'chgrp' '_chown'
'chimera' '_webbrowser'
'chkconfig' '_chkconfig'
'chmod' '_chmod'
'chown' '_chown'
'chpass' '_chsh'
'chrt' '_chrt'
'chsh' '_chsh'
'ci' '_rcs'
'ckeygen' '_twisted'
'clang' '_gcc'
'clang++' '_gcc'
'clay' '_clay'
'clear' '_nothing'
'cmp' '_cmp'
'co' '_rcs'
'comb' '_sccs'
'combine' '_imagemagick'
'combinediff' '_patchutils'
'comm' '_comm'
'command' '_command'
'-command-' '_autocd'
'-command-line-' '_normal'
'comp' '_mh'
'compadd' '_compadd'
'compdef' '_compdef'
'composite' '_imagemagick'
'compress' '_compress'
'conch' '_twisted'
'-condition-' '_condition'
'config.status' '_configure'
'configure' '_configure'
'convert' '_imagemagick'
'coreadm' '_coreadm'
'cowsay' '_cowsay'
'cowthink' '_cowsay'
'cp' '_cp'
'cpio' '_cpio'
'cplay' '_cplay'
'crsh' '_cssh'
'cryptsetup' '_cryptsetup'
'csh' '_sh'
'cssh' '_cssh'
'csup' '_csup'
'curl' '_curl'
'cut' '_cut'
'cvs' '_cvs'
'cvsup' '_cvsup'
'cygcheck' '_cygcheck'
'cygcheck.exe' '_cygcheck'
'cygpath' '_cygpath'
'cygpath.exe' '_cygpath'
'cygrunsrv' '_cygrunsrv'
'cygrunsrv.exe' '_cygrunsrv'
'cygserver' '_cygserver'
'cygserver.exe' '_cygserver'
'cygstart' '_cygstart'
'cygstart.exe' '_cygstart'
'dak' '_dak'
'darcs' '_darcs'
'date' '_date'
'dbus-monitor' '_dbus'
'dbus-send' '_dbus'
'dch' '_debchange'
'dchroot' '_dchroot'
'dchroot-dsa' '_dchroot-dsa'
'dcop' '_dcop'
'dcopclient' '_dcop'
'dcopfind' '_dcop'
'dcopobject' '_dcop'
'dcopref' '_dcop'
'dcopstart' '_dcop'
'dcut' '_dcut'
'dd' '_dd'
'debchange' '_debchange'
'debcheckout' '_debcheckout'
'debdiff' '_debdiff'
'debfoster' '_debfoster'
'debsign' '_debsign'
'declare' '_typeset'
'-default-' '_default'
'defaults' '_defaults'
'delta' '_sccs'
'devtodo' '_devtodo'
'df' '_df'
'dhclient' '_dhclient'
'dhclient3' '_dhclient'
'dhcpinfo' '_dhcpinfo'
'dict' '_dict'
'diff' '_diff'
'diffstat' '_diffstat'
'dillo' '_webbrowser'
'dircmp' '_directories'
'dirs' '_dirs'
'disable' '_disable'
'disown' '_jobs_fg'
'display' '_imagemagick'
'dist' '_mh'
'django-admin' '_django'
'django-admin.py' '_django'
'dladm' '_dladm'
'dlocate' '_dlocate'
'dmake' '_make'
'dmidecode' '_dmidecode'
'dnf' '_dnf'
'docker' '_docker'
'docker-compose' '_docker-compose'
'dockerd' '_docker'
'domainname' '_yp'
'dosdel' '_floppy'
'dosread' '_floppy'
'dpatch-edit-patch' '_dpatch-edit-patch'
'dpkg' '_dpkg'
'dpkg-buildpackage' '_dpkg-buildpackage'
'dpkg-cross' '_dpkg-cross'
'dpkg-deb' '_dpkg'
'dpkg-query' '_dpkg'
'dpkg-reconfigure' '_dpkg'
'dpkg-repack' '_dpkg-repack'
'dpkg-source' '_dpkg_source'
'dput' '_dput'
'dsh' '_dsh'
'dtrace' '_dtrace'
'du' '_du'
'dumpadm' '_dumpadm'
'dumper' '_dumper'
'dumper.exe' '_dumper'
'dupload' '_dupload'
'dvibook' '_dvi'
'dviconcat' '_dvi'
'dvicopy' '_dvi'
'dvidvi' '_dvi'
'dvipdf' '_dvi'
'dvips' '_dvi'
'dviselect' '_dvi'
'dvitodvi' '_dvi'
'dvitype' '_dvi'
'dwb' '_webbrowser'
'ecasound' '_ecasound'
'echotc' '_echotc'
'echoti' '_echoti'
'egrep' '_grep'
'elfdump' '_elfdump'
'elinks' '_elinks'
'elm' '_elm'
'emulate' '_emulate'
'enable' '_enable'
'enscript' '_enscript'
'env' '_env'
'epdfview' '_pdf'
'epsffit' '_psutils'
'-equal-' '_equal'
'erb' '_ruby'
'espeak' '_espeak'
'etags' '_etags'
'ethtool' '_ethtool'
'eu-nm' '_nm'
'eu-readelf' '_readelf'
'eval' '_precommand'
'eview' '_vim'
'evim' '_vim'
'evince' '_pspdf'
'exec' '_precommand'
'explodepkg' '_pkgtool'
'export' '_typeset'
'express' '_webbrowser'
'extcheck' '_java'
'extractres' '_psutils'
'fakeroot' '_fakeroot'
'false' '_nothing'
'fc' '_fc'
'fc-list' '_xft_fonts'
'fc-match' '_xft_fonts'
'feh' '_feh'
'fetch' '_fetch'
'fetchmail' '_fetchmail'
'ffmpeg' '_ffmpeg'
'fg' '_jobs_fg'
'fgrep' '_grep'
'figlet' '_figlet'
'filterdiff' '_patchutils'
'find' '_find'
'findaffix' '_ispell'
'finger' '_finger'
'fink' '_fink'
'firefox' '_mozilla'
'-first-' '_first'
'fixdlsrps' '_psutils'
'fixfmps' '_psutils'
'fixmacps' '_psutils'
'fixpsditps' '_psutils'
'fixpspps' '_psutils'
'fixscribeps' '_psutils'
'fixtpps' '_psutils'
'fixwfwps' '_psutils'
'fixwpps' '_psutils'
'fixwwps' '_psutils'
'flasher' '_flasher'
'flex' '_flex'
'flipdiff' '_patchutils'
'flist' '_mh'
'flists' '_mh'
'float' '_typeset'
'flowadm' '_flowadm'
'fmadm' '_fmadm'
'fmttest' '_mh'
'fned' '_zed'
'fnext' '_mh'
'folder' '_mh'
'folders' '_mh'
'fortune' '_fortune'
'forw' '_mh'
'fprev' '_mh'
'freebsd-make' '_make'
'freebsd-update' '_freebsd-update'
'fsh' '_fsh'
'fstat' '_fstat'
'ftp' '_hosts'
'functions' '_typeset'
'fuser' '_fuser'
'fusermount' '_fusermount'
'fwhois' '_whois'
'g++' '_gcc'
'galeon' '_webbrowser'
'gcc' '_gcc'
'gccgo' '_go'
'gchmod' '_chmod'
'gcmp' '_cmp'
'gcomm' '_comm'
'gcore' '_gcore'
'gcp' '_cp'
'gdate' '_date'
'gdb' '_gdb'
'gdiff' '_diff'
'gdu' '_du'
'genisoimage' '_genisoimage'
'get' '_sccs'
'getafm' '_psutils'
'getclip' '_getclip'
'getclip.exe' '_getclip'
'getconf' '_getconf'
'getent' '_getent'
'getfacl' '_getfacl'
'getfacl.exe' '_getfacl'
'getfattr' '_attr'
'getmail' '_getmail'
'getopts' '_vars'
'gex' '_vim'
'gfind' '_find'
'ggv' '_gnome-gv'
'ghostscript' '_gs'
'ghostview' '_pspdf'
'gid' '_id'
'git' '_git'
'git-buildpackage' '_git-buildpackage'
'git-cvsserver' '_git'
'gitk' '_git'
'git-receive-pack' '_git'
'git-shell' '_git'
'git-upload-archive' '_git'
'git-upload-pack' '_git'
'gjoin' '_join'
'gln' '_ln'
'global' '_global'
'gls' '_ls'
'gm' '_graphicsmagick'
'gmake' '_make'
'gmd5sum' '_md5sum'
'gmkdir' '_mkdir'
'gmplayer' '_mplayer'
'gnl' '_nl'
'gnome-gv' '_gnome-gv'
'gnupod_addsong' '_gnupod'
'gnupod_addsong.pl' '_gnupod'
'gnupod_check' '_gnupod'
'gnupod_check.pl' '_gnupod'
'gnupod_INIT' '_gnupod'
'gnupod_INIT.pl' '_gnupod'
'gnupod_search' '_gnupod'
'gnupod_search.pl' '_gnupod'
'gnutls-cli' '_gnutls'
'gnutls-cli-debug' '_gnutls'
'god' '_od'
'gofmt' '_go'
'gpatch' '_patch'
'gpg' '_gpg'
'gpg2' '_gpg'
'gpgv' '_gpg'
'gpg-zip' '_gpg'
'gphoto2' '_gphoto2'
'gprof' '_gprof'
'gqview' '_gqview'
'gradle' '_gradle'
'gradlew' '_gradle'
'grail' '_webbrowser'
'grep' '_grep'
'grepdiff' '_patchutils'
'grep-excuses' '_grep-excuses'
'grm' '_rm'
'groff' '_groff'
'groupadd' '_user_admin'
'groupdel' '_groups'
'groupmod' '_user_admin'
'groups' '_users'
'growisofs' '_growisofs'
'gs' '_gs'
'gsbj' '_pspdf'
'gsdj' '_pspdf'
'gsdj500' '_pspdf'
'gsed' '_sed'
'gslj' '_pspdf'
'gslp' '_pspdf'
'gsnd' '_pspdf'
'gsort' '_sort'
'gtar' '_tar'
'guilt' '_guilt'
'guilt-add' '_guilt'
'guilt-applied' '_guilt'
'guilt-delete' '_guilt'
'guilt-files' '_guilt'
'guilt-fold' '_guilt'
'guilt-fork' '_guilt'
'guilt-header' '_guilt'
'guilt-help' '_guilt'
'guilt-import' '_guilt'
'guilt-import-commit' '_guilt'
'guilt-init' '_guilt'
'guilt-new' '_guilt'
'guilt-next' '_guilt'
'guilt-patchbomb' '_guilt'
'guilt-pop' '_guilt'
'guilt-prev' '_guilt'
'guilt-push' '_guilt'
'guilt-rebase' '_guilt'
'guilt-refresh' '_guilt'
'guilt-rm' '_guilt'
'guilt-series' '_guilt'
'guilt-status' '_guilt'
'guilt-top' '_guilt'
'guilt-unapplied' '_guilt'
'guniq' '_uniq'
'gunzip' '_gzip'
'gv' '_gv'
'gview' '_vim'
'gvim' '_vim'
'gvimdiff' '_vim'
'gwc' '_wc'
'gxargs' '_xargs'
'gzcat' '_gzip'
'gzilla' '_webbrowser'
'gzip' '_gzip'
'hash' '_hash'
'hdiutil' '_hdiutil'
'help' '_sccs'
'hg' '_hg'
'hilite' '_precommand'
'history' '_fc'
'host' '_hosts'
'hostnamectl' '_hostnamectl'
'hotjava' '_webbrowser'
'hwinfo' '_hwinfo'
'iceweasel' '_mozilla'
'icombine' '_ispell'
'iconv' '_iconv'
'id' '_id'
'identify' '_imagemagick'
'ifconfig' '_ifconfig'
'ifdown' '_net_interfaces'
'iftop' '_iftop'
'ifup' '_net_interfaces'
'ijoin' '_ispell'
'import' '_imagemagick'
'inc' '_mh'
'includeres' '_psutils'
'inetadm' '_inetadm'
'info' '_texinfo'
'infocmp' '_terminals'
'initctl' '_initctl'
'insmod' '_modutils'
'install-info' '_texinfo'
'installpkg' '_pkgtool'
'integer' '_typeset'
'interdiff' '_patchutils'
'invoke-rc.d' '_invoke-rc.d'
'ionice' '_ionice'
'ip' '_ip'
'ipadm' '_ipadm'
'ipset' '_ipset'
'iptables' '_iptables'
'iptables-restore' '_iptables'
'iptables-save' '_iptables'
'irb' '_ruby'
'irssi' '_irssi'
'ispell' '_ispell'
'iwconfig' '_iwconfig'
'jadetex' '_tex'
'jar' '_java'
'jarsigner' '_java'
'java' '_java'
'javac' '_java'
'javadoc' '_java'
'javah' '_java'
'javap' '_java'
'jdb' '_java'
'jexec' '_jexec'
'jls' '_jls'
'jobs' '_jobs_builtin'
'joe' '_joe'
'join' '_join'
'journalctl' '_journalctl'
'keytool' '_java'
'kfmclient' '_kfmclient'
'kill' '_kill'
'killall' '_killall'
'killall5' '_killall'
'kioclient' '_kfmclient'
'kldload' '_kld'
'kldunload' '_kld'
'knock' '_knock'
'konqueror' '_webbrowser'
'kpdf' '_pdf'
'ksh' '_sh'
'kvno' '_kvno'
'last' '_last'
'lastb' '_last'
'latex' '_tex'
'latexmk' '_tex'
'ldd' '_ldd'
'less' '_less'
'let' '_math'
'lftp' '_ncftp'
'lha' '_lha'
'light' '_webbrowser'
'lighty-disable-mod' '_lighttpd'
'lighty-enable-mod' '_lighttpd'
'limit' '_limit'
'links' '_links'
'lintian' '_lintian'
'lintian-info' '_lintian'
'linux' '_uml'
'llvm-g++' '_gcc'
'llvm-gcc' '_gcc'
'ln' '_ln'
'loadkeys' '_loadkeys'
'local' '_typeset'
'localectl' '_localectl'
'locate' '_locate'
'log' '_nothing'
'loginctl' '_loginctl'
'logname' '_nothing'
'look' '_look'
'lore' '_twisted'
'losetup' '_losetup'
'lp' '_lp'
'lpadmin' '_lp'
'lpinfo' '_lp'
'lpoptions' '_lp'
'lpq' '_lp'
'lpr' '_lp'
'lprm' '_lp'
'lpstat' '_lp'
'ls' '_ls'
'lscfg' '_lscfg'
'lsdev' '_lsdev'
'lsdiff' '_patchutils'
'lslv' '_lslv'
'lsmod' '_modutils'
'lsof' '_lsof'
'lspv' '_lspv'
'lsusb' '_lsusb'
'lsvg' '_lsvg'
'lynx' '_lynx'
'lzcat' '_xz'
'lzma' '_xz'
'lzop' '_lzop'
'm-a' '_module-assistant'
'madison' '_madison'
'mail' '_mail'
'Mail' '_mail'
'mailx' '_mail'
'make' '_make'
'makeinfo' '_texinfo'
'make-kpkg' '_make-kpkg'
'makepkg' '_pkgtool'
'man' '_man'
'manage.py' '_django'
'manhole' '_twisted'
'mark' '_mh'
'-math-' '_math'
'matlab' '_matlab'
'mattrib' '_mtools'
'mcd' '_mtools'
'mcopy' '_mtools'
'md5sum' '_md5sum'
'mdadm' '_mdadm'
'mdel' '_mtools'
'mdeltree' '_mtools'
'mdir' '_mtools'
'mdu' '_mtools'
'members' '_members'
'mencal' '_mencal'
'mere' '_mere'
'merge' '_rcs'
'mergechanges' '_mergechanges'
'metaflac' '_metaflac'
'mformat' '_mtools'
'mgv' '_pspdf'
'mhfixmsg' '_mh'
'mhlist' '_mh'
'mhmail' '_mh'
'mhn' '_mh'
'mhparam' '_mh'
'mhpath' '_mh'
'mhshow' '_mh'
'mhstore' '_mh'
'mii-tool' '_mii-tool'
'mixerctl' '_mixerctl'
'mkdir' '_mkdir'
'mkisofs' '_growisofs'
'mkshortcut' '_mkshortcut'
'mkshortcut.exe' '_mkshortcut'
'mktunes' '_gnupod'
'mktunes.pl' '_gnupod'
'mkzsh' '_mkzsh'
'mkzsh.exe' '_mkzsh'
'mlabel' '_mtools'
'mlocate' '_locate'
'mmd' '_mtools'
'mmm' '_webbrowser'
'mmount' '_mtools'
'mmove' '_mtools'
'modinfo' '_modutils'
'modprobe' '_modutils'
'module' '_module'
'module-assistant' '_module-assistant'
'mogrify' '_imagemagick'
'mondoarchive' '_mondo'
'montage' '_imagemagick'
'moosic' '_moosic'
'Mosaic' '_webbrowser'
'mosh' '_mosh'
'mount' '_mount'
'mozilla' '_mozilla'
'mozilla-firefox' '_mozilla'
'mozilla-xremote-client' '_mozilla'
'mpc' '_mpc'
'mplayer' '_mplayer'
'mrd' '_mtools'
'mread' '_mtools'
'mren' '_mtools'
'msgchk' '_mh'
'mt' '_mt'
'mtn' '_monotone'
'mtoolstest' '_mtools'
'mtr' '_mtr'
'mtype' '_mtools'
'munchlist' '_ispell'
'mupdf' '_pdf'
'mush' '_mail'
'mutt' '_mutt'
'mx' '_hosts'
'mysql' '_mysql_utils'
'mysqladmin' '_mysql_utils'
'mysqldiff' '_mysqldiff'
'mysqldump' '_mysql_utils'
'mysqlimport' '_mysql_utils'
'mysqlshow' '_mysql_utils'
'nail' '_mail'
'native2ascii' '_java'
'nautilus' '_nautilus'
'nc' '_netcat'
'ncal' '_cal'
'ncftp' '_ncftp'
'ncl' '_nedit'
'nedit' '_nedit'
'nedit-nc' '_nedit'
'netcat' '_netcat'
'netrik' '_webbrowser'
'netscape' '_netscape'
'netstat' '_netstat'
'new' '_mh'
'newgrp' '_groups'
'next' '_mh'
'nice' '_nice'
'nkf' '_nkf'
'nl' '_nl'
'nm' '_nm'
'nmap' '_nmap'
'nmblookup' '_samba'
'nmcli' '_nmcli'
'nocorrect' '_precommand'
'noglob' '_precommand'
'nohup' '_precommand'
'notmuch' '_notmuch'
'npm' '_npm'
'ns' '_hosts'
'nslookup' '_nslookup'
'ntalk' '_other_accounts'
'nvim' '_vim'
'od' '_od'
'odme' '_object_classes'
'odmget' '_object_classes'
'odmshow' '_object_classes'
'ogg123' '_vorbis'
'oggdec' '_vorbis'
'oggenc' '_vorbis'
'ogginfo' '_vorbis'
'okular' '_okular'
'open' '_open'
'opera' '_webbrowser'
'opera-next' '_webbrowser'
'osc' '_osc'
'p4' '_perforce'
'p4d' '_perforce'
'pacat' '_pulseaudio'
'pack' '_pack'
'packf' '_mh'
'pacmd' '_pulseaudio'
'pactl' '_pulseaudio'
'padsp' '_pulseaudio'
'paplay' '_pulseaudio'
'-parameter-' '_parameter'
'parec' '_pulseaudio'
'parecord' '_pulseaudio'
'parsehdlist' '_urpmi'
'passwd' '_users'
'pasuspender' '_pulseaudio'
'patch' '_patch'
'pax' '_pax'
'pbuilder' '_pbuilder'
'pcat' '_pack'
'pcred' '_pids'
'pdf2dsc' '_pdf'
'pdf2ps' '_pdf'
'pdffonts' '_pdf'
'pdfimages' '_pdf'
'pdfinfo' '_pdf'
'pdfjadetex' '_tex'
'pdflatex' '_tex'
'pdfopt' '_pdf'
'pdftex' '_tex'
'pdftk' '_pdftk'
'pdftopbm' '_pdf'
'pdftops' '_pdf'
'pdftotext' '_pdf'
'perl' '_perl'
'perldoc' '_perldoc'
'pfctl' '_pfctl'
'pfexec' '_pfexec'
'pfiles' '_pids'
'pflags' '_pids'
'pgrep' '_pgrep'
'php' '_php'
'pick' '_mh'
'pigz' '_gzip'
'pine' '_pine'
'pinef' '_pine'
'ping' '_ping'
'piuparts' '_piuparts'
'pkg' '_pkg5'
'pkgadd' '_pkgadd'
'pkg_add' '_bsd_pkg'
'pkg-config' '_pkg-config'
'pkg_create' '_bsd_pkg'
'pkg_delete' '_bsd_pkg'
'pkginfo' '_pkginfo'
'pkg_info' '_bsd_pkg'
'pkgrm' '_pkgrm'
'pkgtool' '_pkgtool'
'pkill' '_pgrep'
'pldd' '_pids'
'pmake' '_make'
'pman' '_perl_modules'
'pmap' '_pids'
'pmcat' '_perl_modules'
'pmdesc' '_perl_modules'
'pmeth' '_perl_modules'
'pmexp' '_perl_modules'
'pmfunc' '_perl_modules'
'pmload' '_perl_modules'
'pmls' '_perl_modules'
'pmpath' '_perl_modules'
'pmvers' '_perl_modules'
'podgrep' '_perl_modules'
'podpath' '_perl_modules'
'podtoc' '_perl_modules'
'poff' '_pon'
'policytool' '_java'
'pon' '_pon'
'popd' '_directory_stack'
'portaudit' '_portaudit'
'portlint' '_portlint'
'portmaster' '_portmaster'
'portsnap' '_portsnap'
'postsuper' '_postfix'
'powerd' '_powerd'
'prcs' '_prcs'
'prev' '_mh'
'print' '_print'
'printenv' '_printenv'
'printf' '_print'
'procstat' '_procstat'
'prompt' '_prompt'
'prove' '_prove'
'prs' '_sccs'
'prstat' '_prstat'
'prt' '_sccs'
'prun' '_pids'
'ps' '_ps'
'ps2ascii' '_pspdf'
'ps2epsi' '_postscript'
'ps2pdf' '_postscript'
'ps2pdf12' '_postscript'
'ps2pdf13' '_postscript'
'ps2pdf14' '_postscript'
'ps2pdfwr' '_postscript'
'ps2ps' '_postscript'
'psbook' '_psutils'
'pscp' '_pscp'
'pscp.exe' '_pscp'
'psed' '_sed'
'psig' '_pids'
'psmerge' '_psutils'
'psmulti' '_postscript'
'psnup' '_psutils'
'psresize' '_psutils'
'psselect' '_psutils'
'pstack' '_pids'
'pstoedit' '_pspdf'
'pstop' '_pids'
'pstops' '_psutils'
'pstotgif' '_pspdf'
'pswrap' '_postscript'
'ptree' '_ptree'
'pulseaudio' '_pulseaudio'
'pump' '_pump'
'pushd' '_cd'
'putclip' '_putclip'
'putclip.exe' '_putclip'
'pwait' '_pids'
'pwdx' '_pids'
'pyhtmlizer' '_twisted'
'python' '_python'
'qdbus' '_qdbus'
'qiv' '_qiv'
'qtplay' '_qtplay'
'querybts' '_bug'
'quilt' '_quilt'
'r' '_fc'
'raggle' '_raggle'
'rake' '_rake'
'ranlib' '_ranlib'
'rar' '_rar'
'rc' '_sh'
'rcp' '_rlogin'
'rcs' '_rcs'
'rcsdiff' '_rcs'
'rdesktop' '_rdesktop'
'read' '_read'
'readelf' '_readelf'
'readonly' '_typeset'
'readshortcut' '_readshortcut'
'readshortcut.exe' '_readshortcut'
'rebootin' '_rebootin'
'-redirect-' '_redirect'
'-redirect-,<,bunzip2' '_bzip2'
'-redirect-,<,bzip2' '_bzip2'
'-redirect-,>,bzip2' '_bzip2'
'-redirect-,<,compress' '_compress'
'-redirect-,>,compress' '_compress'
'-redirect-,-default-,-default-' '_files'
'-redirect-,<,gunzip' '_gzip'
'-redirect-,<,gzip' '_gzip'
'-redirect-,>,gzip' '_gzip'
'-redirect-,<,uncompress' '_compress'
'-redirect-,<,unxz' '_xz'
'-redirect-,<,xz' '_xz'
'-redirect-,>,xz' '_xz'
'refile' '_mh'
'rehash' '_hash'
'reload' '_initctl'
'removepkg' '_pkgtool'
'remsh' '_rlogin'
'renice' '_renice'
'repl' '_mh'
'reportbug' '_bug'
'reprepro' '_reprepro'
'restart' '_initctl'
'retawq' '_webbrowser'
'rgview' '_vim'
'rgvim' '_vim'
'ri' '_ri'
'rlogin' '_rlogin'
'rm' '_rm'
'rmadison' '_madison'
'rmdel' '_sccs'
'rmdir' '_directories'
'rmf' '_mh'
'rmic' '_java'
'rmid' '_java'
'rmiregistry' '_java'
'rmm' '_mh'
'rmmod' '_modutils'
'rpm' '_rpm'
'rpmbuild' '_rpmbuild'
'rrdtool' '_rrdtool'
'rsh' '_rlogin'
'rsync' '_rsync'
'rtin' '_tin'
'rubber' '_rubber'
'rubber-info' '_rubber'
'rubber-pipe' '_rubber'
'ruby' '_ruby'
'run-help' '_run-help'
'rup' '_hosts'
'rusage' '_precommand'
'rview' '_vim'
'rvim' '_vim'
'rwho' '_hosts'
'rxvt' '_urxvt'
's2p' '_sed'
'sabcmd' '_sablotron'
'sact' '_sccs'
'savecore' '_savecore'
'scan' '_mh'
'sccs' '_sccs'
'sccsdiff' '_sccs'
'sched' '_sched'
'schedtool' '_schedtool'
'schroot' '_schroot'
'scp' '_ssh'
'screen' '_screen'
'sed' '_sed'
'serialver' '_java'
'service' '_service'
'set' '_set'
'setfacl' '_setfacl'
'setfacl.exe' '_setfacl'
'setfattr' '_attr'
'setopt' '_setopt'
'sftp' '_ssh'
'sh' '_sh'
'shift' '_arrays'
'show' '_mh'
'showchar' '_psutils'
'showmount' '_showmount'
'sisu' '_sisu'
'skipstone' '_webbrowser'
'slitex' '_tex'
'slocate' '_locate'
'slogin' '_ssh'
'slrn' '_slrn'
'smbclient' '_samba'
'smbcontrol' '_samba'
'smbstatus' '_samba'
'smit' '_smit'
'smitty' '_smit'
'snoop' '_snoop'
'soa' '_hosts'
'socket' '_socket'
'sockstat' '_sockstat'
'softwareupdate' '_softwareupdate'
'sort' '_sort'
'sortm' '_mh'
'source' '_source'
'spamassassin' '_spamassassin'
'splitdiff' '_patchutils'
'sqlite' '_sqlite'
'sqlite3' '_sqlite'
'sqsh' '_sqsh'
'sr' '_surfraw'
'srptool' '_gnutls'
'ss' '_ss'
'ssh' '_ssh'
'ssh-add' '_ssh'
'ssh-agent' '_ssh'
'ssh-copy-id' '_ssh'
'sshfs' '_sshfs'
'ssh-keygen' '_ssh'
'star' '_tar'
'start' '_initctl'
'stat' '_stat'
'status' '_initctl'
'stg' '_stgit'
'stop' '_initctl'
'strace' '_strace'
'strftime' '_strftime'
'strip' '_strip'
'stty' '_stty'
'su' '_su'
'-subscript-' '_subscript'
'sudo' '_sudo'
'sudoedit' '_sudo'
'surfraw' '_surfraw'
'SuSEconfig' '_SUSEconfig'
'sv' '_runit'
'svcadm' '_svcadm'
'svccfg' '_svccfg'
'svcprop' '_svcprop'
'svcs' '_svcs'
'svn' '_subversion'
'svnadmin' '_subversion'
'svnadmin-static' '_subversion'
'svn-buildpackage' '_svn-buildpackage'
'sync' '_nothing'
'sysctl' '_sysctl'
'systat' '_systat'
'systemctl' '_systemctl'
'systemd-analyze' '_systemd-analyze'
'systemd-ask-password' '_systemd'
'systemd-cat' '_systemd'
'systemd-cgls' '_systemd'
'systemd-cgtop' '_systemd'
'systemd-delta' '_systemd-delta'
'systemd-detect-virt' '_systemd'
'systemd-inhibit' '_systemd-inhibit'
'systemd-machine-id-setup' '_systemd'
'systemd-notify' '_systemd'
'systemd-run' '_systemd-run'
'systemd-tmpfiles' '_systemd-tmpfiles'
'systemd-tty-ask-password-agent' '_systemd'
'system_profiler' '_system_profiler'
'talk' '_other_accounts'
'tap2deb' '_twisted'
'tap2rpm' '_twisted'
'tapconvert' '_twisted'
'tar' '_tar'
'tardy' '_tardy'
'tcpdump' '_tcpdump'
'tcp_open' '_tcpsys'
'tcptraceroute' '_tcptraceroute'
'tcsh' '_sh'
'tda' '_devtodo'
'tdd' '_devtodo'
'tde' '_devtodo'
'tdr' '_devtodo'
'telnet' '_telnet'
'tex' '_tex'
'texi2dvi' '_texinfo'
'texindex' '_texinfo'
'tg' '_topgit'
'tidy' '_tidy'
'tig' '_git'
'-tilde-' '_tilde'
'time' '_precommand'
'timedatectl' '_timedatectl'
'times' '_nothing'
'tin' '_tin'
'tkconch' '_twisted'
'tkinfo' '_texinfo'
'tla' '_tla'
'tmux' '_tmux'
'todo' '_devtodo'
'todo.sh' '_todo.sh'
'toilet' '_toilet'
'totdconfig' '_totd'
'tpb' '_tpb'
'tpconfig' '_tpconfig'
'tpkg-debarch' '_toolchain-source'
'tpkg-install' '_toolchain-source'
'tpkg-install-libc' '_toolchain-source'
'tpkg-make' '_toolchain-source'
'tpkg-update' '_toolchain-source'
'tracepath' '_tracepath'
'tracepath6' '_tracepath'
'traceroute' '_hosts'
'trap' '_trap'
'tree' '_tree'
'trial' '_twisted'
'true' '_nothing'
'tryaffix' '_ispell'
'ttyctl' '_ttyctl'
'tunctl' '_uml'
'tune2fs' '_tune2fs'
'tunes2pod' '_gnupod'
'tunes2pod.pl' '_gnupod'
'twidge' '_twidge'
'twistd' '_twisted'
'txt' '_hosts'
'type' '_which'
'typeset' '_typeset'
'udevadm' '_udevadm'
'ulimit' '_ulimit'
'uml_mconsole' '_uml'
'uml_moo' '_uml'
'uml_switch' '_uml'
'umount' '_mount'
'unace' '_unace'
'unalias' '_aliases'
'uname' '_uname'
'uncompress' '_compress'
'unexpand' '_unexpand'
'unfunction' '_functions'
'unget' '_sccs'
'unhash' '_unhash'
'uniq' '_uniq'
'unison' '_unison'
'units' '_units'
'unlimit' '_limits'
'unlzma' '_xz'
'unpack' '_pack'
'unpigz' '_gzip'
'unrar' '_rar'
'unset' '_vars'
'unsetopt' '_setopt'
'unwrapdiff' '_patchutils'
'unxz' '_xz'
'unzip' '_zip'
'update-alternatives' '_update-alternatives'
'update-rc.d' '_update-rc.d'
'upgradepkg' '_pkgtool'
'urpme' '_urpmi'
'urpmf' '_urpmi'
'urpmi' '_urpmi'
'urpmi.addmedia' '_urpmi'
'urpmi.removemedia' '_urpmi'
'urpmi.update' '_urpmi'
'urpmq' '_urpmi'
'urxvt' '_urxvt'
'urxvt256c' '_urxvt'
'urxvt256cc' '_urxvt'
'urxvt256c-ml' '_urxvt'
'urxvt256c-mlc' '_urxvt'
'urxvtc' '_urxvt'
'uscan' '_uscan'
'useradd' '_user_admin'
'userdel' '_users'
'usermod' '_user_admin'
'uzbl' '_uzbl'
'uzbl-browser' '_uzbl'
'uzbl-tabbed' '_uzbl'
'val' '_sccs'
'valgrind' '_valgrind'
'-value-' '_value'
'-value-,ADB_TRACE,-default-' '_adb'
'-value-,ANDROID_LOG_TAGS,-default-' '_adb'
'-value-,ANDROID_SERIAL,-default-' '_adb'
'-value-,ANT_ARGS,-default-' '_ant'
'-value-,CFLAGS,-default-' '_gcc'
'-value-,CPPFLAGS,-default-' '_gcc'
'-value-,CXXFLAGS,-default-' '_gcc'
'-value-,-default-,-command-' '_zargs'
'-value-,-default-,-default-' '_value'
'-value-,DISPLAY,-default-' '_x_display'
'-value-,GREP_OPTIONS,-default-' '_grep'
'-value-,GZIP,-default-' '_gzip'
'-value-,LANG,-default-' '_locales'
'-value-,LANGUAGE,-default-' '_locales'
'-value-,LD_DEBUG,-default-' '_ld_debug'
'-value-,LDFLAGS,-default-' '_gcc'
'-value-,LESSCHARSET,-default-' '_less'
'-value-,LESS,-default-' '_less'
'-value-,LPDEST,-default-' '_printers'
'-value-,P4CLIENT,-default-' '_perforce'
'-value-,P4MERGE,-default-' '_perforce'
'-value-,P4PORT,-default-' '_perforce'
'-value-,P4USER,-default-' '_perforce'
'-value-,PERLDOC,-default-' '_perldoc'
'-value-,PRINTER,-default-' '_printers'
'-value-,PROMPT2,-default-' '_ps1234'
'-value-,PROMPT3,-default-' '_ps1234'
'-value-,PROMPT4,-default-' '_ps1234'
'-value-,PROMPT,-default-' '_ps1234'
'-value-,PS1,-default-' '_ps1234'
'-value-,PS2,-default-' '_ps1234'
'-value-,PS3,-default-' '_ps1234'
'-value-,PS4,-default-' '_ps1234'
'-value-,RPROMPT2,-default-' '_ps1234'
'-value-,RPROMPT,-default-' '_ps1234'
'-value-,RPS1,-default-' '_ps1234'
'-value-,RPS2,-default-' '_ps1234'
'-value-,SPROMPT,-default-' '_ps1234'
'-value-,TERM,-default-' '_terminals'
'-value-,TERMINFO_DIRS,-default-' '_dir_list'
'-value-,TZ,-default-' '_time_zone'
'-value-,VALGRIND_OPTS,-default-' '_valgrind'
'-value-,WWW_HOME,-default-' '_urls'
'-value-,XML_CATALOG_FILES,-default-' '_xmlsoft'
'-value-,XZ_DEFAULTS,-default-' '_xz'
'-value-,XZ_OPT,-default-' '_xz'
'vared' '_vared'
'-vared-' '_in_vared'
'vcsh' '_vcsh'
'vim' '_vim'
'vim-addons' '_vim-addons'
'vimdiff' '_vim'
'vmstat' '_vmstat'
'vncserver' '_vnc'
'vncviewer' '_vnc'
'vorbiscomment' '_vorbiscomment'
'vserver' '_vserver'
'vux' '_vux'
'vuxctl' '_vux'
'w3m' '_w3m'
'wait' '_wait'
'wajig' '_wajig'
'wanna-build' '_wanna-build'
'watch' '_watch'
'wc' '_wc'
'wget' '_wget'
'what' '_sccs'
'whatis' '_man'
'whence' '_which'
'where' '_which'
'whereis' '_whereis'
'which' '_which'
'whoami' '_nothing'
'whois' '_whois'
'whom' '_mh'
'wiggle' '_wiggle'
'wodim' '_cdrecord'
'wpa_cli' '_wpa_cli'
'write' '_users_on'
'www' '_webbrowser'
'xargs' '_xargs'
'xauth' '_xauth'
'xautolock' '_xautolock'
'xclip' '_xclip'
'xdpyinfo' '_x_utils'
'xdvi' '_xdvi'
'xelatex' '_tex'
'xetex' '_tex'
'xev' '_x_utils'
'xfd' '_x_utils'
'xfig' '_xfig'
'xfontsel' '_x_utils'
'xhost' '_x_utils'
'xkill' '_x_utils'
'xli' '_xloadimage'
'xloadimage' '_xloadimage'
'xlsatoms' '_x_utils'
'xmllint' '_xmlsoft'
'xmms2' '_xmms2'
'xmodmap' '_xmodmap'
'xmosaic' '_webbrowser'
'xon' '_x_utils'
'xournal' '_xournal'
'xpdf' '_xpdf'
'xping' '_hosts'
'xprop' '_x_utils'
'xrandr' '_xrandr'
'xrdb' '_x_utils'
'xscreensaver-command' '_xscreensaver'
'xset' '_xset'
'xsetbg' '_xloadimage'
'xsetroot' '_x_utils'
'xsltproc' '_xmlsoft'
'xterm' '_xterm'
'xtightvncviewer' '_vnc'
'xtp' '_imagemagick'
'xv' '_xv'
'xview' '_xloadimage'
'xvnc4viewer' '_vnc'
'xvncviewer' '_vnc'
'xwd' '_x_utils'
'xwininfo' '_x_utils'
'xwit' '_xwit'
'xwud' '_x_utils'
'xxd' '_xxd'
'xz' '_xz'
'xzcat' '_xz'
'yast' '_yast'
'yast2' '_yast'
'ypbind' '_yp'
'ypcat' '_yp'
'ypmatch' '_yp'
'yppasswd' '_yp'
'yppoll' '_yp'
'yppush' '_yp'
'ypserv' '_yp'
'ypset' '_yp'
'ypwhich' '_yp'
'ypxfr' '_yp'
'ytalk' '_other_accounts'
'yum' '_yum'
'zargs' '_zargs'
'zathura' '_pspdf'
'zcalc' '_zcalc'
'-zcalc-line-' '_zcalc_line'
'zcat' '_zcat'
'zcompile' '_zcompile'
'zcp' '_zmv'
'zdelattr' '_zattr'
'zdump' '_zdump'
'zed' '_zed'
'zegrep,' '_grep'
'zen' '_webbrowser'
'zf_chgrp' '_chown'
'zf_chown' '_chown'
'zfgrep' '_grep'
'zf_ln' '_ln'
'zf_mkdir' '_mkdir'
'zf_rm' '_rm'
'zf_rmdir' '_directories'
'zfs' '_zfs'
'zgetattr' '_zattr'
'zgrep,' '_grep'
'zip' '_zip'
'zipinfo' '_zip'
'zle' '_zle'
'zlistattr' '_zattr'
'zln' '_zmv'
'zlogin' '_zlogin'
'zmail' '_mail'
'zmodload' '_zmodload'
'zmv' '_zmv'
'zone' '_hosts'
'zoneadm' '_zoneadm'
'zpool' '_zpool'
'zpty' '_zpty'
'zsetattr' '_zattr'
'zsh' '_sh'
'zsh-mime-handler' '_zsh-mime-handler'
'zstat' '_stat'
'zstyle' '_zstyle'
'ztodo' '_ztodo'
'zxpdf' '_xpdf'
'zypper' '_zypper'
)
_services=(
'bzcat' 'bunzip2'
'dch' 'debchange'
'gnupod_addsong.pl' 'gnupod_addsong'
'gnupod_check.pl' 'gnupod_check'
'gnupod_INIT.pl' 'gnupod_INIT'
'gnupod_search.pl' 'gnupod_search'
'gpg2' 'gpg'
'gzcat' 'gunzip'
'iceweasel' 'firefox'
'lzcat' 'unxz'
'lzma' 'xz'
'Mail' 'mail'
'mailx' 'mail'
'mktunes.pl' 'mktunes'
'nail' 'mail'
'ncl' 'nc'
'nedit-nc' 'nc'
'pcat' 'unpack'
'-redirect-,<,bunzip2' 'bunzip2'
'-redirect-,<,bzip2' 'bzip2'
'-redirect-,>,bzip2' 'bunzip2'
'-redirect-,<,compress' 'compress'
'-redirect-,>,compress' 'uncompress'
'-redirect-,<,gunzip' 'gunzip'
'-redirect-,<,gzip' 'gzip'
'-redirect-,>,gzip' 'gunzip'
'-redirect-,<,uncompress' 'uncompress'
'-redirect-,<,unxz' 'unxz'
'-redirect-,<,xz' 'xz'
'-redirect-,>,xz' 'unxz'
'remsh' 'rsh'
'slogin' 'ssh'
'svnadmin-static' 'svnadmin'
'tunes2pod.pl' 'tunes2pod'
'unlzma' 'unxz'
'xelatex' 'latex'
'xetex' 'tex'
'xzcat' 'unxz'
'zf_chgrp' 'chgrp'
'zf_chown' 'chown'
)
_patcomps=(
'*/(init|rc[0-9S]#).d/*' '_init_d'
'zf*' '_zftp'
)
_postpatcomps=(
'(|cifs)iostat' '_sysstat'
'isag' '_sysstat'
'mpstat' '_sysstat'
'(p[bgpn]m*|*top[bgpn]m)' '_pbm'
'pidstat' '_sysstat'
'pydoc[0-9.]#' '_pydoc'
'python[0-9.]#' '_python'
'qemu(|-system-*)' '_qemu'
'(ruby|[ei]rb)[0-9.]#' '_ruby'
'sadf' '_sysstat'
'sar' '_sysstat'
'(texi(2*|ndex))' '_texi'
'(tiff*|*2tiff|pal2rgb)' '_tiff'
'-value-,(ftp|http(|s))_proxy,-default-' '_urls'
'-value-,LC_*,-default-' '_locales'
'-value-,*path,-default-' '_directories'
'-value-,*PATH,-default-' '_dir_list'
'-value-,RUBY(LIB|OPT|PATH),-default-' '_ruby'
'*/X11(|R<4->)/*' '_x_arguments'
'yodl(|2*)' '_yodl'
)
_compautos=(
'_call_program' '+X'
)
zle -C _bash_complete-word .complete-word _bash_completions
zle -C _bash_list-choices .list-choices _bash_completions
zle -C _complete_debug .complete-word _complete_debug
zle -C _complete_help .complete-word _complete_help
zle -C _complete_tag .complete-word _complete_tag
zle -C _correct_filename .complete-word _correct_filename
zle -C _correct_word .complete-word _correct_word
zle -C _expand_alias .complete-word _expand_alias
zle -C _expand_word .complete-word _expand_word
zle -C _history-complete-newer .complete-word _history_complete_word
zle -C _history-complete-older .complete-word _history_complete_word
zle -C _list_expansions .list-choices _expand_word
zle -C _most_recent_file .complete-word _most_recent_file
zle -C _next_tags .list-choices _next_tags
zle -C _read_comp .complete-word _read_comp
bindkey '^X^R' _read_comp
bindkey '^X?' _complete_debug
bindkey '^XC' _correct_filename
bindkey '^Xa' _expand_alias
bindkey '^Xc' _correct_word
bindkey '^Xd' _list_expansions
bindkey '^Xe' _expand_word
bindkey '^Xh' _complete_help
bindkey '^Xm' _most_recent_file
bindkey '^Xn' _next_tags
bindkey '^Xt' _complete_tag
bindkey '^X~' _bash_list-choices
bindkey '^[,' _history-complete-newer
bindkey '^[/' _history-complete-older
bindkey '^[~' _bash_complete-word
autoload -Uz _a2ps _a2utils _aap _acpi _acpitool \
_acroread _adb _add-zsh-hook _alias _aliases \
_all_labels _all_matches _alternative _analyseplugin _ant \
_antiword _apachectl _apm _approximate _apt \
_apt-file _aptitude _apt-move _apt-show-versions _arch_archives \
_arch_namespace _arg_compile _arguments _arp _arping \
_arrays _assign _at _attr _augeas \
_auto-apt _autocd _awk _axi-cache _bash_completions \
_baz _beadm _beep _be_name _bind_addresses \
_bindkey _bison _bittorrent _bogofilter _bootctl \
_bpython _brace_parameter _brctl _bsdconfig _bsdinstall \
_bsd_pkg _btrfs _bts _bug _builtin \
_busctl _bzip2 _bzr _cabal _cache_invalid \
_cal _calendar _call_function _canonical_paths _cat \
_ccal _cd _cdbs-edit-patch _cdcd _cdr \
_cdrdao _cdrecord _chflags _chkconfig _chmod \
_chown _chrt _chsh _clay _cmdstring \
_cmp _combination _comm _command _command_names \
_compadd _compdef _complete _complete_debug _complete_help \
_complete_help_generic _complete_tag _comp_locale _compress _condition \
_configure _coreadm _correct _correct_filename _correct_word \
_cowsay _cp _cpio _cplay _cryptsetup \
_cssh _csup _ctags_tags _curl _cut \
_cvs _cvsup _cygcheck _cygpath _cygrunsrv \
_cygserver _cygstart _dak _darcs _date \
_date_formats _dates _dbus _dchroot _dchroot-dsa \
_dcop _dcut _dd _deb_architectures _debchange \
_debcheckout _debdiff _debfoster _deb_packages _debsign \
_default _defaults _delimiters _describe _description \
_devtodo _df _dhclient _dhcpinfo _dict \
_dict_words _diff _diff_options _diffstat _directories \
_directory_stack _dir_list _dirs _disable _dispatch \
_django _dladm _dlocate _dmidecode _dnf \
_docker _docker-compose _domains _dpatch-edit-patch _dpkg \
_dpkg-buildpackage _dpkg-cross _dpkg-repack _dpkg_source _dput \
_dsh _dtrace _du _dumpadm _dumper \
_dupload _dvi _dynamic_directory_name _ecasound _echotc \
_echoti _elfdump _elinks _elm _email_addresses \
_emulate _enable _enscript _env _equal \
_espeak _etags _ethtool _expand _expand_alias \
_expand_word _extensions _external_pwds _fakeroot _fc \
_feh _fetch _fetchmail _ffmpeg _figlet \
_file_descriptors _files _file_systems _find _find_net_interfaces \
_finger _fink _first _flasher _flex \
_floppy _flowadm _fmadm _fortune _freebsd-update \
_fsh _fstat _functions _fuse_arguments _fuser \
_fusermount _fuse_values _gcc _gcore _gdb \
_generic _genisoimage _getclip _getconf _getent \
_getfacl _getmail _git _git-buildpackage _global \
_global_tags _globflags _globqual_delims _globquals _gnome-gv \
_gnu_generic _gnupod _gnutls _go _gpg \
_gphoto2 _gprof _gqview _gradle _graphicsmagick \
_grep _grep-excuses _groff _groups _growisofs \
_gs _guard _guilt _gv _gzip \
_hash _have_glob_qual _hdiutil _hg _history \
_history_complete_word _history_modifiers _hostnamectl _hosts _hwinfo \
_iconv _id _ifconfig _iftop _ignored \
_imagemagick _inetadm _initctl _init_d _in_vared \
_invoke-rc.d _ionice _ip _ipadm _ipset \
_iptables _irssi _ispell _iwconfig _jails \
_java _java_class _jexec _jls _jobs \
_jobs_bg _jobs_builtin _jobs_fg _joe _join \
_journalctl _kfmclient _kill _killall _kld \
_knock _kvno _last _ldd _ld_debug \
_less _lha _lighttpd _limit _limits \
_links _lintian _list _list_files _ln \
_loadkeys _localectl _locales _locate _logical_volumes \
_loginctl _look _losetup _lp _ls \
_lscfg _lsdev _lslv _lsof _lspv \
_lsusb _lsvg _lynx _lzop _mac_applications \
_mac_files_for_application _madison _mail _mailboxes _main_complete \
_make _make-kpkg _man _match _math \
_math_params _matlab _md5sum _mdadm _members \
_mencal _menu _mere _mergechanges _message \
_metaflac _mh _mii-tool _mime_types _mixerctl \
_mkdir _mkshortcut _mkzsh _module _module-assistant \
_module_math_func _modutils _mondo _monotone _moosic \
_mosh _most_recent_file _mount _mozilla _mpc \
_mplayer _mt _mtools _mtr _multi_parts \
_mutt _my_accounts _mysqldiff _mysql_utils _nautilus \
_ncftp _nedit _netcat _net_interfaces _netscape \
_netstat _newsgroups _next_label _next_tags _nice \
_nkf _nl _nm _nmap _nmcli \
_normal _nothing _notmuch _npm _nslookup \
_object_classes _od _okular _oldlist _omz_diag_dump_check_core_commands \
_omz_diag_dump_echo_file_w_header _omz_diag_dump_one_big_text _omz_diag_dump_os_specific_version _open _options \
_options_set _options_unset _osc _other_accounts _pack \
_parameter _parameters _patch _patchutils _path_commands \
_path_files _pax _pbm _pbuilder _pdf \
_pdftk _perforce _perl _perl_basepods _perldoc \
_perl_modules _pfctl _pfexec _pgrep _php \
_physical_volumes _pick_variant _pids _pine _ping \
_piuparts _pkg5 _pkgadd _pkg-config _pkginfo \
_pkg_instance _pkgrm _pkgtool _pon _portaudit \
_portlint _portmaster _ports _portsnap _postfix \
_postscript _powerd _prcs _precommand _prefix \
_print _printenv _printers _procstat _prompt \
_prove _prstat _ps _ps1234 _pscp \
_pspdf _psutils _ptree _pulseaudio _pump \
_putclip _pydoc _python _python_modules _qdbus \
_qemu _qiv _qtplay _quilt _raggle \
_rake _ranlib _rar _rcs _rdesktop \
_read _read_comp _readelf _readshortcut _rebootin \
_redirect _regex_arguments _regex_words _remote_files _renice \
_reprepro _requested _retrieve_cache _retrieve_mac_apps _ri \
_rlogin _rm _rpm _rpmbuild _rrdtool \
_rsync _rubber _ruby _run-help _runit \
_sablotron _samba _savecore _sccs _sched \
_schedtool _schroot _screen _sd_hosts_or_user_at_host _sd_outputmodes \
_sd_unit_files _sed _sep_parts _sequence _service \
_services _set _set_command _setfacl _setopt \
_setup _sh _showmount _signals _sisu \
_slrn _smit _snoop _socket _sockstat \
_softwareupdate _sort _source _spamassassin _sqlite \
_sqsh _ss _ssh _sshfs _stat \
_stgit _store_cache _strace _strftime _strip \
_stty _su _sub_commands _subscript _subversion \
_sudo _suffix_alias_files _surfraw _SUSEconfig _svcadm \
_svccfg _svcprop _svcs _svcs_fmri _svn-buildpackage \
_sysctl _sysstat _systat _systemctl _systemd \
_systemd-analyze _systemd-delta _systemd-inhibit _systemd-run _systemd-tmpfiles \
_system_profiler _tags _tar _tar_archive _tardy \
_tcpdump _tcpsys _tcptraceroute _telnet _terminals \
_tex _texi _texinfo _tidy _tiff \
_tilde _tilde_files _timedatectl _time_zone _tin \
_tla _tmux _todo.sh _toilet _toolchain-source \
_topgit _totd _tpb _tpconfig _tracepath \
_trap _tree _ttyctl _ttys _tune2fs \
_twidge _twisted _typeset _udevadm _ulimit \
_uml _unace _uname _unexpand _unhash \
_uniq _unison _units _update-alternatives _update-rc.d \
_urls _urpmi _urxvt _uscan _user_admin \
_user_at_host _user_expand _user_math_func _users _users_on \
_uzbl _valgrind _value _values _vared \
_vars _vcsh _vim _vim-addons _vmstat \
_vnc _volume_groups _vorbis _vorbiscomment _vserver \
_vux _w3m _wait _wajig _wakeup_capable_devices \
_wanna-build _wanted _watch _watch-snoop _wc \
_webbrowser _wget _whereis _which _whois \
_wiggle _wpa_cli _xargs _x_arguments _xauth \
_xautolock _x_borderwidth _xclip _x_color _x_colormapid \
_x_cursor _x_display _xdvi _x_extension _xfig \
_x_font _xft_fonts _x_geometry _x_keysym _xloadimage \
_x_locale _xmlsoft _xmms2 _x_modifier _xmodmap \
_x_name _xournal _xpdf _xrandr _x_resource \
_xscreensaver _x_selection_timeout _xset _xt_arguments _xterm \
_x_title _xt_session_id _x_utils _xv _x_visual \
_x_window _xwit _xxd _xz _yast \
_yodl _yp _yum _zargs _zattr \
_zcalc _zcalc_line _zcat _zcompile _zdump \
_zed _zfs _zfs_dataset _zfs_keysource_props _zfs_pool \
_zftp _zip _zle _zlogin _zmodload \
_zmv _zoneadm _zones _zpool _zpty \
_zsh-mime-handler _zstyle _ztodo _zypper
autoload -Uz +X _call_program
typeset -gUa _comp_assocs
_comp_assocs=( '' )
# Load all of the plugins that were defined in ~/.zshrc
for plugin ($plugins); do
if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then
source $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh
elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
source $ZSH/plugins/$plugin/$plugin.plugin.zsh
fi
done
# Find python file
alias pyfind='find . -name "*.py"'
# Remove python compiled byte-code in either current directory or in a
# list of specified directories
function pyclean() {
ZSH_PYCLEAN_PLACES=${*:-'.'}
find ${ZSH_PYCLEAN_PLACES} -type f -name "*.py[co]" -delete
find ${ZSH_PYCLEAN_PLACES} -type d -name "__pycache__" -delete
}
# Grep among .py files
alias pygrep='grep --include="*.py"'
# Load all of your custom configurations from custom/
for config_file ($ZSH_CUSTOM/*.zsh(N)); do
source $config_file
done
# You can put files here to add functionality separated per file, which
# will be ignored by git.
# Files on the custom/ directory will be automatically loaded by the init
# script, in alphabetical order.
# For example: add yourself some shortcuts to projects you often work on.
#
# brainstormr=~/Projects/development/planetargon/brainstormr
# cd $brainstormr
#
unset config_file
# Load the theme
if [[ "$ZSH_THEME" == "random" ]]; then
if [[ "${(t)ZSH_THEME_RANDOM_CANDIDATES}" = "array" ]] && [[ "${#ZSH_THEME_RANDOM_CANDIDATES[@]}" -gt 0 ]]; then
themes=($ZSH/themes/${^ZSH_THEME_RANDOM_CANDIDATES}.zsh-theme)
else
themes=($ZSH/themes/*zsh-theme)
fi
N=${#themes[@]}
((N=(RANDOM%N)+1))
RANDOM_THEME=${themes[$N]}
source "$RANDOM_THEME"
echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
else
if [ ! "$ZSH_THEME" = "" ]; then
if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ]; then
source "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme"
elif [ -f "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme" ]; then
source "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme"
else
source "$ZSH/themes/$ZSH_THEME.zsh-theme"
fi
fi
fi
# vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8
################################################################
# powerlevel9k Theme
# https://github.com/bhilburn/powerlevel9k
#
# This theme was inspired by agnoster's Theme:
# https://gist.github.com/3712874
################################################################
################################################################
# For basic documentation, please refer to the README.md in the top-level
# directory. For more detailed documentation, refer to the project wiki, hosted
# on Github: https://github.com/bhilburn/powerlevel9k/wiki
#
# There are a lot of easy ways you can customize your prompt segments and
# theming with simple variables defined in your `~/.zshrc`.
################################################################
## Turn on for Debugging
#PS4='%s%f%b%k%F{blue}%{λ%}%L %F{240}%N:%i%(?.. %F{red}%?) %1(_.%F{yellow}%-1_ .)%s%f%b%k '
#zstyle ':vcs_info:*+*:*' debug true
#set -o xtrace
# Try to set the installation path
if [[ -n "$POWERLEVEL9K_INSTALLATION_DIR" ]]; then
p9k_directory=${POWERLEVEL9K_INSTALLATION_DIR:A}
else
if [[ "${(%):-%N}" == '(eval)' ]]; then
if [[ "$0" == '-antigen-load' ]] && [[ -r "${PWD}/powerlevel9k.zsh-theme" ]]; then
# Antigen uses eval to load things so it can change the plugin (!!)
# https://github.com/zsh-users/antigen/issues/581
p9k_directory=$PWD
else
print -P "%F{red}You must set POWERLEVEL9K_INSTALLATION_DIR work from within an (eval).%f"
return 1
fi
else
# Get the path to file this code is executing in; then
# get the absolute path and strip the filename.
# See https://stackoverflow.com/a/28336473/108857
p9k_directory=${${(%):-%x}:A:h}
fi
fi
################################################################
# Source icon functions
################################################################
source "${p9k_directory}/functions/icons.zsh"
# vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8
################################################################
# icons
# This file holds the icon definitions and
# icon-functions for the powerlevel9k-ZSH-theme
# https://github.com/bhilburn/powerlevel9k
################################################################
# These characters require the Powerline fonts to work properly. If you see
# boxes or bizarre characters below, your fonts are not correctly installed. If
# you do not want to install a special font, you can set `POWERLEVEL9K_MODE` to
# `compatible`. This shows all icons in regular symbols.
# Initialize the icon list according to the user's `POWERLEVEL9K_MODE`.
typeset -gAH icons
case $POWERLEVEL9K_MODE in
'flat'|'awesome-patched')
# Awesome-Patched Font required! See:
# https://github.com/gabrielelana/awesome-terminal-fonts/tree/patching-strategy/patched
# Set the right locale to protect special characters
local LC_ALL="" LC_CTYPE="en_US.UTF-8"
icons=(
LEFT_SEGMENT_SEPARATOR $'\uE0B0' # 
RIGHT_SEGMENT_SEPARATOR $'\uE0B2' # 
LEFT_SEGMENT_END_SEPARATOR ' ' # Whitespace
LEFT_SUBSEGMENT_SEPARATOR $'\uE0B1' # 
RIGHT_SUBSEGMENT_SEPARATOR $'\uE0B3' # 
CARRIAGE_RETURN_ICON $'\u21B5' # ↵
ROOT_ICON $'\uE801' # 
RUBY_ICON $'\uE847 ' # 
AWS_ICON $'\uE895' # 
AWS_EB_ICON $'\U1F331 ' # 🌱
BACKGROUND_JOBS_ICON $'\uE82F ' # 
TEST_ICON $'\uE891' # 
TODO_ICON $'\u2611' # ☑
BATTERY_ICON $'\uE894' # 
DISK_ICON $'\uE1AE ' # 
OK_ICON $'\u2714' # ✔
FAIL_ICON $'\u2718' # ✘
SYMFONY_ICON 'SF'
NODE_ICON $'\u2B22' # ⬢
MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # ╭─
MULTILINE_NEWLINE_PROMPT_PREFIX $'\u251C'$'\U2500' # ├─
MULTILINE_LAST_PROMPT_PREFIX $'\u2570'$'\U2500 ' # ╰─
APPLE_ICON $'\uE26E' # 
WINDOWS_ICON $'\uE26F' # 
FREEBSD_ICON $'\U1F608 ' # 😈
ANDROID_ICON $'\uE270' # 
LINUX_ICON $'\uE271' # 
SUNOS_ICON $'\U1F31E ' # 🌞
HOME_ICON $'\uE12C' # 
HOME_SUB_ICON $'\uE18D' # 
FOLDER_ICON $'\uE818' # 
NETWORK_ICON $'\uE1AD' # 
LOAD_ICON $'\uE190 ' # 
SWAP_ICON $'\uE87D' # 
RAM_ICON $'\uE1E2 ' # 
SERVER_ICON $'\uE895' # 
VCS_UNTRACKED_ICON $'\uE16C' # 
VCS_UNSTAGED_ICON $'\uE17C' # 
VCS_STAGED_ICON $'\uE168' # 
VCS_STASH_ICON $'\uE133 ' # 
#VCS_INCOMING_CHANGES_ICON $'\uE1EB ' # 
#VCS_INCOMING_CHANGES_ICON $'\uE80D ' # 
VCS_INCOMING_CHANGES_ICON $'\uE131 ' # 
#VCS_OUTGOING_CHANGES_ICON $'\uE1EC ' # 
#VCS_OUTGOING_CHANGES_ICON $'\uE80E ' # 
VCS_OUTGOING_CHANGES_ICON $'\uE132 ' # 
VCS_TAG_ICON $'\uE817 ' # 
VCS_BOOKMARK_ICON $'\uE87B' # 
VCS_COMMIT_ICON $'\uE821 ' # 
VCS_BRANCH_ICON $'\uE220 ' # 
VCS_REMOTE_BRANCH_ICON $'\u2192' # →
VCS_GIT_ICON $'\uE20E ' # 
VCS_GIT_GITHUB_ICON $'\uE20E ' #
VCS_GIT_BITBUCKET_ICON $'\uE20E ' #
VCS_GIT_GITLAB_ICON $'\uE20E ' #
VCS_HG_ICON $'\uE1C3 ' # 
VCS_SVN_ICON '(svn) '
RUST_ICON ''
PYTHON_ICON $'\ue63c' # 
SWIFT_ICON ''
GO_ICON ''
PUBLIC_IP_ICON ''
LOCK_ICON $'\UE138' # 
EXECUTION_TIME_ICON $'\UE89C' # 
SSH_ICON '(ssh)'
VPN_ICON '(vpn)'
KUBERNETES_ICON $'\U2388' # ⎈
)
;;
'awesome-fontconfig')
# fontconfig with awesome-font required! See
# https://github.com/gabrielelana/awesome-terminal-fonts
# Set the right locale to protect special characters
local LC_ALL="" LC_CTYPE="en_US.UTF-8"
icons=(
LEFT_SEGMENT_SEPARATOR $'\uE0B0' # 
RIGHT_SEGMENT_SEPARATOR $'\uE0B2' # 
LEFT_SEGMENT_END_SEPARATOR ' ' # Whitespace
LEFT_SUBSEGMENT_SEPARATOR $'\uE0B1' # 
RIGHT_SUBSEGMENT_SEPARATOR $'\uE0B3' # 
CARRIAGE_RETURN_ICON $'\u21B5' # ↵
ROOT_ICON $'\uF201' # 
RUBY_ICON $'\uF219 ' # 
AWS_ICON $'\uF270' # 
AWS_EB_ICON $'\U1F331 ' # 🌱
BACKGROUND_JOBS_ICON $'\uF013 ' # 
TEST_ICON $'\uF291' # 
TODO_ICON $'\u2611' # ☑
BATTERY_ICON $'\U1F50B' # 🔋
DISK_ICON $'\uF0A0 ' # 
OK_ICON $'\u2714' # ✔
FAIL_ICON $'\u2718' # ✘
SYMFONY_ICON 'SF'
NODE_ICON $'\u2B22' # ⬢
MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # ╭─
MULTILINE_NEWLINE_PROMPT_PREFIX $'\u251C'$'\U2500' # ├─
MULTILINE_LAST_PROMPT_PREFIX $'\u2570'$'\U2500 ' # ╰─
APPLE_ICON $'\uF179' # 
WINDOWS_ICON $'\uF17A' # 
FREEBSD_ICON $'\U1F608 ' # 😈
ANDROID_ICON $'\uE17B' # 
LINUX_ICON $'\uF17C' # 
SUNOS_ICON $'\uF185 ' # 
HOME_ICON $'\uF015' # 
HOME_SUB_ICON $'\uF07C' # 
FOLDER_ICON $'\uF115' # 
NETWORK_ICON $'\uF09E' # 
LOAD_ICON $'\uF080 ' # 
SWAP_ICON $'\uF0E4' # 
RAM_ICON $'\uF0E4' # 
SERVER_ICON $'\uF233' # 
VCS_UNTRACKED_ICON $'\uF059' # 
VCS_UNSTAGED_ICON $'\uF06A' # 
VCS_STAGED_ICON $'\uF055' # 
VCS_STASH_ICON $'\uF01C ' # 
VCS_INCOMING_CHANGES_ICON $'\uF01A ' # 
VCS_OUTGOING_CHANGES_ICON $'\uF01B ' # 
VCS_TAG_ICON $'\uF217 ' # 
VCS_BOOKMARK_ICON $'\uF27B' # 
VCS_COMMIT_ICON $'\uF221 ' # 
VCS_BRANCH_ICON $'\uF126 ' # 
VCS_REMOTE_BRANCH_ICON $'\u2192' # →
VCS_GIT_ICON $'\uF1D3 ' # 
VCS_GIT_GITHUB_ICON $'\uF113 ' # 
VCS_GIT_BITBUCKET_ICON $'\uF171 ' # 
VCS_GIT_GITLAB_ICON $'\uF296 ' # 
VCS_HG_ICON $'\uF0C3 ' # 
VCS_SVN_ICON '(svn) '
RUST_ICON $'\uE6A8' # 
PYTHON_ICON $'\ue63c' # 
SWIFT_ICON ''
GO_ICON ''
PUBLIC_IP_ICON ''
LOCK_ICON $'\UF023' # 
EXECUTION_TIME_ICON $'\uF253'
SSH_ICON '(ssh)'
VPN_ICON $'\uF023'
KUBERNETES_ICON $'\U2388' # ⎈
)
;;
'nerdfont-complete'|'nerdfont-fontconfig')
# nerd-font patched (complete) font required! See
# https://github.com/ryanoasis/nerd-fonts
# Set the right locale to protect special characters
local LC_ALL="" LC_CTYPE="en_US.UTF-8"
icons=(
LEFT_SEGMENT_SEPARATOR $'\uE0B0' # 
RIGHT_SEGMENT_SEPARATOR $'\uE0B2' # 
LEFT_SEGMENT_END_SEPARATOR ' ' # Whitespace
LEFT_SUBSEGMENT_SEPARATOR $'\uE0B1' # 
RIGHT_SUBSEGMENT_SEPARATOR $'\uE0B3' # 
CARRIAGE_RETURN_ICON $'\u21B5' # ↵
ROOT_ICON $'\uE614 ' # 
RUBY_ICON $'\uF219 ' # 
AWS_ICON $'\uF270' # 
AWS_EB_ICON $'\UF1BD ' # 
BACKGROUND_JOBS_ICON $'\uF013 ' # 
TEST_ICON $'\uF188' # 
TODO_ICON $'\uF133' # 
BATTERY_ICON $'\UF240 ' # 
DISK_ICON $'\uF0A0' # 
OK_ICON $'\uF00C' # 
FAIL_ICON $'\uF00D' # 
SYMFONY_ICON $'\uE757' # 
NODE_ICON $'\uE617 ' # 
MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # ╭─
MULTILINE_NEWLINE_PROMPT_PREFIX $'\u251C'$'\U2500' # ├─
MULTILINE_LAST_PROMPT_PREFIX $'\u2570'$'\U2500 ' # ╰─
APPLE_ICON $'\uF179' # 
WINDOWS_ICON $'\uF17A' # 
FREEBSD_ICON $'\UF30E ' # 
ANDROID_ICON $'\uF17B' # 
LINUX_ICON $'\uF17C' # 
SUNOS_ICON $'\uF185 ' # 
HOME_ICON $'\uF015' # 
HOME_SUB_ICON $'\uF07C' # 
FOLDER_ICON $'\uF115' # 
NETWORK_ICON $'\uF1EB' # 
LOAD_ICON $'\uF080 ' # 
SWAP_ICON $'\uF464' # 
RAM_ICON $'\uF0E4' # 
SERVER_ICON $'\uF0AE' # 
VCS_UNTRACKED_ICON $'\uF059' # 
VCS_UNSTAGED_ICON $'\uF06A' # 
VCS_STAGED_ICON $'\uF055' # 
VCS_STASH_ICON $'\uF01C ' # 
VCS_INCOMING_CHANGES_ICON $'\uF01A ' # 
VCS_OUTGOING_CHANGES_ICON $'\uF01B ' # 
VCS_TAG_ICON $'\uF02B ' # 
VCS_BOOKMARK_ICON $'\uF461 ' # 
VCS_COMMIT_ICON $'\uE729 ' # 
VCS_BRANCH_ICON $'\uF126 ' # 
VCS_REMOTE_BRANCH_ICON $'\uE728 ' # 
VCS_GIT_ICON $'\uF113 ' # 
VCS_GIT_GITHUB_ICON $'\uE709 ' # 
VCS_GIT_BITBUCKET_ICON $'\uE703 ' # 
VCS_GIT_GITLAB_ICON $'\uF296 ' # 
VCS_HG_ICON $'\uF0C3 ' # 
VCS_SVN_ICON $'\uE72D ' # 
RUST_ICON $'\uE7A8 ' # 
PYTHON_ICON $'\UE73C ' # 
SWIFT_ICON $'\uE755' # 
GO_ICON $'\uE626' # 
PUBLIC_IP_ICON $'\UF0AC' # 
LOCK_ICON $'\UF023' # 
EXECUTION_TIME_ICON $'\uF252' # 
SSH_ICON $'\uF489' # 
VPN_ICON '(vpn)'
KUBERNETES_ICON $'\U2388' # ⎈
)
;;
*)
# Powerline-Patched Font required!
# See https://github.com/Lokaltog/powerline-fonts
# Set the right locale to protect special characters
local LC_ALL="" LC_CTYPE="en_US.UTF-8"
icons=(
LEFT_SEGMENT_SEPARATOR $'\uE0B0' # 
RIGHT_SEGMENT_SEPARATOR $'\uE0B2' # 
LEFT_SEGMENT_END_SEPARATOR ' ' # Whitespace
LEFT_SUBSEGMENT_SEPARATOR $'\uE0B1' # 
RIGHT_SUBSEGMENT_SEPARATOR $'\uE0B3' # 
CARRIAGE_RETURN_ICON $'\u21B5' # ↵
ROOT_ICON $'\u26A1' # ⚡
RUBY_ICON ''
AWS_ICON 'AWS:'
AWS_EB_ICON $'\U1F331 ' # 🌱
BACKGROUND_JOBS_ICON $'\u2699' # ⚙
TEST_ICON ''
TODO_ICON $'\u2611' # ☑
BATTERY_ICON $'\U1F50B' # 🔋
DISK_ICON $'hdd '
OK_ICON $'\u2714' # ✔
FAIL_ICON $'\u2718' # ✘
SYMFONY_ICON 'SF'
NODE_ICON $'\u2B22' # ⬢
MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\U2500' # ╭─
MULTILINE_NEWLINE_PROMPT_PREFIX $'\u251C'$'\U2500' # ├─
MULTILINE_LAST_PROMPT_PREFIX $'\u2570'$'\U2500 ' # ╰─
APPLE_ICON 'OSX'
WINDOWS_ICON 'WIN'
FREEBSD_ICON 'BSD'
ANDROID_ICON 'And'
LINUX_ICON 'Lx'
SUNOS_ICON 'Sun'
HOME_ICON ''
HOME_SUB_ICON ''
FOLDER_ICON ''
NETWORK_ICON 'IP'
LOAD_ICON 'L'
SWAP_ICON 'SWP'
RAM_ICON 'RAM'
SERVER_ICON ''
VCS_UNTRACKED_ICON '?'
VCS_UNSTAGED_ICON $'\u25CF' # ●
VCS_STAGED_ICON $'\u271A' # ✚
VCS_STASH_ICON $'\u235F' # ⍟
VCS_INCOMING_CHANGES_ICON $'\u2193' # ↓
VCS_OUTGOING_CHANGES_ICON $'\u2191' # ↑
VCS_TAG_ICON ''
VCS_BOOKMARK_ICON $'\u263F' # ☿
VCS_COMMIT_ICON ''
VCS_BRANCH_ICON $'\uE0A0 ' # 
VCS_REMOTE_BRANCH_ICON $'\u2192' # →
VCS_GIT_ICON ''
VCS_GIT_GITHUB_ICON ''
VCS_GIT_BITBUCKET_ICON ''
VCS_GIT_GITLAB_ICON ''
VCS_HG_ICON ''
VCS_SVN_ICON ''
RUST_ICON ''
PYTHON_ICON ''
SWIFT_ICON 'Swift'
GO_ICON 'Go'
PUBLIC_IP_ICON ''
LOCK_ICON $'\UE0A2'
EXECUTION_TIME_ICON 'Dur'
SSH_ICON '(ssh)'
VPN_ICON '(vpn)'
KUBERNETES_ICON $'\U2388' # ⎈
)
;;
esac
# Override the above icon settings with any user-defined variables.
case $POWERLEVEL9K_MODE in
'flat')
# Set the right locale to protect special characters
local LC_ALL="" LC_CTYPE="en_US.UTF-8"
icons[LEFT_SEGMENT_SEPARATOR]=''
icons[RIGHT_SEGMENT_SEPARATOR]=''
icons[LEFT_SUBSEGMENT_SEPARATOR]='|'
icons[RIGHT_SUBSEGMENT_SEPARATOR]='|'
;;
'compatible')
# Set the right locale to protect special characters
local LC_ALL="" LC_CTYPE="en_US.UTF-8"
icons[LEFT_SEGMENT_SEPARATOR]=$'\u2B80' # ⮀
icons[RIGHT_SEGMENT_SEPARATOR]=$'\u2B82' # ⮂
icons[VCS_BRANCH_ICON]='@'
;;
esac
if [[ "$POWERLEVEL9K_HIDE_BRANCH_ICON" == true ]]; then
icons[VCS_BRANCH_ICON]=''
fi
# Safety function for printing icons
# Prints the named icon, or if that icon is undefined, the string name.
function print_icon() {
local icon_name=$1
local ICON_USER_VARIABLE=POWERLEVEL9K_${icon_name}
if defined "$ICON_USER_VARIABLE"; then
echo -n "${(P)ICON_USER_VARIABLE}"
else
echo -n "${icons[$icon_name]}"
fi
}
# Get a list of configured icons
# * $1 string - If "original", then the original icons are printed,
# otherwise "print_icon" is used, which takes the users
# overrides into account.
get_icon_names() {
# Iterate over a ordered list of keys of the icons array
for key in ${(@kon)icons}; do
echo -n "POWERLEVEL9K_$key: "
if [[ "${1}" == "original" ]]; then
# print the original icons as they are defined in the array above
echo "${icons[$key]}"
else
# print the icons as they are configured by the user
echo "$(print_icon "$key")"
fi
done
}
################################################################
# Source utility functions
################################################################
source "${p9k_directory}/functions/utilities.zsh"
# vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8
################################################################
# Utility functions
# This file holds some utility-functions for
# the powerlevel9k-ZSH-theme
# https://github.com/bhilburn/powerlevel9k
################################################################
# Exits with 0 if a variable has been previously defined (even if empty)
# Takes the name of a variable that should be checked.
function defined() {
local varname="$1"
typeset -p "$varname" > /dev/null 2>&1
}
# Given the name of a variable and a default value, sets the variable
# value to the default only if it has not been defined.
#
# Typeset cannot set the value for an array, so this will only work
# for scalar values.
function set_default() {
local varname="$1"
local default_value="$2"
defined "$varname" || typeset -g "$varname"="$default_value"
}
# Converts large memory values into a human-readable unit (e.g., bytes --> GB)
# Takes two arguments:
# * $size - The number which should be prettified
# * $base - The base of the number (default Bytes)
printSizeHumanReadable() {
typeset -F 2 size
size="$1"+0.00001
local extension
extension=('B' 'K' 'M' 'G' 'T' 'P' 'E' 'Z' 'Y')
local index=1
# if the base is not Bytes
if [[ -n $2 ]]; then
for idx in "${extension[@]}"; do
if [[ "$2" == "$idx" ]]; then
break
fi
index=$(( index + 1 ))
done
fi
while (( (size / 1024) > 0.1 )); do
size=$(( size / 1024 ))
index=$(( index + 1 ))
done
echo "$size${extension[$index]}"
}
# Gets the first value out of a list of items that is not empty.
# The items are examined by a callback-function.
# Takes two arguments:
# * $list - A list of items
# * $callback - A callback function to examine if the item is
# worthy. The callback function has access to
# the inner variable $item.
function getRelevantItem() {
local -a list
local callback
# Explicitly split the elements by whitespace.
list=(${=1})
callback=$2
for item in $list; do
# The first non-empty item wins
try=$(eval "$callback")
if [[ -n "$try" ]]; then
echo "$try"
break;
fi
done
}
# OS detection
case $(uname) in
Darwin)
OS='OSX'
OS_ICON=$(print_icon 'APPLE_ICON')
;;
CYGWIN_NT-*)
OS='Windows'
OS_ICON=$(print_icon 'WINDOWS_ICON')
;;
FreeBSD)
OS='BSD'
OS_ICON=$(print_icon 'FREEBSD_ICON')
;;
OpenBSD)
OS='BSD'
OS_ICON=$(print_icon 'FREEBSD_ICON')
;;
DragonFly)
OS='BSD'
OS_ICON=$(print_icon 'FREEBSD_ICON')
;;
Linux)
OS='Linux'
OS_ICON=$(print_icon 'LINUX_ICON')
# Check if we're running on Android
case $(uname -o 2>/dev/null) in
Android)
OS='Android'
OS_ICON=$(print_icon 'ANDROID_ICON')
;;
esac
;;
SunOS)
OS='Solaris'
OS_ICON=$(print_icon 'SUNOS_ICON')
;;
*)
OS=''
OS_ICON=''
;;
esac
# Determine the correct sed parameter.
#
# `sed` is unfortunately not consistent across OSes when it comes to flags.
SED_EXTENDED_REGEX_PARAMETER="-r"
if [[ "$OS" == 'OSX' ]]; then
local IS_BSD_SED="$(sed --version &>> /dev/null || echo "BSD sed")"
if [[ -n "$IS_BSD_SED" ]]; then
SED_EXTENDED_REGEX_PARAMETER="-E"
fi
fi
# Determine if the passed segment is used in the prompt
#
# Pass the name of the segment to this function to test for its presence in
# either the LEFT or RIGHT prompt arrays.
# * $1: The segment to be tested.
segment_in_use() {
local key=$1
if [[ -n "${POWERLEVEL9K_LEFT_PROMPT_ELEMENTS[(r)$key]}" ]] || [[ -n "${POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS[(r)$key]}" ]]; then
return 0
else
return 1
fi
}
# Print a deprecation warning if an old segment is in use.
# Takes the name of an associative array that contains the
# deprecated segments as keys, the values contain the new
# segment names.
print_deprecation_warning() {
typeset -AH raw_deprecated_segments
raw_deprecated_segments=(${(kvP@)1})
for key in ${(@k)raw_deprecated_segments}; do
if segment_in_use $key; then
# segment is deprecated
print -P "%F{yellow}Warning!%f The '$key' segment is deprecated. Use '%F{blue}${raw_deprecated_segments[$key]}%f' instead. For more informations, have a look at the CHANGELOG.md."
fi
done
}
# A helper function to determine if a segment should be
# joined or promoted to a full one.
# Takes three arguments:
# * $1: The array index of the current segment
# * $2: The array index of the last printed segment
# * $3: The array of segments of the left or right prompt
function segmentShouldBeJoined() {
local current_index=$1
local last_segment_index=$2
# Explicitly split the elements by whitespace.
local -a elements
elements=(${=3})
local current_segment=${elements[$current_index]}
local joined=false
if [[ ${current_segment[-7,-1]} == '_joined' ]]; then
joined=true
# promote segment to a full one, if the predecessing full segment
# was conditional. So this can only be the case for segments that
# are not our direct predecessor.
if (( $(($current_index - $last_segment_index)) > 1)); then
# Now we have to examine every previous segment, until we reach
# the last printed one (found by its index). This is relevant if
# all previous segments are joined. Then we want to join our
# segment as well.
local examined_index=$((current_index - 1))
while (( $examined_index > $last_segment_index )); do
local previous_segment=${elements[$examined_index]}
# If one of the examined segments is not joined, then we know
# that the current segment should not be joined, as the target
# segment is the wrong one.
if [[ ${previous_segment[-7,-1]} != '_joined' ]]; then
joined=false
break
fi
examined_index=$((examined_index - 1))
done
fi
fi
# Return 1 means error; return 0 means no error. So we have
# to invert $joined
if [[ "$joined" == "true" ]]; then
return 0
else
return 1
fi
}
# Given a directory path, truncate it according to the settings for
# `truncate_from_right`
function truncatePathFromRight() {
local delim_len=${#POWERLEVEL9K_SHORTEN_DELIMITER:-1}
echo $1 | sed $SED_EXTENDED_REGEX_PARAMETER \
"s@(([^/]{$((POWERLEVEL9K_SHORTEN_DIR_LENGTH))})([^/]{$delim_len}))[^/]+/@\2$POWERLEVEL9K_SHORTEN_DELIMITER/@g"
}
# Search recursively in parent folders for given file.
function upsearch () {
if [[ "$PWD" == "$HOME" || "$PWD" == "/" ]]; then
echo "$PWD"
elif test -e "$1"; then
pushd .. > /dev/null
upsearch "$1"
popd > /dev/null
echo "$PWD"
else
pushd .. > /dev/null
upsearch "$1"
popd > /dev/null
fi
}
################################################################
# Source color functions
################################################################
source "${p9k_directory}/functions/colors.zsh"
# vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8
################################################################
# Color functions
# This file holds some color-functions for
# the powerlevel9k-ZSH-theme
# https://github.com/bhilburn/powerlevel9k
################################################################
# Get numerical color codes. That way we translate ANSI codes
# into ZSH-Style color codes.
function getColorCode() {
# Check if given value is already numerical
if [[ "$1" = <-> ]]; then
# ANSI color codes distinguish between "foreground"
# and "background" colors. We don't need to do that,
# as ZSH uses a 256 color space anyway.
if [[ "$1" = <8-15> ]]; then
echo $(($1 - 8))
else
echo "$1"
fi
else
typeset -A codes
codes=(
'black' '000'
'red' '001'
'green' '002'
'yellow' '003'
'blue' '004'
'magenta' '005'
'cyan' '006'
'white' '007'
)
# Strip eventual "bg-" prefixes
1=${1#bg-}
# Strip eventual "fg-" prefixes
1=${1#fg-}
# Strip eventual "br" prefixes ("bright" colors)
1=${1#br}
echo $codes[$1]
fi
}
# Check if two colors are equal, even if one is specified as ANSI code.
function isSameColor() {
if [[ "$1" == "NONE" || "$2" == "NONE" ]]; then
return 1
fi
local color1=$(getColorCode "$1")
local color2=$(getColorCode "$2")
return $(( color1 != color2 ))
}
################################################################
# Source VCS_INFO hooks / helper functions
################################################################
source "${p9k_directory}/functions/vcs.zsh"
# vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8
################################################################
# vcs
# This file holds supplemental VCS functions
# for the powerlevel9k-ZSH-theme
# https://github.com/bhilburn/powerlevel9k
################################################################
set_default POWERLEVEL9K_VCS_SHOW_SUBMODULE_DIRTY true
function +vi-git-untracked() {
# TODO: check git >= 1.7.2 - see function git_compare_version()
local FLAGS
FLAGS=('--porcelain')
if [[ "$POWERLEVEL9K_VCS_SHOW_SUBMODULE_DIRTY" == "false" ]]; then
FLAGS+='--ignore-submodules=dirty'
fi
if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == 'true' && \
-n $(git status ${FLAGS} | grep -E '^\?\?' 2> /dev/null | tail -n1) ]]; then
hook_com[unstaged]+=" $(print_icon 'VCS_UNTRACKED_ICON')"
VCS_WORKDIR_HALF_DIRTY=true
else
VCS_WORKDIR_HALF_DIRTY=false
fi
}
function +vi-git-aheadbehind() {
local ahead behind branch_name
local -a gitstatus
branch_name=$(git symbolic-ref --short HEAD 2>/dev/null)
# for git prior to 1.7
# ahead=$(git rev-list origin/${branch_name}..HEAD | wc -l)
ahead=$(git rev-list "${branch_name}"@{upstream}..HEAD 2>/dev/null | wc -l)
(( ahead )) && gitstatus+=( " $(print_icon 'VCS_OUTGOING_CHANGES_ICON')${ahead// /}" )
# for git prior to 1.7
# behind=$(git rev-list HEAD..origin/${branch_name} | wc -l)
behind=$(git rev-list HEAD.."${branch_name}"@{upstream} 2>/dev/null | wc -l)
(( behind )) && gitstatus+=( " $(print_icon 'VCS_INCOMING_CHANGES_ICON')${behind// /}" )
hook_com[misc]+=${(j::)gitstatus}
}
function +vi-git-remotebranch() {
local remote branch_name
# Are we on a remote-tracking branch?
remote=${$(git rev-parse --verify HEAD@{upstream} --symbolic-full-name 2>/dev/null)/refs\/(remotes|heads)\/}
branch_name=$(git symbolic-ref --short HEAD 2>/dev/null)
hook_com[branch]="$(print_icon 'VCS_BRANCH_ICON')${hook_com[branch]}"
# Always show the remote
#if [[ -n ${remote} ]] ; then
# Only show the remote if it differs from the local
if [[ -n ${remote} ]] && [[ "${remote#*/}" != "${branch_name}" ]] ; then
hook_com[branch]+="$(print_icon 'VCS_REMOTE_BRANCH_ICON')${remote// /}"
fi
}
set_default POWERLEVEL9K_VCS_HIDE_TAGS false
function +vi-git-tagname() {
if [[ "$POWERLEVEL9K_VCS_HIDE_TAGS" == "false" ]]; then
# If we are on a tag, append the tagname to the current branch string.
local tag
tag=$(git describe --tags --exact-match HEAD 2>/dev/null)
if [[ -n "${tag}" ]] ; then
# There is a tag that points to our current commit. Need to determine if we
# are also on a branch, or are in a DETACHED_HEAD state.
if [[ -z $(git symbolic-ref HEAD 2>/dev/null) ]]; then
# DETACHED_HEAD state. We want to append the tag name to the commit hash
# and print it. Unfortunately, `vcs_info` blows away the hash when a tag
# exists, so we have to manually retrieve it and clobber the branch
# string.
local revision
revision=$(git rev-list -n 1 --abbrev-commit --abbrev=${POWERLEVEL9K_VCS_INTERNAL_HASH_LENGTH} HEAD)
hook_com[branch]="$(print_icon 'VCS_BRANCH_ICON')${revision} $(print_icon 'VCS_TAG_ICON')${tag}"
else
# We are on both a tag and a branch; print both by appending the tag name.
hook_com[branch]+=" $(print_icon 'VCS_TAG_ICON')${tag}"
fi
fi
fi
}
# Show count of stashed changes
# Port from https://github.com/whiteinge/dotfiles/blob/5dfd08d30f7f2749cfc60bc55564c6ea239624d9/.zsh_shouse_prompt#L268
function +vi-git-stash() {
local -a stashes
if [[ -s $(git rev-parse --git-dir)/refs/stash ]] ; then
stashes=$(git stash list 2>/dev/null | wc -l)
hook_com[misc]+=" $(print_icon 'VCS_STASH_ICON')${stashes// /}"
fi
}
function +vi-hg-bookmarks() {
if [[ -n "${hgbmarks[@]}" ]]; then
hook_com[hg-bookmark-string]=" $(print_icon 'VCS_BOOKMARK_ICON')${hgbmarks[@]}"
# To signal that we want to use the sting we just generated, set the special
# variable `ret' to something other than the default zero:
ret=1
return 0
fi
}
function +vi-vcs-detect-changes() {
if [[ "${hook_com[vcs]}" == "git" ]]; then
local remote=$(git ls-remote --get-url 2> /dev/null)
if [[ "$remote" =~ "github" ]] then
vcs_visual_identifier='VCS_GIT_GITHUB_ICON'
elif [[ "$remote" =~ "bitbucket" ]] then
vcs_visual_identifier='VCS_GIT_BITBUCKET_ICON'
elif [[ "$remote" =~ "gitlab" ]] then
vcs_visual_identifier='VCS_GIT_GITLAB_ICON'
else
vcs_visual_identifier='VCS_GIT_ICON'
fi
elif [[ "${hook_com[vcs]}" == "hg" ]]; then
vcs_visual_identifier='VCS_HG_ICON'
elif [[ "${hook_com[vcs]}" == "svn" ]]; then
vcs_visual_identifier='VCS_SVN_ICON'
fi
if [[ -n "${hook_com[staged]}" ]] || [[ -n "${hook_com[unstaged]}" ]]; then
VCS_WORKDIR_DIRTY=true
else
VCS_WORKDIR_DIRTY=false
fi
}
function +vi-svn-detect-changes() {
local svn_status="$(svn status)"
if [[ -n "$(echo "$svn_status" | grep \^\?)" ]]; then
hook_com[unstaged]+=" $(print_icon 'VCS_UNTRACKED_ICON')"
VCS_WORKDIR_HALF_DIRTY=true
fi
if [[ -n "$(echo "$svn_status" | grep \^\M)" ]]; then
hook_com[unstaged]+=" $(print_icon 'VCS_UNSTAGED_ICON')"
VCS_WORKDIR_DIRTY=true
fi
if [[ -n "$(echo "$svn_status" | grep \^\A)" ]]; then
hook_com[staged]+=" $(print_icon 'VCS_STAGED_ICON')"
VCS_WORKDIR_DIRTY=true
fi
}
# cleanup temporary variables.
unset p9k_directory
################################################################
# Color Scheme
################################################################
if [[ "$POWERLEVEL9K_COLOR_SCHEME" == "light" ]]; then
DEFAULT_COLOR=white
DEFAULT_COLOR_INVERTED=black
else
DEFAULT_COLOR=black
DEFAULT_COLOR_INVERTED=white
fi
################################################################
# Prompt Segment Constructors
#
# Methodology behind user-defined variables overwriting colors:
# The first parameter to the segment constructors is the calling function's
# name. From this function name, we strip the "prompt_"-prefix and
# uppercase it. This is then prefixed with "POWERLEVEL9K_" and suffixed
# with either "_BACKGROUND" or "_FOREGROUND", thus giving us the variable
# name. So each new segment is user-overwritten by a variable following
# this naming convention.
################################################################
# The `CURRENT_BG` variable is used to remember what the last BG color used was
# when building the left-hand prompt. Because the RPROMPT is created from
# right-left but reads the opposite, this isn't necessary for the other side.
CURRENT_BG='NONE'
# Begin a left prompt segment
# Takes four arguments:
# * $1: Name of the function that was originally invoked (mandatory).
# Necessary, to make the dynamic color-overwrite mechanism work.
# * $2: The array index of the current segment
# * $3: Background color
# * $4: Foreground color
# * $5: The segment content
# * $6: An identifying icon (must be a key of the icons array)
# The latter three can be omitted,
set_default last_left_element_index 1
set_default POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS " "
left_prompt_segment() {
local current_index=$2
# Check if the segment should be joined with the previous one
local joined
segmentShouldBeJoined $current_index $last_left_element_index "$POWERLEVEL9K_LEFT_PROMPT_ELEMENTS" && joined=true || joined=false
# Overwrite given background-color by user defined variable for this segment.
local BACKGROUND_USER_VARIABLE=POWERLEVEL9K_${(U)1#prompt_}_BACKGROUND
local BG_COLOR_MODIFIER=${(P)BACKGROUND_USER_VARIABLE}
[[ -n $BG_COLOR_MODIFIER ]] && 3="$BG_COLOR_MODIFIER"
# Overwrite given foreground-color by user defined variable for this segment.
local FOREGROUND_USER_VARIABLE=POWERLEVEL9K_${(U)1#prompt_}_FOREGROUND
local FG_COLOR_MODIFIER=${(P)FOREGROUND_USER_VARIABLE}
[[ -n $FG_COLOR_MODIFIER ]] && 4="$FG_COLOR_MODIFIER"
local bg fg
[[ -n "$3" ]] && bg="%K{$3}" || bg="%k"
[[ -n "$4" ]] && fg="%F{$4}" || fg="%f"
if [[ $CURRENT_BG != 'NONE' ]] && ! isSameColor "$3" "$CURRENT_BG"; then
echo -n "$bg%F{$CURRENT_BG}"
if [[ $joined == false ]]; then
# Middle segment
echo -n "$(print_icon 'LEFT_SEGMENT_SEPARATOR')$POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS"
fi
elif isSameColor "$CURRENT_BG" "$3"; then
# Middle segment with same color as previous segment
# We take the current foreground color as color for our
# subsegment (or the default color). This should have
# enough contrast.
local complement
[[ -n "$4" ]] && complement="$4" || complement=$DEFAULT_COLOR
echo -n "$bg%F{$complement}"
if [[ $joined == false ]]; then
echo -n "$(print_icon 'LEFT_SUBSEGMENT_SEPARATOR')$POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS"
fi
else
# First segment
echo -n "${bg}$POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS"
fi
local visual_identifier
if [[ -n $6 ]]; then
visual_identifier="$(print_icon $6)"
if [[ -n "$visual_identifier" ]]; then
# Allow users to overwrite the color for the visual identifier only.
local visual_identifier_color_variable=POWERLEVEL9K_${(U)1#prompt_}_VISUAL_IDENTIFIER_COLOR
set_default $visual_identifier_color_variable $4
visual_identifier="%F{${(P)visual_identifier_color_variable}%}$visual_identifier%f"
# Add an whitespace if we print more than just the visual identifier
[[ -n "$5" ]] && visual_identifier="$visual_identifier "
fi
fi
# Print the visual identifier
echo -n "${visual_identifier}"
# Print the content of the segment, if there is any
[[ -n "$5" ]] && echo -n "${fg}${5}"
echo -n "${POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS}"
CURRENT_BG=$3
last_left_element_index=$current_index
}
# End the left prompt, closes the final segment.
left_prompt_end() {
if [[ -n $CURRENT_BG ]]; then
echo -n "%k%F{$CURRENT_BG}$(print_icon 'LEFT_SEGMENT_SEPARATOR')"
else
echo -n "%k"
fi
echo -n "%f$(print_icon 'LEFT_SEGMENT_END_SEPARATOR')"
CURRENT_BG=''
}
CURRENT_RIGHT_BG='NONE'
# Begin a right prompt segment
# Takes four arguments:
# * $1: Name of the function that was originally invoked (mandatory).
# Necessary, to make the dynamic color-overwrite mechanism work.
# * $2: The array index of the current segment
# * $3: Background color
# * $4: Foreground color
# * $5: The segment content
# * $6: An identifying icon (must be a key of the icons array)
# No ending for the right prompt segment is needed (unlike the left prompt, above).
set_default last_right_element_index 1
set_default POWERLEVEL9K_WHITESPACE_BETWEEN_RIGHT_SEGMENTS " "
right_prompt_segment() {
local current_index=$2
# Check if the segment should be joined with the previous one
local joined
segmentShouldBeJoined $current_index $last_right_element_index "$POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS" && joined=true || joined=false
# Overwrite given background-color by user defined variable for this segment.
local BACKGROUND_USER_VARIABLE=POWERLEVEL9K_${(U)1#prompt_}_BACKGROUND
local BG_COLOR_MODIFIER=${(P)BACKGROUND_USER_VARIABLE}
[[ -n $BG_COLOR_MODIFIER ]] && 3="$BG_COLOR_MODIFIER"
# Overwrite given foreground-color by user defined variable for this segment.
local FOREGROUND_USER_VARIABLE=POWERLEVEL9K_${(U)1#prompt_}_FOREGROUND
local FG_COLOR_MODIFIER=${(P)FOREGROUND_USER_VARIABLE}
[[ -n $FG_COLOR_MODIFIER ]] && 4="$FG_COLOR_MODIFIER"
local bg fg
[[ -n "$3" ]] && bg="%K{$3}" || bg="%k"
[[ -n "$4" ]] && fg="%F{$4}" || fg="%f"
# If CURRENT_RIGHT_BG is "NONE", we are the first right segment.
if [[ $joined == false ]] || [[ "$CURRENT_RIGHT_BG" == "NONE" ]]; then
if isSameColor "$CURRENT_RIGHT_BG" "$3"; then
# Middle segment with same color as previous segment
# We take the current foreground color as color for our
# subsegment (or the default color). This should have
# enough contrast.
local complement
[[ -n "$4" ]] && complement="$4" || complement=$DEFAULT_COLOR
echo -n "%F{$complement}$(print_icon 'RIGHT_SUBSEGMENT_SEPARATOR')%f"
else
echo -n "%F{$3}$(print_icon 'RIGHT_SEGMENT_SEPARATOR')%f"
fi
fi
local visual_identifier
if [[ -n "$6" ]]; then
visual_identifier="$(print_icon $6)"
if [[ -n "$visual_identifier" ]]; then
# Allow users to overwrite the color for the visual identifier only.
local visual_identifier_color_variable=POWERLEVEL9K_${(U)1#prompt_}_VISUAL_IDENTIFIER_COLOR
set_default $visual_identifier_color_variable $4
visual_identifier="%F{${(P)visual_identifier_color_variable}%}$visual_identifier%f"
# Add an whitespace if we print more than just the visual identifier
[[ -n "$5" ]] && visual_identifier=" $visual_identifier"
fi
fi
echo -n "${bg}${fg}"
# Print whitespace only if segment is not joined or first right segment
[[ $joined == false ]] || [[ "$CURRENT_RIGHT_BG" == "NONE" ]] && echo -n "${POWERLEVEL9K_WHITESPACE_BETWEEN_RIGHT_SEGMENTS}"
# Print segment content if there is any
[[ -n "$5" ]] && echo -n "${5}"
# Print the visual identifier
echo -n "${visual_identifier}${POWERLEVEL9K_WHITESPACE_BETWEEN_RIGHT_SEGMENTS}%f"
CURRENT_RIGHT_BG=$3
last_right_element_index=$current_index
}
################################################################
# Prompt Segment Definitions
################################################################
# The `CURRENT_BG` variable is used to remember what the last BG color used was
# when building the left-hand prompt. Because the RPROMPT is created from
# right-left but reads the opposite, this isn't necessary for the other side.
CURRENT_BG='NONE'
# Anaconda Environment
prompt_anaconda() {
# Depending on the conda version, either might be set. This
# variant works even if both are set.
_path=$CONDA_ENV_PATH$CONDA_PREFIX
if ! [ -z "$_path" ]; then
# config - can be overwritten in users' zshrc file.
set_default POWERLEVEL9K_ANACONDA_LEFT_DELIMITER "("
set_default POWERLEVEL9K_ANACONDA_RIGHT_DELIMITER ")"
"$1_prompt_segment" "$0" "$2" "blue" "$DEFAULT_COLOR" "$POWERLEVEL9K_ANACONDA_LEFT_DELIMITER$(basename $_path)$POWERLEVEL9K_ANACONDA_RIGHT_DELIMITER" 'PYTHON_ICON'
fi
}
# AWS Profile
prompt_aws() {
local aws_profile="$AWS_DEFAULT_PROFILE"
if [[ -n "$aws_profile" ]]; then
"$1_prompt_segment" "$0" "$2" red white "$aws_profile" 'AWS_ICON'
fi
}
# Current Elastic Beanstalk environment
prompt_aws_eb_env() {
local eb_env=$(grep environment .elasticbeanstalk/config.yml 2> /dev/null | awk '{print $2}')
if [[ -n "$eb_env" ]]; then
"$1_prompt_segment" "$0" "$2" black green "$eb_env" 'AWS_EB_ICON'
fi
}
# Segment to indicate background jobs with an icon.
set_default POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE true
prompt_background_jobs() {
local background_jobs_number=${$(jobs -l | wc -l)// /}
local wrong_lines=`jobs -l | awk '/pwd now/{ count++ } END {print count}'`
if [[ wrong_lines -gt 0 ]]; then
background_jobs_number=$(( $background_jobs_number - $wrong_lines ))
fi
if [[ background_jobs_number -gt 0 ]]; then
local background_jobs_number_print=""
if [[ "$POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE" == "true" ]] && [[ "$background_jobs_number" -gt 1 ]]; then
background_jobs_number_print="$background_jobs_number"
fi
"$1_prompt_segment" "$0" "$2" "$DEFAULT_COLOR" "cyan" "$background_jobs_number_print" 'BACKGROUND_JOBS_ICON'
fi
}
# A newline in your prompt, so you can segments on multiple lines.
prompt_newline() {
local lws newline
[[ "$1" == "right" ]] && return
newline=$'\n'
lws=$POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS
if [[ "$POWERLEVEL9K_PROMPT_ON_NEWLINE" == true ]]; then
newline="${newline}$(print_icon 'MULTILINE_NEWLINE_PROMPT_PREFIX')"
fi
POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS=
"$1_prompt_segment" \
"$0" \
"$2" \
"NONE" "NONE" "${newline}"
POWERLEVEL9K_WHITESPACE_BETWEEN_LEFT_SEGMENTS=$lws
}
# Segment that indicates usage level of current partition.
set_default POWERLEVEL9K_DISK_USAGE_ONLY_WARNING false
set_default POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL 90
set_default POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL 95
prompt_disk_usage() {
local current_state="unknown"
typeset -AH hdd_usage_forecolors
hdd_usage_forecolors=(
'normal' 'yellow'
'warning' "$DEFAULT_COLOR"
'critical' 'white'
)
typeset -AH hdd_usage_backcolors
hdd_usage_backcolors=(
'normal' $DEFAULT_COLOR
'warning' 'yellow'
'critical' 'red'
)
local disk_usage="${$(\df -P . | sed -n '2p' | awk '{ print $5 }')%%\%}"
if [ "$disk_usage" -ge "$POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL" ]; then
current_state='warning'
if [ "$disk_usage" -ge "$POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL" ]; then
current_state='critical'
fi
else
if [[ "$POWERLEVEL9K_DISK_USAGE_ONLY_WARNING" == true ]]; then
current_state=''
return
fi
current_state='normal'
fi
local message="${disk_usage}%%"
# Draw the prompt_segment
if [[ -n $disk_usage ]]; then
"$1_prompt_segment" "${0}_${current_state}" "$2" "${hdd_usage_backcolors[$current_state]}" "${hdd_usage_forecolors[$current_state]}" "$message" 'DISK_ICON'
fi
}
prompt_battery() {
# The battery can have four different states - default to 'unknown'.
local current_state='unknown'
typeset -AH battery_states
battery_states=(
'low' 'red'
'charging' 'yellow'
'charged' 'green'
'disconnected' "$DEFAULT_COLOR_INVERTED"
)
# Set default values if the user did not configure them
set_default POWERLEVEL9K_BATTERY_LOW_THRESHOLD 10
if [[ $OS =~ OSX && -f /usr/bin/pmset && -x /usr/bin/pmset ]]; then
# obtain battery information from system
local raw_data="$(pmset -g batt | awk 'FNR==2{print}')"
# return if there is no battery on system
[[ -z $(echo $raw_data | grep "InternalBattery") ]] && return
# Time remaining on battery operation (charging/discharging)
local tstring=$(echo $raw_data | awk -F ';' '{print $3}' | awk '{print $1}')
# If time has not been calculated by system yet
[[ $tstring =~ '(\(no|not)' ]] && tstring="..."
# percent of battery charged
typeset -i 10 bat_percent
bat_percent=$(echo $raw_data | grep -o '[0-9]*%' | sed 's/%//')
local remain=""
# Logic for string output
case $(echo $raw_data | awk -F ';' '{print $2}' | awk '{$1=$1};1') in
# for a short time after attaching power, status will be 'AC attached;'
'charging'|'finishing charge'|'AC attached')
current_state="charging"
remain=" ($tstring)"
;;
'discharging')
[[ $bat_percent -lt $POWERLEVEL9K_BATTERY_LOW_THRESHOLD ]] && current_state="low" || current_state="disconnected"
remain=" ($tstring)"
;;
*)
current_state="charged"
;;
esac
fi
if [[ "$OS" == 'Linux' ]] || [[ "$OS" == 'Android' ]]; then
local sysp="/sys/class/power_supply"
# Reported BAT0 or BAT1 depending on kernel version
[[ -a $sysp/BAT0 ]] && local bat=$sysp/BAT0
[[ -a $sysp/BAT1 ]] && local bat=$sysp/BAT1
# Android-related
# Tested on: Moto G falcon (CM 13.0)
[[ -a $sysp/battery ]] && local bat=$sysp/battery
# Return if no battery found
[[ -z $bat ]] && return
local capacity=$(cat $bat/capacity)
local battery_status=$(cat $bat/status)
[[ $capacity -gt 100 ]] && local bat_percent=100 || local bat_percent=$capacity
[[ $battery_status =~ Charging || $battery_status =~ Full ]] && local connected=true
if [[ -z $connected ]]; then
[[ $bat_percent -lt $POWERLEVEL9K_BATTERY_LOW_THRESHOLD ]] && current_state="low" || current_state="disconnected"
else
[[ $bat_percent =~ 100 ]] && current_state="charged"
[[ $bat_percent -lt 100 ]] && current_state="charging"
fi
if [[ -f /usr/bin/acpi ]]; then
local time_remaining=$(acpi | awk '{ print $5 }')
if [[ $time_remaining =~ rate ]]; then
local tstring="..."
elif [[ $time_remaining =~ "[[:digit:]]+" ]]; then
local tstring=${(f)$(date -u -d "$(echo $time_remaining)" +%k:%M 2> /dev/null)}
fi
fi
[[ -n $tstring ]] && local remain=" ($tstring)"
fi
local message
# Default behavior: Be verbose!
set_default POWERLEVEL9K_BATTERY_VERBOSE true
if [[ "$POWERLEVEL9K_BATTERY_VERBOSE" == true ]]; then
message="$bat_percent%%$remain"
else
message="$bat_percent%%"
fi
# override default icon if we are using battery stages
if [[ -n "$POWERLEVEL9K_BATTERY_STAGES" ]]; then
local segment=$(( 100.0 / (${#POWERLEVEL9K_BATTERY_STAGES} - 1 ) ))
if [[ $segment > 1 ]]; then
local offset=$(( ($bat_percent / $segment) + 1 ))
# check if the stages are in an array or a string
[[ "${(t)POWERLEVEL9K_BATTERY_STAGES}" =~ "array" ]] && POWERLEVEL9K_BATTERY_ICON="$POWERLEVEL9K_BATTERY_STAGES[$offset]" || POWERLEVEL9K_BATTERY_ICON=${POWERLEVEL9K_BATTERY_STAGES:$offset:1}
fi
fi
# override the default color if we are using a color level array
if [[ -n "$POWERLEVEL9K_BATTERY_LEVEL_BACKGROUND" ]] && [[ "${(t)POWERLEVEL9K_BATTERY_LEVEL_BACKGROUND}" =~ "array" ]]; then
local segment=$(( 100.0 / (${#POWERLEVEL9K_BATTERY_LEVEL_BACKGROUND} - 1 ) ))
local offset=$(( ($bat_percent / $segment) + 1 ))
"$1_prompt_segment" "$0_${current_state}" "$2" "${POWERLEVEL9K_BATTERY_LEVEL_BACKGROUND[$offset]}" "${battery_states[$current_state]}" "${message}" "BATTERY_ICON"
else
# Draw the prompt_segment
"$1_prompt_segment" "$0_${current_state}" "$2" "${DEFAULT_COLOR}" "${battery_states[$current_state]}" "${message}" "BATTERY_ICON"
fi
}
# Public IP segment
# Parameters:
# * $1 Alignment: string - left|right
# * $2 Index: integer
# * $3 Joined: bool - If the segment should be joined
prompt_public_ip() {
# set default values for segment
set_default POWERLEVEL9K_PUBLIC_IP_TIMEOUT "300"
set_default POWERLEVEL9K_PUBLIC_IP_NONE ""
set_default POWERLEVEL9K_PUBLIC_IP_FILE "/tmp/p9k_public_ip"
set_default POWERLEVEL9K_PUBLIC_IP_HOST "http://ident.me"
defined POWERLEVEL9K_PUBLIC_IP_METHODS || POWERLEVEL9K_PUBLIC_IP_METHODS=(dig curl wget)
# Do we need a fresh IP?
local refresh_ip=false
if [[ -f $POWERLEVEL9K_PUBLIC_IP_FILE ]]; then
typeset -i timediff
# if saved IP is more than
timediff=$(($(date +%s) - $(date -r $POWERLEVEL9K_PUBLIC_IP_FILE +%s)))
[[ $timediff -gt $POWERLEVEL9K_PUBLIC_IP_TIMEOUT ]] && refresh_ip=true
# If tmp file is empty get a fresh IP
[[ -z $(cat $POWERLEVEL9K_PUBLIC_IP_FILE) ]] && refresh_ip=true
[[ -n $POWERLEVEL9K_PUBLIC_IP_NONE ]] && [[ $(cat $POWERLEVEL9K_PUBLIC_IP_FILE) =~ "$POWERLEVEL9K_PUBLIC_IP_NONE" ]] && refresh_ip=true
else
touch $POWERLEVEL9K_PUBLIC_IP_FILE && refresh_ip=true
fi
# grab a fresh IP if needed
local fresh_ip
if [[ $refresh_ip =~ true && -w $POWERLEVEL9K_PUBLIC_IP_FILE ]]; then
for method in "${POWERLEVEL9K_PUBLIC_IP_METHODS[@]}"; do
case $method in
'dig')
fresh_ip="$(dig +time=1 +tries=1 +short myip.opendns.com @resolver1.opendns.com 2> /dev/null)"
[[ "$fresh_ip" =~ ^\; ]] && unset fresh_ip
;;
'curl')
fresh_ip="$(curl --max-time 10 -w '\n' "$POWERLEVEL9K_PUBLIC_IP_HOST" 2> /dev/null)"
;;
'wget')
fresh_ip="$(wget -T 10 -qO- "$POWERLEVEL9K_PUBLIC_IP_HOST" 2> /dev/null)"
;;
esac
# If we found a fresh IP, break loop.
if [[ -n "${fresh_ip}" ]]; then
break;
fi
done
# write IP to tmp file or clear tmp file if an IP was not retrieved
# Redirection with `>!`. From the manpage: Same as >, except that the file
# is truncated to zero length if it exists, even if CLOBBER is unset.
# If the file already exists, and a simple `>` redirection and CLOBBER
# unset, ZSH will produce an error.
[[ -n "${fresh_ip}" ]] && echo $fresh_ip >! $POWERLEVEL9K_PUBLIC_IP_FILE || echo $POWERLEVEL9K_PUBLIC_IP_NONE >! $POWERLEVEL9K_PUBLIC_IP_FILE
fi
# read public IP saved to tmp file
local public_ip="$(cat $POWERLEVEL9K_PUBLIC_IP_FILE)"
# Draw the prompt segment
if [[ -n $public_ip ]]; then
$1_prompt_segment "$0" "$2" "$DEFAULT_COLOR" "$DEFAULT_COLOR_INVERTED" "${public_ip}" 'PUBLIC_IP_ICON'
fi
}
# Context: user@hostname (who am I and where am I)
# Note that if $DEFAULT_USER is not set, this prompt segment will always print
set_default POWERLEVEL9K_ALWAYS_SHOW_CONTEXT false
set_default POWERLEVEL9K_ALWAYS_SHOW_USER false
set_default POWERLEVEL9K_CONTEXT_TEMPLATE "%n@%m"
prompt_context() {
local current_state="DEFAULT"
typeset -AH context_states
context_states=(
"ROOT" "yellow"
"DEFAULT" "011"
)
local content=""
if [[ "$POWERLEVEL9K_ALWAYS_SHOW_CONTEXT" == true ]] || [[ "$(whoami)" != "$DEFAULT_USER" ]] || [[ -n "$SSH_CLIENT" || -n "$SSH_TTY" ]]; then
if [[ $(print -P "%#") == '#' ]]; then
current_state="ROOT"
fi
content="${POWERLEVEL9K_CONTEXT_TEMPLATE}"
elif [[ "$POWERLEVEL9K_ALWAYS_SHOW_USER" == true ]]; then
content="$(whoami)"
else
return
fi
"$1_prompt_segment" "${0}_${current_state}" "$2" "$DEFAULT_COLOR" "${context_states[$current_state]}" "${content}"
}
################################################################
# User: user (who am I)
# Note that if $DEFAULT_USER is not set, this prompt segment will always print
set_default POWERLEVEL9K_USER_TEMPLATE "%n"
prompt_user() {
local current_state="DEFAULT"
typeset -AH user_state
if [[ "$POWERLEVEL9K_ALWAYS_SHOW_USER" == true ]] || [[ "$(whoami)" != "$DEFAULT_USER" ]]; then
if [[ $(print -P "%#") == '#' ]]; then
user_state=(
"STATE" "ROOT"
"CONTENT" "${POWERLEVEL9K_USER_TEMPLATE}"
"BACKGROUND_COLOR" "${DEFAULT_COLOR}"
"FOREGROUND_COLOR" "yellow"
"VISUAL_IDENTIFIER" "ROOT_ICON"
)
else
user_state=(
"STATE" "DEFAULT"
"CONTENT" "$(whoami)"
"BACKGROUND_COLOR" "${DEFAULT_COLOR}"
"FOREGROUND_COLOR" "011"
"VISUAL_IDENTIFIER" "USER_ICON"
)
fi
"$1_prompt_segment" "${0}_${user_state[STATE]}" "$2" "${user_state[BACKGROUND_COLOR]}" "${user_state[FOREGROUND_COLOR]}" "${user_state[CONTENT]}" "${user_state[VISUAL_IDENTIFIER]}"
fi
}
################################################################
# Host: machine (where am I)
set_default POWERLEVEL9K_HOST_TEMPLATE "%m"
prompt_host() {
local current_state="LOCAL"
typeset -AH host_state
if [[ -n "$SSH_CLIENT" ]] || [[ -n "$SSH_TTY" ]]; then
host_state=(
"STATE" "REMOTE"
"CONTENT" "${POWERLEVEL9K_HOST_TEMPLATE}"
"BACKGROUND_COLOR" "${DEFAULT_COLOR}"
"FOREGROUND_COLOR" "yellow"
"VISUAL_IDENTIFIER" "SSH_ICON"
)
else
host_state=(
"STATE" "LOCAL"
"CONTENT" "${POWERLEVEL9K_HOST_TEMPLATE}"
"BACKGROUND_COLOR" "${DEFAULT_COLOR}"
"FOREGROUND_COLOR" "011"
"VISUAL_IDENTIFIER" "HOST_ICON"
)
fi
"$1_prompt_segment" "$0_${host_state[STATE]}" "$2" "${host_state[BACKGROUND_COLOR]}" "${host_state[FOREGROUND_COLOR]}" "${host_state[CONTENT]}" "${host_state[VISUAL_IDENTIFIER]}"
}
# The 'custom` prompt provides a way for users to invoke commands and display
# the output in a segment.
prompt_custom() {
local command=POWERLEVEL9K_CUSTOM_$3:u
local segment_content="$(eval ${(P)command})"
if [[ -n $segment_content ]]; then
"$1_prompt_segment" "${0}_${3:u}" "$2" $DEFAULT_COLOR_INVERTED $DEFAULT_COLOR "$segment_content"
fi
}
# Display the duration the command needed to run.
prompt_command_execution_time() {
set_default POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD 3
set_default POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION 2
# Print time in human readable format
# For that use `strftime` and convert
# the duration (float) to an seconds
# (integer).
# See http://unix.stackexchange.com/a/89748
local humanReadableDuration
if (( _P9K_COMMAND_DURATION > 3600 )); then
humanReadableDuration=$(TZ=GMT; strftime '%H:%M:%S' $(( int(rint(_P9K_COMMAND_DURATION)) )))
elif (( _P9K_COMMAND_DURATION > 60 )); then
humanReadableDuration=$(TZ=GMT; strftime '%M:%S' $(( int(rint(_P9K_COMMAND_DURATION)) )))
else
# If the command executed in seconds, print as float.
# Convert to float
if [[ "${POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION}" == "0" ]]; then
# If user does not want microseconds, then we need to convert
# the duration to an integer.
typeset -i humanReadableDuration
else
typeset -F ${POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION} humanReadableDuration
fi
humanReadableDuration=$_P9K_COMMAND_DURATION
fi
if (( _P9K_COMMAND_DURATION >= POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD )); then
"$1_prompt_segment" "$0" "$2" "red" "226" "${humanReadableDuration}" 'EXECUTION_TIME_ICON'
fi
}
# Dir: current working directory
set_default POWERLEVEL9K_DIR_PATH_SEPARATOR "/"
set_default POWERLEVEL9K_HOME_FOLDER_ABBREVIATION "~"
set_default POWERLEVEL9K_DIR_SHOW_WRITABLE false
prompt_dir() {
local current_path="$(print -P "%~")"
if [[ -n "$POWERLEVEL9K_SHORTEN_DIR_LENGTH" || "$POWERLEVEL9K_SHORTEN_STRATEGY" == "truncate_with_folder_marker" ]]; then
set_default POWERLEVEL9K_SHORTEN_DELIMITER $'\U2026'
case "$POWERLEVEL9K_SHORTEN_STRATEGY" in
truncate_middle)
current_path=$(pwd | sed -e "s,^$HOME,~," | sed $SED_EXTENDED_REGEX_PARAMETER "s/([^/]{$POWERLEVEL9K_SHORTEN_DIR_LENGTH})[^/]+([^/]{$POWERLEVEL9K_SHORTEN_DIR_LENGTH})\//\1$POWERLEVEL9K_SHORTEN_DELIMITER\2\//g")
;;
truncate_from_right)
current_path=$(truncatePathFromRight "$(pwd | sed -e "s,^$HOME,~,")" )
;;
truncate_with_package_name)
local name repo_path package_path current_dir zero
# Get the path of the Git repo, which should have the package.json file
if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == "true" ]]; then
# Get path from the root of the git repository to the current dir
local gitPath=$(git rev-parse --show-prefix)
# Remove trailing slash from git path, so that we can
# remove that git path from the pwd.
gitPath=${gitPath%/}
package_path=${$(pwd)%%$gitPath}
# Remove trailing slash
package_path=${package_path%/}
elif [[ $(git rev-parse --is-inside-git-dir 2> /dev/null) == "true" ]]; then
package_path=${$(pwd)%%/.git*}
fi
# Replace the shortest possible match of the marked folder from
# the current path. Remove the amount of characters up to the
# folder marker from the left. Count only the visible characters
# in the path (this is done by the "zero" pattern; see
# http://stackoverflow.com/a/40855342/5586433).
local zero='%([BSUbfksu]|([FB]|){*})'
current_dir=$(pwd)
# Then, find the length of the package_path string, and save the
# subdirectory path as a substring of the current directory's path from 0
# to the length of the package path's string
subdirectory_path=$(truncatePathFromRight "${current_dir:${#${(S%%)package_path//$~zero/}}}")
# Parse the 'name' from the package.json; if there are any problems, just
# print the file path
defined POWERLEVEL9K_DIR_PACKAGE_FILES || POWERLEVEL9K_DIR_PACKAGE_FILES=(package.json composer.json)
local pkgFile="unknown"
for file in "${POWERLEVEL9K_DIR_PACKAGE_FILES[@]}"; do
if [[ -f "${package_path}/${file}" ]]; then
pkgFile="${package_path}/${file}"
break;
fi
done
local packageName=$(jq '.name' ${pkgFile} 2> /dev/null \
|| node -e 'console.log(require(process.argv[1]).name);' ${pkgFile} 2>/dev/null \
|| cat "${pkgFile}" 2> /dev/null | grep -m 1 "\"name\"" | awk -F ':' '{print $2}' | awk -F '"' '{print $2}' 2>/dev/null \
)
if [[ -n "${packageName}" ]]; then
# Instead of printing out the full path, print out the name of the package
# from the package.json and append the current subdirectory
current_path="`echo $packageName | tr -d '"'`$subdirectory_path"
else
current_path=$(truncatePathFromRight "$(pwd | sed -e "s,^$HOME,~,")" )
fi
;;
truncate_with_folder_marker)
local last_marked_folder marked_folder
set_default POWERLEVEL9K_SHORTEN_FOLDER_MARKER ".shorten_folder_marker"
# Search for the folder marker in the parent directories and
# buildup a pattern that is removed from the current path
# later on.
for marked_folder in $(upsearch $POWERLEVEL9K_SHORTEN_FOLDER_MARKER); do
if [[ "$marked_folder" == "/" ]]; then
# If we reached root folder, stop upsearch.
current_path="/"
elif [[ "$marked_folder" == "$HOME" ]]; then
# If we reached home folder, stop upsearch.
current_path="~"
elif [[ "${marked_folder%/*}" == $last_marked_folder ]]; then
current_path="${current_path%/}/${marked_folder##*/}"
else
current_path="${current_path%/}/$POWERLEVEL9K_SHORTEN_DELIMITER/${marked_folder##*/}"
fi
last_marked_folder=$marked_folder
done
# Replace the shortest possible match of the marked folder from
# the current path.
current_path=$current_path${PWD#${last_marked_folder}*}
;;
truncate_to_unique)
# for each parent path component find the shortest unique beginning
# characters sequence. Source: https://stackoverflow.com/a/45336078
paths=(${(s:/:)PWD})
cur_path='/'
cur_short_path='/'
for directory in ${paths[@]}
do
cur_dir=''
for (( i=0; i<${#directory}; i++ )); do
cur_dir+="${directory:$i:1}"
matching=("$cur_path"/"$cur_dir"*/)
if [[ ${#matching[@]} -eq 1 ]]; then
break
fi
done
cur_short_path+="$cur_dir/"
cur_path+="$directory/"
done
current_path="${cur_short_path: : -1}"
;;
*)
current_path="$(print -P "%$((POWERLEVEL9K_SHORTEN_DIR_LENGTH+1))(c:$POWERLEVEL9K_SHORTEN_DELIMITER/:)%${POWERLEVEL9K_SHORTEN_DIR_LENGTH}c")"
;;
esac
fi
if [[ "${POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER}" == "true" ]]; then
current_path="${current_path[2,-1]}"
fi
if [[ "${POWERLEVEL9K_DIR_PATH_SEPARATOR}" != "/" ]]; then
current_path="$( echo "${current_path}" | sed "s/\//${POWERLEVEL9K_DIR_PATH_SEPARATOR}/g")"
fi
if [[ "${POWERLEVEL9K_HOME_FOLDER_ABBREVIATION}" != "~" ]]; then
current_path=${current_path/#\~/${POWERLEVEL9K_HOME_FOLDER_ABBREVIATION}}
fi
typeset -AH dir_states
dir_states=(
"DEFAULT" "FOLDER_ICON"
"HOME" "HOME_ICON"
"HOME_SUBFOLDER" "HOME_SUB_ICON"
"NOT_WRITABLE" "LOCK_ICON"
)
local current_state="DEFAULT"
if [[ "${POWERLEVEL9K_DIR_SHOW_WRITABLE}" == true && ! -w "$PWD" ]]; then
current_state="NOT_WRITABLE"
elif [[ $(print -P "%~") == '~' ]]; then
current_state="HOME"
elif [[ $(print -P "%~") == '~'* ]]; then
current_state="HOME_SUBFOLDER"
fi
"$1_prompt_segment" "$0_${current_state}" "$2" "blue" "$DEFAULT_COLOR" "${current_path}" "${dir_states[$current_state]}"
}
# Docker machine
prompt_docker_machine() {
local docker_machine="$DOCKER_MACHINE_NAME"
if [[ -n "$docker_machine" ]]; then
"$1_prompt_segment" "$0" "$2" "magenta" "$DEFAULT_COLOR" "$docker_machine" 'SERVER_ICON'
fi
}
# GO prompt
prompt_go_version() {
local go_version
local go_path
go_version=$(go version 2>/dev/null | sed -E "s/.*(go[0-9.]*).*/\1/")
go_path=$(go env GOPATH 2>/dev/null)
if [[ -n "$go_version" && "${PWD##$go_path}" != "$PWD" ]]; then
"$1_prompt_segment" "$0" "$2" "green" "255" "$go_version" "GO_ICON"
fi
}
# Command number (in local history)
prompt_history() {
"$1_prompt_segment" "$0" "$2" "244" "$DEFAULT_COLOR" '%h'
}
# Detection for virtualization (systemd based systems only)
prompt_detect_virt() {
if ! command -v systemd-detect-virt > /dev/null; then
return
fi
local virt=$(systemd-detect-virt)
if [[ "$virt" == "none" ]]; then
if [[ "$(ls -di / | grep -o 2)" != "2" ]]; then
virt="chroot"
"$1_prompt_segment" "$0" "$2" "$DEFAULT_COLOR" "yellow" "$virt"
else
;
fi
else
"$1_prompt_segment" "$0" "$2" "$DEFAULT_COLOR" "yellow" "$virt"
fi
}
prompt_icons_test() {
for key in ${(@k)icons}; do
# The lower color spectrum in ZSH makes big steps. Choosing
# the next color has enough contrast to read.
local random_color=$((RANDOM % 8))
local next_color=$((random_color+1))
"$1_prompt_segment" "$0" "$2" "$random_color" "$next_color" "$key" "$key"
done
}
prompt_ip() {
if [[ "$OS" == "OSX" ]]; then
if defined POWERLEVEL9K_IP_INTERFACE; then
# Get the IP address of the specified interface.
ip=$(ipconfig getifaddr "$POWERLEVEL9K_IP_INTERFACE")
else
local interfaces callback
# Get network interface names ordered by service precedence.
interfaces=$(networksetup -listnetworkserviceorder | grep -o "Device:\s*[a-z0-9]*" | grep -o -E '[a-z0-9]*$')
callback='ipconfig getifaddr $item'
ip=$(getRelevantItem "$interfaces" "$callback")
fi
else
if defined POWERLEVEL9K_IP_INTERFACE; then
# Get the IP address of the specified interface.
ip=$(ip -4 a show "$POWERLEVEL9K_IP_INTERFACE" | grep -o "inet\s*[0-9.]*" | grep -o "[0-9.]*")
else
local interfaces callback
# Get all network interface names that are up
interfaces=$(ip link ls up | grep -o -E ":\s+[a-z0-9]+:" | grep -v "lo" | grep -o "[a-z0-9]*")
callback='ip -4 a show $item | grep -o "inet\s*[0-9.]*" | grep -o "[0-9.]*"'
ip=$(getRelevantItem "$interfaces" "$callback")
fi
fi
"$1_prompt_segment" "$0" "$2" "cyan" "$DEFAULT_COLOR" "$ip" 'NETWORK_ICON'
}
set_default POWERLEVEL9K_VPN_IP_INTERFACE "tun"
# prompt if vpn active
prompt_vpn_ip() {
for vpn_iface in $(/sbin/ifconfig | grep -e ^"$POWERLEVEL9K_VPN_IP_INTERFACE" | cut -d":" -f1)
do
ip=$(/sbin/ifconfig "$vpn_iface" | grep -o "inet\s.*" | cut -d' ' -f2)
"$1_prompt_segment" "$0" "$2" "cyan" "$DEFAULT_COLOR" "$ip" 'VPN_ICON'
done
}
set_default POWERLEVEL9K_LOAD_WHICH 5
prompt_load() {
# The load segment can have three different states
local current_state="unknown"
local load_select=2
local load_avg
local cores
typeset -AH load_states
load_states=(
'critical' 'red'
'warning' 'yellow'
'normal' 'green'
)
case "$POWERLEVEL9K_LOAD_WHICH" in
1)
load_select=1
;;
5)
load_select=2
;;
15)
load_select=3
;;
esac
case "$OS" in
OSX|BSD)
load_avg=$(sysctl vm.loadavg | grep -o -E '[0-9]+(\.|,)[0-9]+' | sed -n ${load_select}p)
if [[ "$OS" == "OSX" ]]; then
cores=$(sysctl -n hw.logicalcpu)
else
cores=$(sysctl -n hw.ncpu)
fi
;;
*)
load_avg=$(cut -d" " -f${load_select} /proc/loadavg)
cores=$(nproc)
esac
# Replace comma
load_avg=${load_avg//,/.}
if [[ "$load_avg" -gt $(bc -l <<< "${cores} * 0.7") ]]; then
current_state="critical"
elif [[ "$load_avg" -gt $(bc -l <<< "${cores} * 0.5") ]]; then
current_state="warning"
else
current_state="normal"
fi
"$1_prompt_segment" "${0}_${current_state}" "$2" "${load_states[$current_state]}" "$DEFAULT_COLOR" "$load_avg" 'LOAD_ICON'
}
# Node version
prompt_node_version() {
local node_version=$(node -v 2>/dev/null)
[[ -z "${node_version}" ]] && return
"$1_prompt_segment" "$0" "$2" "green" "white" "${node_version:1}" 'NODE_ICON'
}
# Node version from NVM
# Only prints the segment if different than the default value
prompt_nvm() {
local node_version nvm_default
(( $+functions[nvm_version] )) || return
node_version=$(nvm_version current)
[[ -z "${node_version}" || ${node_version} == "none" ]] && return
nvm_default=$(nvm_version default)
[[ "$node_version" =~ "$nvm_default" ]] && return
$1_prompt_segment "$0" "$2" "magenta" "black" "${node_version:1}" 'NODE_ICON'
}
# NodeEnv Prompt
prompt_nodeenv() {
local nodeenv_path="$NODE_VIRTUAL_ENV"
if [[ -n "$nodeenv_path" && "$NODE_VIRTUAL_ENV_DISABLE_PROMPT" != true ]]; then
local info="$(node -v)[$(basename "$nodeenv_path")]"
"$1_prompt_segment" "$0" "$2" "black" "green" "$info" 'NODE_ICON'
fi
}
# print a little OS icon
prompt_os_icon() {
"$1_prompt_segment" "$0" "$2" "black" "255" "$OS_ICON"
}
# print PHP version number
prompt_php_version() {
local php_version
php_version=$(php -v 2>&1 | grep -oe "^PHP\s*[0-9.]*")
if [[ -n "$php_version" ]]; then
"$1_prompt_segment" "$0" "$2" "013" "255" "$php_version"
fi
}
# Show free RAM and used Swap
prompt_ram() {
local base=''
local ramfree=0
if [[ "$OS" == "OSX" ]]; then
# Available = Free + Inactive
# See https://support.apple.com/en-us/HT201538
ramfree=$(vm_stat | grep "Pages free" | grep -o -E '[0-9]+')
ramfree=$((ramfree + $(vm_stat | grep "Pages inactive" | grep -o -E '[0-9]+')))
# Convert pages into Bytes
ramfree=$(( ramfree * 4096 ))
else
if [[ "$OS" == "BSD" ]]; then
ramfree=$(grep 'avail memory' /var/run/dmesg.boot | awk '{print $4}')
else
ramfree=$(grep -o -E "MemAvailable:\s+[0-9]+" /proc/meminfo | grep -o "[0-9]*")
base='K'
fi
fi
"$1_prompt_segment" "$0" "$2" "yellow" "$DEFAULT_COLOR" "$(printSizeHumanReadable "$ramfree" $base)" 'RAM_ICON'
}
# rbenv information
prompt_rbenv() {
if which rbenv 2>/dev/null >&2; then
local rbenv_version_name="$(rbenv version-name)"
local rbenv_global="$(rbenv global)"
# Don't show anything if the current Ruby is the same as the global Ruby.
if [[ $rbenv_version_name == $rbenv_global ]]; then
return
fi
"$1_prompt_segment" "$0" "$2" "red" "$DEFAULT_COLOR" "$rbenv_version_name" 'RUBY_ICON'
fi
}
# chruby information
# see https://github.com/postmodern/chruby/issues/245 for chruby_auto issue with ZSH
prompt_chruby() {
local chruby_env
chrb_env="$(chruby 2> /dev/null | grep \* | tr -d '* ')"
# Don't show anything if the chruby did not change the default ruby
if [[ "${chrb_env:-system}" != "system" ]]; then
"$1_prompt_segment" "$0" "$2" "red" "$DEFAULT_COLOR" "${chrb_env}" 'RUBY_ICON'
fi
}
# Print an icon if user is root.
prompt_root_indicator() {
if [[ "$UID" -eq 0 ]]; then
"$1_prompt_segment" "$0" "$2" "$DEFAULT_COLOR" "yellow" "" 'ROOT_ICON'
fi
}
# Print Rust version number
prompt_rust_version() {
local rust_version
rust_version=$(rustc --version 2>&1 | grep -oe "^rustc\s*[^ ]*" | grep -o '[0-9.a-z\\\-]*$')
if [[ -n "$rust_version" ]]; then
"$1_prompt_segment" "$0" "$2" "208" "$DEFAULT_COLOR" "Rust $rust_version" 'RUST_ICON'
fi
}
# RSpec test ratio
prompt_rspec_stats() {
if [[ (-d app && -d spec) ]]; then
local code_amount tests_amount
code_amount=$(ls -1 app/**/*.rb | wc -l)
tests_amount=$(ls -1 spec/**/*.rb | wc -l)
build_test_stats "$1" "$0" "$2" "$code_amount" "$tests_amount" "RSpec" 'TEST_ICON'
fi
}
# Ruby Version Manager information
prompt_rvm() {
local version_and_gemset=${rvm_env_string/ruby-}
if [[ -n "$version_and_gemset" ]]; then
"$1_prompt_segment" "$0" "$2" "240" "$DEFAULT_COLOR" "$version_and_gemset" 'RUBY_ICON'
fi
}
prompt_ssh() {
if [[ -n "$SSH_CLIENT" ]] || [[ -n "$SSH_TTY" ]]; then
"$1_prompt_segment" "$0" "$2" "$DEFAULT_COLOR" "yellow" "" 'SSH_ICON'
fi
}
# Status: When an error occur, return the error code, or a cross icon if option is set
# Display an ok icon when no error occur, or hide the segment if option is set to false
#
set_default POWERLEVEL9K_STATUS_CROSS false
set_default POWERLEVEL9K_STATUS_OK true
set_default POWERLEVEL9K_STATUS_SHOW_PIPESTATUS true
set_default POWERLEVEL9K_STATUS_HIDE_SIGNAME false
# old options, retro compatibility
set_default POWERLEVEL9K_STATUS_VERBOSE true
set_default POWERLEVEL9K_STATUS_OK_IN_NON_VERBOSE false
exit_code_or_status() {
local ec=$1
if [[ "$POWERLEVEL9K_STATUS_HIDE_SIGNAME" = true ]]; then
echo "$ec"
elif (( ec <= 128 )); then
echo "$ec"
else
local sig=$(( ec - 128 ))
local idx=$(( sig + 1 ))
echo "${signals[$idx]}(-${sig})"
fi
}
prompt_status() {
local ec_text
local ec_sum
local ec
if [[ $POWERLEVEL9K_STATUS_SHOW_PIPESTATUS == true ]]; then
ec_text=$(exit_code_or_status "${RETVALS[1]}")
ec_sum=${RETVALS[1]}
for ec in "${(@)RETVALS[2,-1]}"; do
ec_text="${ec_text}|$(exit_code_or_status "$ec")"
ec_sum=$(( $ec_sum + $ec ))
done
else
# We use RETVAL instead of the right-most RETVALS item because
# PIPE_FAIL may be set.
ec_text=$(exit_code_or_status "${RETVAL}")
ec_sum=${RETVAL}
fi
if (( ec_sum > 0 )); then
if [[ "$POWERLEVEL9K_STATUS_CROSS" == false && "$POWERLEVEL9K_STATUS_VERBOSE" == true ]]; then
"$1_prompt_segment" "$0_ERROR" "$2" "red" "226" "$ec_text" 'CARRIAGE_RETURN_ICON'
else
"$1_prompt_segment" "$0_ERROR" "$2" "$DEFAULT_COLOR" "red" "" 'FAIL_ICON'
fi
elif [[ "$POWERLEVEL9K_STATUS_OK" == true ]] && [[ "$POWERLEVEL9K_STATUS_VERBOSE" == true || "$POWERLEVEL9K_STATUS_OK_IN_NON_VERBOSE" == true ]]; then
"$1_prompt_segment" "$0_OK" "$2" "$DEFAULT_COLOR" "green" "" 'OK_ICON'
fi
}
prompt_swap() {
local swap_used=0
local base=''
if [[ "$OS" == "OSX" ]]; then
local raw_swap_used
raw_swap_used=$(sysctl vm.swapusage | grep -o "used\s*=\s*[0-9,.A-Z]*" | grep -o "[0-9,.A-Z]*$")
typeset -F 2 swap_used
swap_used=${$(echo $raw_swap_used | grep -o "[0-9,.]*")//,/.}
# Replace comma
swap_used=${swap_used//,/.}
base=$(echo "$raw_swap_used" | grep -o "[A-Z]*$")
else
swap_total=$(grep -o -E "SwapTotal:\s+[0-9]+" /proc/meminfo | grep -o "[0-9]*")
swap_free=$(grep -o -E "SwapFree:\s+[0-9]+" /proc/meminfo | grep -o "[0-9]*")
swap_used=$(( swap_total - swap_free ))
base='K'
fi
"$1_prompt_segment" "$0" "$2" "yellow" "$DEFAULT_COLOR" "$(printSizeHumanReadable "$swap_used" $base)" 'SWAP_ICON'
}
# Symfony2-PHPUnit test ratio
prompt_symfony2_tests() {
if [[ (-d src && -d app && -f app/AppKernel.php) ]]; then
local code_amount tests_amount
code_amount=$(ls -1 src/**/*.php | grep -vc Tests)
tests_amount=$(ls -1 src/**/*.php | grep -c Tests)
build_test_stats "$1" "$0" "$2" "$code_amount" "$tests_amount" "SF2" 'TEST_ICON'
fi
}
# Symfony2-Version
prompt_symfony2_version() {
if [[ -f app/bootstrap.php.cache ]]; then
local symfony2_version
symfony2_version=$(grep " VERSION " app/bootstrap.php.cache | sed -e 's/[^.0-9]*//g')
"$1_prompt_segment" "$0" "$2" "240" "$DEFAULT_COLOR" "$symfony2_version" 'SYMFONY_ICON'
fi
}
# Show a ratio of tests vs code
build_test_stats() {
local code_amount="$4"
local tests_amount="$5"+0.00001
local headline="$6"
# Set float precision to 2 digits:
typeset -F 2 ratio
local ratio=$(( (tests_amount/code_amount) * 100 ))
(( ratio >= 75 )) && "$1_prompt_segment" "${2}_GOOD" "$3" "cyan" "$DEFAULT_COLOR" "$headline: $ratio%%" "$6"
(( ratio >= 50 && ratio < 75 )) && "$1_prompt_segment" "$2_AVG" "$3" "yellow" "$DEFAULT_COLOR" "$headline: $ratio%%" "$6"
(( ratio < 50 )) && "$1_prompt_segment" "$2_BAD" "$3" "red" "$DEFAULT_COLOR" "$headline: $ratio%%" "$6"
}
# System time
prompt_time() {
local time_format="%D{%H:%M:%S}"
if [[ -n "$POWERLEVEL9K_TIME_FORMAT" ]]; then
time_format="$POWERLEVEL9K_TIME_FORMAT"
fi
"$1_prompt_segment" "$0" "$2" "$DEFAULT_COLOR_INVERTED" "$DEFAULT_COLOR" "$time_format"
}
# todo.sh: shows the number of tasks in your todo.sh file
prompt_todo() {
if $(hash todo.sh 2>&-); then
count=$(todo.sh ls | egrep "TODO: [0-9]+ of ([0-9]+) tasks shown" | awk '{ print $4 }')
if [[ "$count" = <-> ]]; then
"$1_prompt_segment" "$0" "$2" "244" "$DEFAULT_COLOR" "$count" 'TODO_ICON'
fi
fi
}
# VCS segment: shows the state of your repository, if you are in a folder under
# version control
set_default POWERLEVEL9K_VCS_ACTIONFORMAT_FOREGROUND "red"
# Default: Just display the first 8 characters of our changeset-ID.
set_default POWERLEVEL9K_VCS_INTERNAL_HASH_LENGTH "8"
powerlevel9k_vcs_init() {
if [[ -n "$POWERLEVEL9K_CHANGESET_HASH_LENGTH" ]]; then
POWERLEVEL9K_VCS_INTERNAL_HASH_LENGTH="$POWERLEVEL9K_CHANGESET_HASH_LENGTH"
fi
# Load VCS_INFO
autoload -Uz vcs_info
VCS_WORKDIR_DIRTY=false
VCS_WORKDIR_HALF_DIRTY=false
# The vcs segment can have three different states - defaults to 'clean'.
typeset -gAH vcs_states
vcs_states=(
'clean' 'green'
'modified' 'yellow'
'untracked' 'green'
)
VCS_CHANGESET_PREFIX=''
if [[ "$POWERLEVEL9K_SHOW_CHANGESET" == true ]]; then
VCS_CHANGESET_PREFIX="$(print_icon 'VCS_COMMIT_ICON')%0.$POWERLEVEL9K_VCS_INTERNAL_HASH_LENGTH""i "
fi
zstyle ':vcs_info:*' enable git hg svn
zstyle ':vcs_info:*' check-for-changes true
VCS_DEFAULT_FORMAT="$VCS_CHANGESET_PREFIX%b%c%u%m"
zstyle ':vcs_info:*' formats "$VCS_DEFAULT_FORMAT"
zstyle ':vcs_info:*' actionformats "%b %F{${POWERLEVEL9K_VCS_ACTIONFORMAT_FOREGROUND}}| %a%f"
zstyle ':vcs_info:*' stagedstr " $(print_icon 'VCS_STAGED_ICON')"
zstyle ':vcs_info:*' unstagedstr " $(print_icon 'VCS_UNSTAGED_ICON')"
defined POWERLEVEL9K_VCS_GIT_HOOKS || POWERLEVEL9K_VCS_GIT_HOOKS=(vcs-detect-changes git-untracked git-aheadbehind git-stash git-remotebranch git-tagname)
zstyle ':vcs_info:git*+set-message:*' hooks $POWERLEVEL9K_VCS_GIT_HOOKS
defined POWERLEVEL9K_VCS_HG_HOOKS || POWERLEVEL9K_VCS_HG_HOOKS=(vcs-detect-changes)
zstyle ':vcs_info:hg*+set-message:*' hooks $POWERLEVEL9K_VCS_HG_HOOKS
defined POWERLEVEL9K_VCS_SVN_HOOKS || POWERLEVEL9K_VCS_SVN_HOOKS=(vcs-detect-changes svn-detect-changes)
zstyle ':vcs_info:svn*+set-message:*' hooks $POWERLEVEL9K_VCS_SVN_HOOKS
# For Hg, only show the branch name
zstyle ':vcs_info:hg*:*' branchformat "$(print_icon 'VCS_BRANCH_ICON')%b"
# The `get-revision` function must be turned on for dirty-check to work for Hg
zstyle ':vcs_info:hg*:*' get-revision true
zstyle ':vcs_info:hg*:*' get-bookmarks true
zstyle ':vcs_info:hg*+gen-hg-bookmark-string:*' hooks hg-bookmarks
# For svn, only
# TODO fix the %b (branch) format for svn. Using %b breaks
# color-encoding of the foreground for the rest of the powerline.
zstyle ':vcs_info:svn*:*' formats "$VCS_CHANGESET_PREFIX%c%u"
zstyle ':vcs_info:svn*:*' actionformats "$VCS_CHANGESET_PREFIX%c%u %F{${POWERLEVEL9K_VCS_ACTIONFORMAT_FOREGROUND}}| %a%f"
if [[ "$POWERLEVEL9K_SHOW_CHANGESET" == true ]]; then
zstyle ':vcs_info:*' get-revision true
fi
}
prompt_vcs() {
VCS_WORKDIR_DIRTY=false
VCS_WORKDIR_HALF_DIRTY=false
current_state=""
# Actually invoke vcs_info manually to gather all information.
vcs_info
local vcs_prompt="${vcs_info_msg_0_}"
if [[ -n "$vcs_prompt" ]]; then
if [[ "$VCS_WORKDIR_DIRTY" == true ]]; then
# $vcs_visual_identifier gets set in +vi-vcs-detect-changes in functions/vcs.zsh,
# as we have there access to vcs_info internal hooks.
current_state='modified'
else
if [[ "$VCS_WORKDIR_HALF_DIRTY" == true ]]; then
current_state='untracked'
else
current_state='clean'
fi
fi
"$1_prompt_segment" "${0}_${(U)current_state}" "$2" "${vcs_states[$current_state]}" "$DEFAULT_COLOR" "$vcs_prompt" "$vcs_visual_identifier"
fi
}
# Vi Mode: show editing mode (NORMAL|INSERT)
set_default POWERLEVEL9K_VI_INSERT_MODE_STRING "INSERT"
set_default POWERLEVEL9K_VI_COMMAND_MODE_STRING "NORMAL"
prompt_vi_mode() {
case ${KEYMAP} in
vicmd)
"$1_prompt_segment" "$0_NORMAL" "$2" "$DEFAULT_COLOR" "default" "$POWERLEVEL9K_VI_COMMAND_MODE_STRING"
;;
main|viins|*)
"$1_prompt_segment" "$0_INSERT" "$2" "$DEFAULT_COLOR" "blue" "$POWERLEVEL9K_VI_INSERT_MODE_STRING"
;;
esac
}
# Virtualenv: current working virtualenv
# More information on virtualenv (Python):
# https://virtualenv.pypa.io/en/latest/
prompt_virtualenv() {
local virtualenv_path="$VIRTUAL_ENV"
if [[ -n "$virtualenv_path" && "$VIRTUAL_ENV_DISABLE_PROMPT" != true ]]; then
"$1_prompt_segment" "$0" "$2" "blue" "$DEFAULT_COLOR" "$(basename "$virtualenv_path")" 'PYTHON_ICON'
fi
}
# pyenv: current active python version (with restrictions)
# More information on pyenv (Python version manager like rbenv and rvm):
# https://github.com/yyuu/pyenv
# the prompt parses output of pyenv version and only displays the first word
prompt_pyenv() {
local pyenv_version="$(pyenv version 2>/dev/null)"
pyenv_version="${pyenv_version%% *}"
# XXX: The following should return the same as above.
# This reads better for devs familiar with sed/awk/grep/cut utilities
# Using shell expansion/substitution may hamper future maintainability
#local pyenv_version="$(pyenv version 2>/dev/null | head -n1 | cut -d' ' -f1)"
if [[ -n "$pyenv_version" && "$pyenv_version" != "system" ]]; then
"$1_prompt_segment" "$0" "$2" "blue" "$DEFAULT_COLOR" "$pyenv_version" 'PYTHON_ICON'
fi
}
# Swift version
prompt_swift_version() {
# Get the first number as this is probably the "main" version number..
local swift_version=$(swift --version 2>/dev/null | grep -o -E "[0-9.]+" | head -n 1)
[[ -z "${swift_version}" ]] && return
"$1_prompt_segment" "$0" "$2" "magenta" "white" "${swift_version}" 'SWIFT_ICON'
}
# dir_writable: Display information about the user's permission to write in the current directory
prompt_dir_writable() {
if [[ ! -w "$PWD" ]]; then
"$1_prompt_segment" "$0_FORBIDDEN" "$2" "red" "226" "" 'LOCK_ICON'
fi
}
# Kubernetes Current Context
prompt_kubecontext() {
local kubectl_version="$(kubectl version --client 2>/dev/null)"
if [[ -n "$kubectl_version" ]]; then
# Get the current Kubernetes config context's namespaece
local k8s_namespace=$(kubectl config get-contexts --no-headers | grep '*' | awk '{print $5}')
# Get the current Kuberenetes context
local k8s_context=$(kubectl config current-context)
if [[ -z "$k8s_namespace" ]]; then
k8s_namespace="default"
fi
"$1_prompt_segment" "$0" "$2" "magenta" "white" "$k8s_context/$k8s_namespace" "KUBERNETES_ICON"
fi
}
################################################################
# Prompt processing and drawing
################################################################
# Main prompt
build_left_prompt() {
local index=1
for element in "${POWERLEVEL9K_LEFT_PROMPT_ELEMENTS[@]}"; do
# Remove joined information in direct calls
element=${element%_joined}
# Check if it is a custom command, otherwise interpet it as
# a prompt.
if [[ $element[0,7] =~ "custom_" ]]; then
"prompt_custom" "left" "$index" $element[8,-1]
else
"prompt_$element" "left" "$index"
fi
index=$((index + 1))
done
left_prompt_end
}
# Right prompt
build_right_prompt() {
local index=1
for element in "${POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS[@]}"; do
# Remove joined information in direct calls
element=${element%_joined}
# Check if it is a custom command, otherwise interpet it as
# a prompt.
if [[ $element[0,7] =~ "custom_" ]]; then
"prompt_custom" "right" "$index" $element[8,-1]
else
"prompt_$element" "right" "$index"
fi
index=$((index + 1))
done
}
powerlevel9k_preexec() {
_P9K_TIMER_START=$EPOCHREALTIME
}
set_default POWERLEVEL9K_PROMPT_ADD_NEWLINE false
powerlevel9k_prepare_prompts() {
RETVAL=$?
RETVALS=( "$pipestatus[@]" )
_P9K_COMMAND_DURATION=$((EPOCHREALTIME - _P9K_TIMER_START))
# Reset start time
_P9K_TIMER_START=0x7FFFFFFF
if [[ "$POWERLEVEL9K_PROMPT_ON_NEWLINE" == true ]]; then
PROMPT='$(print_icon 'MULTILINE_FIRST_PROMPT_PREFIX')%f%b%k$(build_left_prompt)
$(print_icon 'MULTILINE_LAST_PROMPT_PREFIX')'
if [[ "$POWERLEVEL9K_RPROMPT_ON_NEWLINE" != true ]]; then
# The right prompt should be on the same line as the first line of the left
# prompt. To do so, there is just a quite ugly workaround: Before zsh draws
# the RPROMPT, we advise it, to go one line up. At the end of RPROMPT, we
# advise it to go one line down. See:
# http://superuser.com/questions/357107/zsh-right-justify-in-ps1
local LC_ALL="" LC_CTYPE="en_US.UTF-8" # Set the right locale to protect special characters
RPROMPT_PREFIX='%{'$'\e[1A''%}' # one line up
RPROMPT_SUFFIX='%{'$'\e[1B''%}' # one line down
else
RPROMPT_PREFIX=''
RPROMPT_SUFFIX=''
fi
else
PROMPT='%f%b%k$(build_left_prompt)'
RPROMPT_PREFIX=''
RPROMPT_SUFFIX=''
fi
if [[ "$POWERLEVEL9K_DISABLE_RPROMPT" != true ]]; then
RPROMPT='$RPROMPT_PREFIX%f%b%k$(build_right_prompt)%{$reset_color%}$RPROMPT_SUFFIX'
fi
NEWLINE='
'
[[ $POWERLEVEL9K_PROMPT_ADD_NEWLINE == true ]] && PROMPT="$NEWLINE$PROMPT"
}
prompt_powerlevel9k_setup() {
# The value below was set to better support 32-bit CPUs.
# It's the maximum _signed_ integer value on 32-bit CPUs.
# Please don't change it until 19 January of 2038. ;)
# Disable false display of command execution time
_P9K_TIMER_START=0x7FFFFFFF
# The prompt function will set these prompt_* options after the setup function
# returns. We need prompt_subst so we can safely run commands in the prompt
# without them being double expanded and we need prompt_percent to expand the
# common percent escape sequences.
prompt_opts=(cr percent sp subst)
# Borrowed from promptinit, sets the prompt options in case the theme was
# not initialized via promptinit.
setopt noprompt{bang,cr,percent,sp,subst} "prompt${^prompt_opts[@]}"
# Display a warning if the terminal does not support 256 colors
local term_colors
term_colors=$(echotc Co 2>/dev/null)
if (( ! $? && ${term_colors:-0} < 256 )); then
print -P "%F{red}WARNING!%f Your terminal appears to support fewer than 256 colors!"
print -P "If your terminal supports 256 colors, please export the appropriate environment variable"
print -P "_before_ loading this theme in your \~\/.zshrc. In most terminal emulators, putting"
print -P "%F{blue}export TERM=\"xterm-256color\"%f at the top of your \~\/.zshrc is sufficient."
fi
# If the terminal `LANG` is set to `C`, this theme will not work at all.
local term_lang
term_lang=$(echo $LANG)
if [[ $term_lang == 'C' ]]; then
print -P "\t%F{red}WARNING!%f Your terminal's 'LANG' is set to 'C', which breaks this theme!"
print -P "\t%F{red}WARNING!%f Please set your 'LANG' to a UTF-8 language, like 'en_US.UTF-8'"
print -P "\t%F{red}WARNING!%f _before_ loading this theme in your \~\.zshrc. Putting"
print -P "\t%F{red}WARNING!%f %F{blue}export LANG=\"en_US.UTF-8\"%f at the top of your \~\/.zshrc is sufficient."
fi
defined POWERLEVEL9K_LEFT_PROMPT_ELEMENTS || POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir rbenv vcs)
defined POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS || POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status root_indicator background_jobs history time)
# Display a warning if deprecated segments are in use.
typeset -AH deprecated_segments
# old => new
deprecated_segments=(
'longstatus' 'status'
)
print_deprecation_warning deprecated_segments
# initialize colors
autoload -U colors && colors
if segment_in_use "vcs"; then
powerlevel9k_vcs_init
fi
# initialize timing functions
zmodload zsh/datetime
# Initialize math functions
zmodload zsh/mathfunc
# initialize hooks
autoload -Uz add-zsh-hook
# prepare prompts
add-zsh-hook precmd powerlevel9k_prepare_prompts
add-zsh-hook preexec powerlevel9k_preexec
}
prompt_powerlevel9k_teardown() {
add-zsh-hook -D precmd powerlevel9k_\*
add-zsh-hook -D preexec powerlevel9k_\*
PROMPT='%m%# '
RPROMPT=
}
prompt_powerlevel9k_setup "$@"
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# ssh
# export SSH_KEY_PATH="~/.ssh/rsa_id"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment