From 7036e53742eee221cc6725a9500c3e56cdb04f4c Mon Sep 17 00:00:00 2001 From: Bodaniel Jeanes Date: Mon, 22 Nov 2010 22:28:49 +1000 Subject: [PATCH] clean up and fix EDITOR variable usage and remove unneeded-paths (since everything is now in brew etc) --- shell/aliases.sh | 4 ++-- shell/common.sh | 4 ++-- shell/exports.sh | 22 ++++++++++++++-------- shell/osx.sh | 9 ++------- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/shell/aliases.sh b/shell/aliases.sh index 53fa89c..3a76962 100644 --- a/shell/aliases.sh +++ b/shell/aliases.sh @@ -9,7 +9,7 @@ alias top='top -o cpu' alias et="$EDITOR ." alias sprof="reload" -alias eprof="$EDITOR $HOME/.config" +alias eprof="m $HOME/.config" alias home="cd $HOME" # the tilde is too hard to reach alias systail='tail -fn0 /var/log/system.log' @@ -34,4 +34,4 @@ alias r='rake' alias webshare='python -c "import SimpleHTTPServer;SimpleHTTPServer.test()"' alias pubkey="cat $HOME/.ssh/*.pub" -alias colorslist="set | egrep 'COLOR_\w*'" # lists all the colors \ No newline at end of file +alias colorslist="set | egrep 'COLOR_\w*'" # lists all the colors diff --git a/shell/common.sh b/shell/common.sh index 4100bf5..8692820 100644 --- a/shell/common.sh +++ b/shell/common.sh @@ -1,4 +1,4 @@ -PATH="/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/usr/local/mongodb/bin:/usr/local/pgsql/bin:/usr/X11/bin:/opt/local/bin:${PATH}" +PATH="/usr/local/bin:/usr/local/sbin:/usr/X11/bin:/usr/bin:/usr/sbin:/bin:/sbin:${PATH}" CDPATH=".:${HOME}" source $DOT_FILES/$CURRENT_SHELL/config.*sh @@ -9,4 +9,4 @@ source $DOT_FILES/shell/save-directory.sh source $DOT_FILES/shell/prompt.sh source $DOT_FILES/shell/git.sh -[[ `uname -s` == 'Darwin' ]] && source $DOT_FILES/shell/osx.sh \ No newline at end of file +[[ `uname -s` == 'Darwin' ]] && source $DOT_FILES/shell/osx.sh diff --git a/shell/exports.sh b/shell/exports.sh index c92f474..a9db00d 100644 --- a/shell/exports.sh +++ b/shell/exports.sh @@ -1,12 +1,18 @@ -export PATH="/usr/local/mysql/bin/:$PATH" -export PATH="/opt/local/bin:/opt/local/sbin:$PATH" -export PATH="$PATH:/usr/local/jruby/bin" +if $(which mate); then + EDITOR="mate -wl1" +elif $(which nano); then + EDITOR="nano -w" +elif $(which mvim); then + EDITOR="mvim" +elif $(which gvim); then + EDITOR="gvim" +else + EDITOR="vim" +fi -# Use single quotes here to lazy evaluate the $EDITOR variable (as it changes later if on OS X) -export EDITOR='nano -w' -export GEM_OPEN_EDITOR='$EDITOR' -export GIT_EDITOR='$EDITOR' -export VISUAL='$EDITOR' +export GEM_OPEN_EDITOR=$EDITOR +export GIT_EDITOR=$EDITOR +export VISUAL=$EDITOR export IRBRC="$HOME/.irbrc" export JEWELER_OPTS="--rspec --gemcutter --rubyforge --reek --roodi" diff --git a/shell/osx.sh b/shell/osx.sh index a1ed6b2..19241ad 100644 --- a/shell/osx.sh +++ b/shell/osx.sh @@ -1,9 +1,4 @@ -export EDITOR='mate -wl1' -export VISUAL=$EDITOR -export GIT_EDITOR=$EDITOR - -export PATH="/Library/PostgreSQL8/bin/:$PATH" -CDPATH="${CDPATH}:${HOME}/Code/Mocra/:${HOME}/Code/Personal:${HOME}/Sites/Mocra:${HOME}/Sites/Personal:${HOME}/Sites/Client/" +CDPATH="${CDPATH}:${HOME}/Code/Mocra/:${HOME}/Code/Personal:${HOME}/Code/:${HOME}/Code/Open Source:${HOME}/Sites/Mocra:${HOME}/Sites/Personal:${HOME}/Sites/Client/" alias o='open .' @@ -81,4 +76,4 @@ function maxc() { printf "\e[3;0;0;t\e[8;50;0t"; /usr/bin/clear; return 0; } function maxr() { printf "\e[3;0;0;t\e[8;0;100t"; /usr/bin/clear; return 0; } # show number of lines & columns -function lc() { printf "lines: $(/usr/bin/tput lines)\ncolums: $(/usr/bin/tput cols)\n"; return 0; } \ No newline at end of file +function lc() { printf "lines: $(/usr/bin/tput lines)\ncolums: $(/usr/bin/tput cols)\n"; return 0; }