Browse code

Enabled colors in ls and made it possible to theme them

Toon Claes authored on 05/11/2009 at 19:44:28
Showing 3 changed files
... ...
@@ -45,8 +45,7 @@ alias gcp='git cherry-pick'
45 45
 alias history='fc -l 1'
46 46
 
47 47
 # List direcory contents
48
-alias ls='ls -F -G'
49
-alias lsa='ls -lahG'
48
+alias lsa='ls -lah'
50 49
 alias l='ls -la'
51 50
 alias ll='ls -alr'
52 51
 alias sl=ls # often screw this up
... ...
@@ -1,6 +1,13 @@
1
-# Colors
1
+# ls colors
2 2
 autoload colors; colors;
3 3
 export LSCOLORS="Gxfxcxdxbxegedabagacad"
4
+#export LS_COLORS
5
+
6
+# Enable ls colors
7
+if [ "$DISABLE_LS_COLORS" != "true" ] then
8
+  # Find the option for using colors in ls, depending on the version: Linux or BSD
9
+  ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
10
+fi
4 11
 
5 12
 #setopt no_beep
6 13
 setopt auto_cd
... ...
@@ -18,14 +25,10 @@ fi
18 18
 PS1="%n@%m:%~%# "
19 19
 
20 20
 # git theming default: Variables for theming the git info prompt
21
-# ZSH_THEME_GIT_PROMPT_PREFIX - Prefix at the very beginning of the prompt, before the branch name
22
-ZSH_THEME_GIT_PROMPT_PREFIX="git:("
23
-# ZSH_THEME_GIT_PROMPT_SUFFIX - At the very end of the prompt
24
-ZSH_THEME_GIT_PROMPT_SUFFIX=")"
25
-# ZSH_THEME_GIT_PROMPT_DIRTY  - Text to display if the branch is dirty
26
-ZSH_THEME_GIT_PROMPT_DIRTY="*"
27
-# ZSH_THEME_GIT_PROMPT_CLEAN  - Text to display if the branch is clean
28
-ZSH_THEME_GIT_PROMPT_CLEAN=""
21
+ZSH_THEME_GIT_PROMPT_PREFIX="git:("         # Prefix at the very beginning of the prompt, before the branch name
22
+ZSH_THEME_GIT_PROMPT_SUFFIX=")"             # At the very end of the prompt
23
+ZSH_THEME_GIT_PROMPT_DIRTY="*"              # Text to display if the branch is dirty
24
+ZSH_THEME_GIT_PROMPT_CLEAN=""               # Text to display if the branch is clean
29 25
 
30 26
 # Setup the prompt with pretty colors
31 27
 setopt prompt_subst
... ...
@@ -9,7 +9,10 @@ export ZSH_THEME="robbyrussell"
9 9
 # export CASE_SENSITIVE="true"
10 10
 
11 11
 # Comment this out to disable weekly auto-update checks
12
-# export DISABLE_AUTO_UPDATE="false"
12
+# export DISABLE_AUTO_UPDATE="true"
13
+
14
+# Uncomment following line if you want to disable colors in ls
15
+# export DISABLE_LS_COLORS="true"
13 16
 
14 17
 source $ZSH/oh-my-zsh.sh
15 18