## -*- mode:sh -*- # ################################################################################ ## Shell Config -- Main ## Date 2012-07-27 ################################################################################ ## Mask ## Result for 027 is: rwxr-x--- umask 027 ## Path ## WARNING: putting current dir '.' in PATH is mostly a bad idea! # export PATH=.:$PATH ## TeXlive TEXDIR="${TEXDIR:-/usr/local/texlive}" if [ -d "${TEXDIR}" ]; then TEXYEAR=$(/bin/ls -1r "${TEXDIR}" | grep -m1 "[0-9]\{4\}") TEXDISTRO=$(uname -m)-$(uname | tr "[[:upper:]]" "[[:lower:]]") TEXFOLDER="${TEXDIR}/${TEXYEAR}/bin/${TEXDISTRO}/" if [ -d "${TEXFOLDER}" ]; then export PATH=${TEXFOLDER}:$PATH export INFOPATH=${TEXDIR}/${TEXYEAR}/texmf/doc/info:$INFOPATH ## BSD uses 'manpath' utility, so MANPATH variable may be empty. if [ "$OSTYPE" = "linux-gnu" ]; then export MANPATH=${TEXDIR}/${TEXYEAR}/texmf/doc/man:$MANPATH fi fi unset TEXYEAR unset TEXDISTRO unset TEXFOLDER fi unset TEXDIR ## Enable color support of ls. if [ "$TERM" != "dumb" ] && [ "$OSTYPE" = "linux-gnu" ]; then eval "`dircolors $HOME/.shell.d/dircolorsdb`" elif [ "$TERM" != "dumb" ]; then export LSCOLORS="Ex" # export LSCOLORS="ExfxcxDxCxdxdxCxCxECEh" fi ## Terminal ## WARNING: this is always a bad idea! ## TODO: check how to do this properly. if [ ! "$OSTYPE" = "linux-gnu" ] && [[ "$TERM" = *rxvt* ]]; then export TERM="rxvt-unicode-256color" fi ## Make 'less' more friendly for non-text input files, see lesspipe(1). [ -x /usr/bin/lesspipe ] && eval "$(lesspipe)" ## Manpage. export MANPAGER="less -s" ## The following options are useful for FreeBSD default 'less' command which has ## an empty prompt. Sadly this gets messy with 'apropos'. # export MANPAGER="less -sP '?f%f .?m(file %i of %m) .?ltlines %lt-%lb?L/%L. .byte %bB?s/%s. ?e(END) :?pB%pB\%..%t'" export MANWIDTH=80 ## Less config. -R is needed for lesspipe. export LESS=' -R ' ## Time display (with ls command for example) ## TODO: BSD version? export TIME_STYLE=+"|%Y-%m-%d %H:%M:%S|" ## System locale # export LC_MESSAGES=fr_FR.utf8 ## Default text editor EDITOR=nano if [ -n "$(command -v vim)" ]; then EDITOR=vim fi if [ -n "$(command -v emacs)" ]; then EDITOR='emacsclient -a "" -t' fi export EDITOR ## Internet Browser type dwb > /dev/null [ $? ] && export BROWSER="dwb" ## Title ## If this is an xterm set the title to user@host:dir #case "$TERM" in #xterm*|rxvt*) # PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"' # ;; #*) # ;; #esac