bashrc

This is a copy of my .bashrc, mostly for my reference from different machines.


# Brian Okken

# prompt & titlebar
#
# titlebar: \[\033]0;\u@\h: \w\007\]
# that puts user, machine name, and directory in the title bar of my
# bash window
#
# prompt: bash>
# the rest of it is what I want to shop up as a prompt
#
PS1="\[\033]0;\u@\h: \w\007\]bash> "

# modify the path
oldpath=$PATH
PATH=.:$HOME/scripts
PATH=${PATH}:/cygdrive/c/cygwin/bin
PATH=${PATH}:/usr/local/bin
PATH=${PATH}:/cygdrive/c/apps/cscope/cscope
PATH=${PATH}:${oldpath}

# editor
VISUAL=gvim
EDITOR=gvim
WINEDITOR=gvim
PYTOOLS_EDIT=gvim

# colors for ls
# 30 gray, 31 red, 32, green, 33 yellow, 34 blue, 35 magenta, 36 light blue
export LS_COLORS="di=1;35"

# mostly, just set up a reasonable vi command mode for the shell
set -o vi -o monitor -o ignoreeof

# Set up aliases
alias ls='ls --color=auto'
alias rm='rm -i'
alias rme='rm *~'
alias h=history
alias grep=egrep
alias ll='ls -l'
alias la='ls -a'
alias mkw='chmod a+w'
alias mk-w='chmod a-w'

# some extras
alias whence='type -a'
alias huh='type -a'
alias c:='cd /cygdrive/c'
alias vi='vim'

# aliases for more
alias mroe='more'
alias moer='more'
alias meor='more'

# aliases for snapshotCM
alias co='wco -l -t "" '
alias unco='wco -u '
alias uncof='wco -u -f '
alias ci='wci '

# ---- functions --------

# selectdir : used by mcd
function selectdir
{
DRIVE='/cygdrive/c'
dirs=(
wamp/www/journal
wamp/www/codetrack
'Documents and Settings/briano/'
'Documents and Settings/briano/scripts' )

PS3='Select by number or enter a name: '
select dir in "${dirs[@]}"
do
echo "${DRIVE}/${dir}"
return
done
}

# mcd: quick cd function for common directories
function mcd
{
dir="$(selectdir)"
cd "${dir}"
echo "---- $dir ---"
}

No comments yet.

Leave a Reply