From 9f3118f018c6c69aad0d13d56ad2d056de354d2b Mon Sep 17 00:00:00 2001 From: Lance Helsten Date: Thu, 27 Aug 2015 08:57:47 -0600 Subject: [PATCH] 2015-08-27 Daily commit. --- runcoms/zprofile | 50 +++++++++++++++--------------------------------- runcoms/zshenv | 22 +++++++++++++++++++++ runcoms/zshrc | 23 ++++++++++++++++++++++ 3 files changed, 60 insertions(+), 35 deletions(-) diff --git a/runcoms/zprofile b/runcoms/zprofile index 999b9d07..e9b00558 100644 --- a/runcoms/zprofile +++ b/runcoms/zprofile @@ -24,40 +24,20 @@ # | $ZDOTDIR/.zlogin | H | | | # +--------------------+-------+-------+--------+ -# Browser -case `/usr/bin/uname -s` in - Darwin) - export BROWSER='open' - ;; -esac - -# Editors -export EDITOR='vim' -export VISUAL='vim' -export PAGER='less' -export LESSEDIT='vim' - -# Language -if [[ -z "$LANG" ]]; then - export LANG='en_US.UTF-8' -fi - -# Set the default Less options. -# Mouse-wheel scrolling has been disabled by -X (disable screen clearing). -# Remove -X and -F (exit if the content fits on one screen) to enable it. -export LESS='-F -g -i -M -R -S -w -X -z-4' - -# Set the Less input preprocessor. -# Try both `lesspipe` and `lesspipe.sh` as either might exist on a system. -if (( $#commands[(i)lesspipe(|.sh)] )); then - export LESSOPEN="| /usr/bin/env $commands[(i)lesspipe(|.sh)] %s 2>&-" -fi - -# Temporary Files -if [[ ! -d "$TMPDIR" ]]; then - export TMPDIR="/tmp/$LOGNAME" - mkdir -p -m 700 "$TMPDIR" +## +## Reset the path because some systems put path_helper in /etc/zprofile +## which reorders the path that I setup in ~/.zshenv +echo $PATH | \grep '^/opt/' +if [ $? -eq 1 ]; then + path=( + /opt/local/bin /usr/local/bin /usr/bin /bin + /opt/local/sbin /usr/local/sbin /usr/sbin /sbin + $HOME/Library/Scripts/bin/`/usr/bin/uname -s`/`/usr/bin/uname -m` + $HOME/Library/Scripts/bin/`/usr/bin/uname -s` + $HOME/Library/Scripts/bin/ + $HOME/Library/Python/bin + /usr/X11R6/bin + /opt/local/Library/Frameworks/Python.framework/Versions/Current/bin + ) fi -TMPPREFIX="${TMPDIR%/}/zsh" - diff --git a/runcoms/zshenv b/runcoms/zshenv index 616c5b65..7d32f69a 100644 --- a/runcoms/zshenv +++ b/runcoms/zshenv @@ -43,6 +43,28 @@ if [ -d $HOME/.rvm/bin ]; then path=($path $HOME/.rvm/bin) fi +# Editors +export EDITOR='vim' +export VISUAL='vim' +export PAGER='less' +export LESSEDIT='vim' + + +# Language +if [[ -z "$LANG" ]]; then + export LANG='en_US.UTF-8' + fi + + +# Temporary Files +if [[ ! -d "$TMPDIR" ]]; then + export TMPDIR="/tmp/$LOGNAME" + mkdir -p -m 700 "$TMPDIR" + fi + + TMPPREFIX="${TMPDIR%/}/zsh" + + # Go if [ -d /usr/local/go/bin ]; then path=($path /usr/local/go/bin) diff --git a/runcoms/zshrc b/runcoms/zshrc index 57ca11c7..2aef9e97 100644 --- a/runcoms/zshrc +++ b/runcoms/zshrc @@ -40,11 +40,34 @@ fi setopt histsubstpattern setopt vi + +# Browser +case `/usr/bin/uname -s` in + Darwin) + export BROWSER='open' + ;; +esac + + +# Set the default Less options. +# Mouse-wheel scrolling has been disabled by -X (disable screen clearing). +# Remove -X and -F (exit if the content fits on one screen) to enable it. +export LESS='-F -g -i -M -R -S -w -X -z-4' + + +# Set the Less input preprocessor. +# Try both `lesspipe` and `lesspipe.sh` as either might exist on a system. +if (( $#commands[(i)lesspipe(|.sh)] )); then + export LESSOPEN="| /usr/bin/env $commands[(i)lesspipe(|.sh)] %s 2>&-" +fi + + # General Settings declare -x CALENDAR_DIR="/usr/share/calendar" declare HISTFILESIZE='50' declare HISTSIZE='50' + #aliases alias c="clear; clear; dirs" alias ls="ls -FGh"