08fcf7dc393d6254fdcd7eef26d3f4ddd1c53a6c

Author
Toon Claes <toon@tonotdo.com>
Committer
Toon Claes <toon@tonotdo.com>
Date

Message

Enabled colors in ls and made it possible to theme them

Diff

 1diff --git a/lib/aliases.zsh b/lib/aliases.zsh
 2index c3a6cf0735469c859ba83639dddacdb4d6b217ff..88d68e1426b356e7ed52b304125f2773181368b7 100644
 3--- a/lib/aliases.zsh
 4+++ b/lib/aliases.zsh
 5@@ -45,8 +45,7 @@ alias gcp='git cherry-pick'
 6 alias history='fc -l 1'
 7 
 8 # List direcory contents
 9-alias ls='ls -F -G'
10-alias lsa='ls -lahG'
11+alias lsa='ls -lah'
12 alias l='ls -la'
13 alias ll='ls -alr'
14 alias sl=ls # often screw this up
15diff --git a/lib/appearance.zsh b/lib/appearance.zsh
16index b1f5a8a387a1566d73719ef8da45a90c98b1f1e3..c9bd25d818371999e7bc9786fd296010c3daba2e 100644
17--- a/lib/appearance.zsh
18+++ b/lib/appearance.zsh
19@@ -1,6 +1,13 @@
20-# Colors
21+# ls colors
22 autoload colors; colors;
23 export LSCOLORS="Gxfxcxdxbxegedabagacad"
24+#export LS_COLORS
25+
26+# Enable ls colors
27+if [ "$DISABLE_LS_COLORS" != "true" ] then
28+  # Find the option for using colors in ls, depending on the version: Linux or BSD
29+  ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
30+fi
31 
32 #setopt no_beep
33 setopt auto_cd
34@@ -18,14 +25,10 @@ fi
35 PS1="%n@%m:%~%# "
36 
37 # git theming default: Variables for theming the git info prompt
38-# ZSH_THEME_GIT_PROMPT_PREFIX - Prefix at the very beginning of the prompt, before the branch name
39-ZSH_THEME_GIT_PROMPT_PREFIX="git:("
40-# ZSH_THEME_GIT_PROMPT_SUFFIX - At the very end of the prompt
41-ZSH_THEME_GIT_PROMPT_SUFFIX=")"
42-# ZSH_THEME_GIT_PROMPT_DIRTY  - Text to display if the branch is dirty
43-ZSH_THEME_GIT_PROMPT_DIRTY="*"
44-# ZSH_THEME_GIT_PROMPT_CLEAN  - Text to display if the branch is clean
45-ZSH_THEME_GIT_PROMPT_CLEAN=""
46+ZSH_THEME_GIT_PROMPT_PREFIX="git:("         # Prefix at the very beginning of the prompt, before the branch name
47+ZSH_THEME_GIT_PROMPT_SUFFIX=")"             # At the very end of the prompt
48+ZSH_THEME_GIT_PROMPT_DIRTY="*"              # Text to display if the branch is dirty
49+ZSH_THEME_GIT_PROMPT_CLEAN=""               # Text to display if the branch is clean
50 
51 # Setup the prompt with pretty colors
52 setopt prompt_subst
53diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template
54index 7c43303bd375d293df12009ba1d861a0055f4c26..d905be04b2205797cfef2e0036d5163507ec1f81 100644
55--- a/templates/zshrc.zsh-template
56+++ b/templates/zshrc.zsh-template
57@@ -9,7 +9,10 @@ export ZSH_THEME="robbyrussell"
58 # export CASE_SENSITIVE="true"
59 
60 # Comment this out to disable weekly auto-update checks
61-# export DISABLE_AUTO_UPDATE="false"
62+# export DISABLE_AUTO_UPDATE="true"
63+
64+# Uncomment following line if you want to disable colors in ls
65+# export DISABLE_LS_COLORS="true"
66 
67 source $ZSH/oh-my-zsh.sh
68