7d27ba760703a93cb7ff2bd3a155457db595ec85
David Blume Fixed when /etc bashrc gets...

David Blume authored 8 years ago

1) if [[ $(uname -s) != Darwin* ]] && [ -f /etc/bashrc ]; then
2)     # Fedora but not Macintosh requires explicit sourcing of /etc/bashrc
3)     # On Debian, it's /etc/bash.bashrc, but it doesn't have to be sourced here.
4)     . /etc/bashrc
5) fi
6) 
David Blume Add hostname to the shell p...

David Blume authored 8 years ago

7) export PS1="\h:\W\$ "
David Blume first commit

David Blume authored 8 years ago

8) 
9) add_to_path() {
10)     if [ -d "$1" ] && [[ ! $PATH =~ (^|:)$1(:|$) ]]; then
11)         PATH+=:$1
12)     fi
13) }
14) 
15) # if this is a CygWin .bashrc, then set CygWin's commands first in PATH
16) # because link.exe and find.exe exist in Windows's path.
17) # Add /usr/lib/lapack at the end so python's numpy can find lapack_lite
18) # (Note: BSD bash, used by OS X doesn't have the "substr" test for expr.)
19) if [[ $(uname -s) == CYGWIN* ]]; then
David Blume Use spaces instead of tabs.

David Blume authored 8 years ago

20)     PATH=/usr/local/bin:/usr/bin:$PATH
21)     PATH=${PATH//":/usr/local/bin:/usr/bin"/} # delete any instances in middle
22)     add_to_path /usr/lib/lapack
23)     ulimit -n 1024 # for "duplicity"
David Blume first commit

David Blume authored 8 years ago

24) fi
25) 
26) # change the color of directories in the ls command 
David Blume Refactor .bashrc to keep di...

David Blume authored 8 years ago

27) if [[ $(uname -s) == Darwin* ]]; then
28)     export LSCOLORS=gxfxcxdxbxegedabagacad
29)     export CLICOLOR=1
30) else
31)     # After executing: dircolors -p > .dircolors
32)     # Lighten the color of directories from blue to light blue
33)     # sed -i '/# directory/c\DIR 00;36 # directory' .dircolors
34)     if [ -x /usr/bin/dircolors ]; then
35)         test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
36)         alias ls='ls --color=auto'
37)     fi
David Blume first commit

David Blume authored 8 years ago

38) fi
39) 
David Blume Add .vimrc tab values for ....

David Blume authored 7 years ago

40) export P4DIFF='vim -d'  # Override from the command line: "P4DIFF=; p4 diff main.py"
41) 
David Blume Add alias for colors in ls...

David Blume authored 8 years ago

42) alias grep='grep --color=auto'
43) alias fgrep='fgrep --color=auto'
44) alias egrep='egrep --color=auto'
45) 
46) # colored GCC warnings and errors
47) export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
48) 
David Blume first commit

David Blume authored 8 years ago

49) # Add to PATH only if not already in PATH.
50) add_to_path $HOME/bin
51) 
52) alias findinpyfiles="find . -name \*.py -print0 | xargs -0 grep -nI"
David Blume Add a few c++ aliases, and...

David Blume authored 8 years ago

53) alias findinchppfiles="find . -type f \( -name \*.[ch]pp -or -name \*.[ch] \) -print0 | xargs -0 grep -nI"
54) alias findincppfiles="find . -type f \( -name \*.cpp -or -name \*.c \) -print0 | xargs -0 grep -nI"
55) alias findinhppfiles="find . -type f \( -name \*.hpp -or -name \*.h \) -print0 | xargs -0 grep -nI"
56) 
57) alias clip="expand | cut -b1-\$COLUMNS"
David Blume Optionally source a .localr...

David Blume authored 7 years ago

58) 
David Blume Forgot a corresponding chan...

David Blume authored 7 years ago

59) if [ -f $HOME/.localrc ]; then
David Blume Specify path for .localrc

David Blume authored 7 years ago

60)     source $HOME/.localrc