Add alias for colors in ls and gcc commands
David Blume

David Blume commited on 2016-01-10 10:58:02
Showing 2 changed files, with 14 additions and 7 deletions.

... ...
@@ -24,14 +24,20 @@ fi
24 24
 # change the color of directories in the ls command 
25 25
 #
26 26
 # After executing: dircolors -p > .dircolors
27
-# And changing the following line in .dircolors:
28
-# DIR 00;36 # directory
29
-if [ "$TERM" != "dumb" ]; then
30
-    [ -e "$HOME/.dircolors" ] && DIR_COLORS="$HOME/.dircolors"
31
-    [ -e "$DIR_COLORS" ] || DIR_COLORS=""
32
-    eval "`dircolors -b $DIR_COLORS`"
27
+# Lighten the color of directories from blue to light blue
28
+# sed -i '/# directory/c\DIR 00;36 # directory' .dircolors
29
+if [ -x /usr/bin/dircolors ]; then
30
+    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
31
+    alias ls='ls --color=auto'
33 32
 fi
34 33
 
34
+alias grep='grep --color=auto'
35
+alias fgrep='fgrep --color=auto'
36
+alias egrep='egrep --color=auto'
37
+
38
+# colored GCC warnings and errors
39
+export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
40
+
35 41
 # Add to PATH only if not already in PATH.
36 42
 add_to_path $HOME/bin
37 43
 
... ...
@@ -51,7 +51,8 @@ See [config.dlma.com](http://config.dlma.com) for more.
51 51
 
52 52
 #### What's not installed
53 53
 
54
-1. Private data like keys, get those from the USB4 bioport in the back of your neck.
54
+1. .dircolors (There are instructions in .bashrc to lighten the color of directories.)
55
+2. Private data like keys, get those from the USB4 bioport in the back of your neck.
55 56
 
56 57
 ### Is it any good?
57 58
 
58 59