forked from ryanb/dotfiles
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
many color/term fixes to accomodate Ubuntu, updated emacs-solarized, …
…better-paths debugged and reintroduced
- Loading branch information
Showing
9 changed files
with
189 additions
and
155 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# -*- sh -*- | ||
|
||
# # Add some user and/or local paths to $PATH and $MANPATH | ||
|
||
# ### | ||
# ### Add your dirs to [pre|post]PATH and [pre|post]MANPATH below. | ||
# ### Dirs already in your PATH/MANPATH won't be added. | ||
# ### Dirs that don't exist on your system won't be added. | ||
# ### Dirs will be *prepended* to your PATH/MANPATH, order preserved. | ||
# ### | ||
|
||
prePATH="$HOME/bin:$HOME/.scripts:$HOME/.rvm/bin" | ||
|
||
postPATH="/usr/local/mysql/bin:/usr/local/git/bin:/usr/local/bin:/usr/local/sbin:/opt/local/bin:/opt/local/sbin" | ||
|
||
preMANPATH="/usr/local/mysql/man:/usr/local/git/man:/usr/local/man:/opt/local/man" | ||
|
||
postMANPATH="$HOME/man:$HOME/.rvm/man" | ||
|
||
# # Note on $MANPATH, $extraMANPATH | ||
# # we don't want to set $MANPATH if the system/user is using another | ||
# # mechanism to find man pages (e.g. manpath(1) on ubuntu or freebsd), | ||
# # because setting MANPATH could clobber that mechanism. | ||
# # manpath(1) will use $PATH to find man pages; for the most | ||
# # part, if you add something to [pre|post]PATH, then manpath(1) will | ||
# # pick up your corresponding man pages. | ||
|
||
|
||
# ## | ||
# ## Function definitions | ||
# ## | ||
|
||
list_contains () { | ||
eval p=\$$1 | ||
for dir in $p | ||
do | ||
if [ "$dir" == "$2" ]; then | ||
return 0 | ||
fi | ||
done | ||
return 1 | ||
} | ||
|
||
prepend_to_listvar () { | ||
if [ -d $2 ] && ! ( list_contains "$1" "$2" ) ; then | ||
eval "$1=$2${IFS:0:1}\$$1" | ||
fi | ||
} | ||
|
||
append_to_listvar () { | ||
if [ -d $2 ] && ! ( list_contains "$1" "$2" ) ; then | ||
eval "$1=\$$1${IFS:0:1}$2" | ||
fi | ||
} | ||
|
||
reverse_list () { | ||
rev=$1 | ||
shift | ||
while [ $1 ] | ||
do | ||
rev=$1${IFS:0:1}$rev | ||
shift | ||
done | ||
echo -n "$rev" | ||
} | ||
|
||
# ## | ||
# ## End function definitions | ||
# ## | ||
|
||
# # we're going to work with paths separated by ":" instead of whitespace | ||
IFS=: | ||
|
||
for dir in $( reverse_list $prePATH ) | ||
do | ||
prepend_to_listvar PATH "$dir" | ||
done | ||
|
||
for dir in $postPATH | ||
do | ||
append_to_listvar PATH "$dir" | ||
done | ||
|
||
if [ -n "$MANPATH" ]; then | ||
for dir in $( reverse_list $preMANPATH ) | ||
do | ||
prepend_to_listvar MANPATH "$dir" | ||
done | ||
for dir in $postMANPATH | ||
do | ||
append_to_listvar MANPATH "$dir" | ||
done | ||
export MANPATH | ||
fi | ||
|
||
# # put IFS back | ||
unset IFS | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# -*- sh -*- | ||
|
||
# set TERM correctly if we're in Ubuntu's default graphical terminal app, | ||
# (gnome-terminal, in Ubuntu 12.04) | ||
if [[ ($TERM == "xterm") && ($COLORTERM == "gnome-terminal") ]]; then | ||
TERM=gnome-256color | ||
fi | ||
|
||
# Fix GNU screen's 256-color terminal setttings | ||
# the presence of $STY is the most reliable way to detect when we're | ||
# running inside screen. note TERMCAP is not the same as TERM | ||
if [ $STY ]; then | ||
# we're running inside GNU screen... | ||
if [ -n "$TERMCAP" ]; then | ||
# ...where the $TERMCAP screen sets is wrong for 256-color terminals... | ||
if (( `expr "$TERM" : '.*256col'` )); then | ||
# ...so we blow it away, assuming either the system-wide | ||
# termcap will have something better, or we have | ||
# taken advantage of $TERMPATH and/or .termcap, or | ||
# we'll be setting $TERMCAP ourselves after this | ||
unset TERMCAP | ||
fi | ||
fi | ||
fi |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.