7b12a8e586b379cf7946b1a8e2b2091555e297a1
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 New PS1 with error detectio...

David Blume authored 6 years ago

7) if [[ -n $SSH_CLIENT ]]; then
David Blume Darken the prompt a little.

David Blume authored 6 years ago

8)     export PS1='\[\e[48;5;$((!!$?*36+16));38;5;242m\]\h:\W$\[\e[0m\] '
David Blume New PS1 with error detectio...

David Blume authored 6 years ago

9) else
David Blume Darken the prompt a little.

David Blume authored 6 years ago

10)     export PS1='\[\e[48;5;$((!!$?*36+16));38;5;242m\]\W$\[\e[0m\] '
David Blume New PS1 with error detectio...

David Blume authored 6 years ago

11) fi
12) 
13) set -o vi
David Blume first commit

David Blume authored 8 years ago

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

David Blume authored 8 years ago

26)     PATH=/usr/local/bin:/usr/bin:$PATH
27)     PATH=${PATH//":/usr/local/bin:/usr/bin"/} # delete any instances in middle
28)     add_to_path /usr/lib/lapack
29)     ulimit -n 1024 # for "duplicity"
David Blume first commit

David Blume authored 8 years ago

30) fi
31) 
32) # change the color of directories in the ls command 
David Blume Refactor .bashrc to keep di...

David Blume authored 8 years ago

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

David Blume authored 8 years ago

44) fi
45) 
David Blume Add .vimrc tab values for ....

David Blume authored 7 years ago

46) export P4DIFF='vim -d'  # Override from the command line: "P4DIFF=; p4 diff main.py"
David Blume Set vim as editor for cscope

David Blume authored 6 years ago

47) export CSCOPE_EDITOR=vim
David Blume Add .vimrc tab values for ....

David Blume authored 7 years ago

48) 
David Blume Add alias for colors in ls...

David Blume authored 8 years ago

49) alias grep='grep --color=auto'
50) alias fgrep='fgrep --color=auto'
51) alias egrep='egrep --color=auto'
52) 
53) # colored GCC warnings and errors
54) export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
55) 
David Blume first commit

David Blume authored 8 years ago

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

David Blume authored 8 years ago

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

David Blume authored 7 years ago

65) 
David Blume Add alias for httpie https

David Blume authored 6 years ago

66) # For httpie: https://github.com/jakubroztocil/httpie#installation
67) alias https='http --default-scheme=https'
68) 
David Blume Forgot a corresponding chan...

David Blume authored 7 years ago

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

David Blume authored 7 years ago

70)     source $HOME/.localrc