Mercurial > ec-dotfiles
view rc/bash @ 252:4fe8668e3ef0
Awesome custom paths by default.
author | Edho Arief <edho@myconan.net> |
---|---|
date | Mon, 14 Nov 2011 11:02:47 +0300 |
parents | 4a8d81743728 |
children | e6de49d70fe7 |
line wrap: on
line source
#!/usr/bin/env bash case "${-}" in *i*) ;; *) return;; esac if [ "${ECOS_BASH_LOADED}" != "yes" ]; then ECOS_BASH_LOADED="yes" else return fi [ -f "${HOME}/.ecos_bash.before" ] && . "${HOME}/.ecos_bash.before" _org_path="${PATH}" export PATH="${HOME}/.ecos_bin:${HOME}/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" # Custom application I usually install and safe to prioritize for i in {"${HOME}/app","/opt"}/{tmux,ruby19,node,tarsnap,symon,nginx}/{bin,sbin}; do [ -d "${i}" ] && PATH="${i}:${PATH}" done case "${TERM}" in xterm*|dtterm*|screen*) PS1='[\[\e[0;33m\]\u\[\e[0m\]@\[\e[0;32m\]\h\[\e[0m\] \[\e[1;34m\]\W\[\e[0m\]]\$ ' ;; *) PS1='[\u@\h \W]\$ ' ;; esac shopt -s histappend PROMPT_COMMAND='history -a' export HISTFILESIZE=10000 export HISTCONTROL=ignoredups export PAGER="less -Rins" export EDITOR=vi export LANG="en_US.UTF-8" unset LS_COLORS alias less="less -Rins" #assuming POSIX grep alias fgrep="grep -F" alias egrep="grep -E" alias ls="ls -F" alias rm="rm -i" alias rd="rdesktop -g 1280x600 -K -a 16 -z -P -r sound:off -r clipboard:CLIPBOARD -5" _has_rm_I= _has_gnu_ls= _has_gnu_grep= _ls="ls" case "$(uname -s)" in Linux) _has_rm_I=y _has_gnu_ls=y _has_gnu_grep=y ;; SunOS) [ -x /usr/gnu/bin/rm ] && _has_rm_I=y [ -x /usr/gnu/bin/ls ] && _has_gnu_ls=y [ -x /usr/gnu/bin/grep ] && _has_gnu_grep=y [ -d /opt/csw/bin ] && PATH="/opt/csw/bin:${PATH}" [ -d /opt/csw/sbin ] && PATH="/opt/csw/sbin:${PATH}" [ -d /usr/gnu/bin ] && PATH="/usr/gnu/bin:${PATH}" [ -d /usr/sfw/bin ] && PATH="${PATH}:/usr/sfw/bin" [ -d /usr/xpg4/bin ] && PATH="${PATH}:/usr/xpg4/bin" export PATH alias ping="ping -s" alias ping6="ping -A inet6" ;; FreeBSD) _has_rm_I=y export CLICOLOR= export LSCOLORS=ExGxFxdxCxegedabagExEx ;; OpenBSD) if command -v gls > /dev/null 2>&1; then _has_gnu_ls=y _ls="gls" elif command -v colorls > /dev/null 2>&1; then export CLICOLOR= export LSCOLORS=ExGxFxdxCxegedabagExEx alias ls='colorls -F' fi ;; NetBSD) export PATH="${PATH}:/usr/pkg/bin:/usr/pkg/sbin" if command -v gls > /dev/null 2>&1; then _has_gnu_ls=y _ls="gls" elif command -v colorls > /dev/null 2>&1; then export CLICOLOR= export LSCOLORS=ExGxFxdxCxegedabagExEx alias ls='colorls -F' fi ;; CYGWIN*) export PATH="${PATH}:${_org_path}" ;; esac [ "${_has_rm_I}" = y ] && alias rm="rm -I" [ "${_has_gnu_ls}" = y ] && alias ls="${_ls} -F --color=auto" [ "${_has_gnu_grep}" = y ] && alias grep="grep --color=auto" unset _has_rm_I unset _has_gnu_ls unset _has_gnu_grep unset _ls case "${TERM}" in xterm*|screen*|dtterm) PROMPT_COMMAND='echo -ne "\033]0;${LOGNAME}@${HOSTNAME}: ${PWD}\007";'"${PROMPT_COMMAND}" ;; esac if command -v vim > /dev/null 2>&1; then alias vi=vim export EDITOR=vim fi [ -f "${HOME}/.ecos_bash.after" ] && . "${HOME}/.ecos_bash.after"