You are not logged in.

#1 2010-12-11 16:49:42

Archie_Enthusiasm
Member
Registered: 2010-10-23
Posts: 99

[SOLVED]ZSH-Shell config .zshrc .dir_colors problem

Hello guys,

I am using zsh as my shell. Actually my color configuration within my zsh shell was (is) really cool :-) In the following you see the part in my .zshrc configuration file where the color scheme should be evaluated.

[Iam@Youare ~]$ cat .zshrc | grep .dir_colors

# colors for ls
if [[ -f ~/.dir_colors ]] ; then
    eval $(dircolors -b ~/.dir_colors)
elif [[ -f /etc/DIR_COLORS ]] ; then
    eval $(dircolors -b /etc/DIR_COLORS)
fi

And I do have .dir_colors file in my ~ folder. But my color configuration does not apply. what could be the reason? I use gnome terminal and start bash firstly in a normal way and then call zsh to be started. Once zsh started, this coloring scheme should be applied when I do for example "ls -al" etc... But it does not. I used this .zshrc configuration file with the .dir_colors file on Ubuntu last time. It was working fine. How can I have my zsh shell with sick color configuration work on archlinux?

Please help me.

What I have is:

1. .zshrc file in ~
2. .dir_colors file in ~
3. .histfile in ~

P.S.: .histfile is working fine. when I type history in zsh bash environment, it gives exactly the content of .histfile. Only my .dir_colors evaluation does not work.


THanks in advance. I am sure that there are some guys with extreme zsh config knowledge.

Last edited by Archie_Enthusiasm (2010-12-12 14:17:34)

Offline

#2 2010-12-11 16:55:32

Archie_Enthusiasm
Member
Registered: 2010-10-23
Posts: 99

Re: [SOLVED]ZSH-Shell config .zshrc .dir_colors problem

Edit:

I configured the gnome terminal by doing:

Edit -> Profile preferences -> Colors ->

Foreground Background Bold and Underline : Built-inSchemes Green on Black

Palette: Linux console

Could this be a reason? I changed them to Custom and/or also ticked that Use colors from system theme etc... But it did not work out.

I think this could have caused my zsh coloring not to work. Last time, when I was using opensuse, ubuntu, I remember that I did not do something manually. I just put the .zshrc file together with the .dir_colors and .histfile in my ~ folder. Once I invoked zsh from bash itself, it directly took the right configuration from zsh (meaning right color, command completion etc....)

Offline

#3 2010-12-11 18:44:01

Archie_Enthusiasm
Member
Registered: 2010-10-23
Posts: 99

Re: [SOLVED]ZSH-Shell config .zshrc .dir_colors problem

Edit:

Just wanted to say that on openSUSE terminal "Konsole", this my zsh shell was working fine without any configuration needed. (Just with the .zshrc .dir_colors)

Offline

#4 2010-12-11 20:08:03

Archie_Enthusiasm
Member
Registered: 2010-10-23
Posts: 99

Re: [SOLVED]ZSH-Shell config .zshrc .dir_colors problem

Guys, I am just posting my .zshrc file content if this can help.

# locales
export LC_ALL=""
export LC_COLLATE=C
export LANG=de_DE.UTF-8

# History
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000

# Options
setopt \
NO_all_export \
   always_last_prompt \
NO_always_to_end \
   append_history \
   auto_cd \
   auto_list \
   auto_menu \
NO_auto_name_dirs \
   auto_param_keys \
   auto_param_slash \
   auto_pushd \
   auto_remove_slash \
NO_auto_resume \
   bad_pattern \
   bang_hist \
NO_beep \
   brace_ccl \
   correct_all \
NO_bsd_echo \
   cdable_vars \
NO_chase_links \
NO_clobber \
   complete_aliases \
   complete_in_word \
   correct \
   correct_all \
   csh_junkie_history \
NO_csh_junkie_loops \
NO_csh_junkie_quotes \
NO_csh_null_glob \
NO_dvorak \
   equals \
   extended_glob \
   extended_history \
   function_argzero \
   glob \
NO_glob_assign \
   glob_complete \
   glob_dots \
   glob_subst \
   hash_cmds \
   hash_dirs \
   hash_list_all \
   hist_allow_clobber \
   hist_beep \
   hist_ignore_dups \
   hist_ignore_space \
NO_hist_no_store \
NO_hist_save_no_dups \
   hist_verify \
NO_hup \
NO_ignore_braces \
NO_ignore_eof \
   interactive_comments \
NO_list_ambiguous \
NO_list_beep \
   list_types \
   long_list_jobs \
   magic_equal_subst \
NO_mail_warning \
NO_mark_dirs \
   menu_complete \
   multios \
NO_nomatch \
   notify \
NO_null_glob \
   numeric_glob_sort \
NO_overstrike \
   path_dirs \
   posix_builtins \
NO_print_exit_value \
NO_prompt_cr \
   prompt_subst \
   pushd_ignore_dups \
NO_pushd_minus \
NO_pushd_silent \
   pushd_to_home \
   rc_expand_param \
NO_rc_quotes \
NO_rm_star_silent \
NO_sh_file_expansion \
   sh_option_letters \
   short_loops \
NO_sh_word_split \
NO_single_line_zle \
NO_sun_keyboard_hack \
   unset \
NO_verbose \
NO_xtrace \
   zle

# Completions
# Dauert einige Zeit zum Laden, ca. 0.5 sec.
autoload -U compinit ; compinit
# U.A. farbige Completion
zmodload -i zsh/complist
autoload -U colors
colors
zstyle :compinstall filename '~/.zshrc'
# Compliations for make ...
compile=(install clean remove uninstall deinstall)
compctl -k compile make
# cd & co.: only in directories
compctl -g '*(-/)' + -g '.*(/)' cd chdir dirs pushd rmdir dircmp cl
# tar & co.: only directorys and archives
compctl -g '*.(gz|z|Z|t[agp]z|tarZ|tz)' + -g '*(-/)' gunzip gzcat zcat
# Sound: Sounds + Playlists + directorys 
compctl -g '*.(mp3|MP3|ogg|OGG|temp|TEMP|m3u|pls)' + -g '*(-/)'  mpg123 xmms EP
# Browser: only HTML and dirs
compctl -g "*.html *.htm" + -g "*(-/) .*(-/)" + -H 0 '' w3m lynx elinks wget opera EL O
# xpdf: only PDFs and dirs
compctl -g '*.(pdf|PDF)' + -g '*(-/)'  xpdf pdf2ps
# pictures: only pics and dirs
compctl -g '*.(jpg|JPG|jpeg|JPEG|gif|GIF|png|PNG|bmp)' + -g '*(-/)' gimp xv display gqview
# xdvi: DVIs and dirs
compctl -g '*.dvi' + -g '*(-/)' dvips xdvi gxdvi
# lp und gv: PS-Files and dirs
compctl -g '*.ps' + -g '*(-/)' lp gv
# Maximal zwei Fehler pro Kommando.
# zstyle ':completion:*:correct:*' max-errors 2 numeric
# Fuegt den urspruenglich eingegebenen String auch als Completion auf.
zstyle ':completion:*:correct:*' original true
zstyle ':completion:*:correct:*' insert-unambiguous true # RTFM :P

# Welche Funktionen sollen zur Vervollstaendigung genutzt werden?
zstyle ':completion:*' completer _complete _correct _approximate
# Globbing
zstyle ':completion:*' glob true

# Verbose. Immer doch!
#zstyle ':completion:*' verbose yes
# Format der Corrections, Warnungen, etc.
zstyle ':completion:*:corrections' format $'%{\e[0;31m%}%d (errors: %e)%{\e[0m%}'
zstyle ':completion:*:descriptions' format $'%{\e[0;31m%}%d%{\e[0m%}'
zstyle ':completion:*:messages' format $'%{\e[0;31m%}%d%{\e[0m%}'
zstyle ':completion:*:warnings' format $'%{\e[0;31m%}No matches for: %d%{\e[0m%}'
zstyle ':completion:*' group-name ''
zstyle -e ':completion:*:approximate:*' max-errors 'reply=( $(( ($#PREFIX+$#SUFFIX)/3 )) numeric )'

zstyle ':completion:*' list-colors ''
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}

# Bei der Completion: Menü mit inversen aktiven Einträgen. Cool!
zstyle ':completion:*' menu yes=long-list
zstyle ':completion:*' menu select=2

# Completions für einige Programme:

# SSH - Erst User, dann Host.
zstyle ':completion:*:ssh:*' group-order 'users' 'hosts'
# rm - Reihenfolge: Erst Backupdateien, dann Bytecompiled Files,
# danach core-Files, erst dann restliche Dateien.
zstyle ':completion:*:*:rm:*' file-patterns '(*~|\\#*\\#):backup-files' '*.zwc:zsh\ bytecompiled\ files' 'core(|.*):core\ files' '*:all-files'
# kill - unglaubliche Completions!
zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
zstyle ':completion:*:kill:*' insert-ids single
zstyle ':completion:*:*:kill:*' menu yes select
zstyle ':completion:*:kill:*' force-list always
# less und mutt: Umfangreiches Menü.
zstyle ':completion:*:*:less:*' menu yes select
zstyle ':completion:*:*:mutt:*' menu yes select

# bindkey
bindkey -e
bindkey "\e[3~" delete-char
# Home- und End-Keys.
bindkey '\e[1~' beginning-of-line
bindkey '\e[4~' end-of-line
# 2005-02-27: Navigation im Completion-Menü. GENIAL!
# Navigation in der Completion-Liste (Tab-Tab): hjkl wählt aus, Return fügt ein
# und beendet das Menü (wobei es weiterhin angezeigt wird) und i fügt ein und
# lässt das Menü offen, um eine weitere Vervollständigung einzufügen.
# Die Befehle funktionieren nur, *nachdem* zsh/complist geladen wurde!
bindkey -M menuselect 'h' vi-backward-char                # links
bindkey -M menuselect 'j' vi-down-line-or-history         # unten
bindkey -M menuselect 'k' vi-up-line-or-history           # oben
bindkey -M menuselect 'l' vi-forward-char                 # rechts
# Fügt die Completion auf der Kommandozeile ein, lässt aber das Menü
# für eine Weitere Vervollständigung offen.
bindkey -M menuselect 'i' accept-and-menu-complete
# Fügt die Completion auf der Kommandozeile ein und zeigt dann ein
# Menü mit weiterhin möglichen Completions. "Engere Auswahl"
bindkey -M menuselect 'o' accept-and-infer-next-history

# envvars
umask 077
export COLORTERM=yes
export EDITOR=/usr/bin/vim
export PAGER=less
export LESS=aCeiM
export BROWSER=elinks
#export NNTPSERVER="news.task.gda.pl"
#export LS_COLORS='no=0:fi=0:di=32:ln=36:or=1;40:mi=1;40:pi=31:so=33:bd=44;37:cd=44;37:ex=35:*.jpg=1;32:*.jpeg=1;32:*.JPG=1;32:*.gif=1;32:*.png=1;32:*.jpeg=1;32:*.ppm=1;32:*.pgm=1;32:*.pbm=1;32:*.c=1;33:*.C=1;33:*.h=1;33:*.cc=1;33:*.awk=1;33:*.pl=1;33:*.bz2=1;35:*.gz=1;31:*.tar=1;31:*.zip=1;31:*.lha=1;31:*.lzh=1;31:*.arj=1;31:*.tgz=1;31:*.taz=1;31:*.html=1;34:*.htm=1;34:*.doc=1;34:*.txt=1;34:*.o=1;36:*.a=1;36:*.php3=1;31'
# path
export PATH=$PATH:/opt/bin:$HOME/bin

# Tetris!!
#autoload -U tetris
#zle -N tetris
#bindkey "^Xt" tetris ## C-x t to play

# Functions
function google () { $BROWSER "[url]http://www.google.com/search?q=$*[/url]"; }

# colors for ls
if [[ -f ~/.dir_colors ]] ; then
    eval $(dircolors -b ~/.dir_colors)
elif [[ -f /etc/DIR_COLORS ]] ; then
    eval $(dircolors -b /etc/DIR_COLORS)
fi

# Prompt
if [[ `whoami` == "root" ]]; then are_im_root="$fg[red]"; else; are_im_root="$fg[blue]"; fi
#if [[ "${DISPLAY#$HOST}" != ":0.0" &&  "${DISPLAY}" != ":0.0" ]]; then hostcolor="red"; else; hostcolor="green"; fi
if [[ "${${DISPLAY}#*:}" != "0.0" ]]; then hostcolor="yellow"; else; hostcolor="green"; fi

#export PS1="$fg[black]______________________________________________
#$fg[red]<<<$fg[white] %D{%d. %B %Y (%a)}  -  %D{%k:%M:%S}  -  $fg_bold[blue]%~ $fg[red] >>>
#$fg_bold[$hostcolor]%n@%m $are_im_root $terminfo[sgr0]"
export PS1="$fg[black]______________________________________________
$fg[red]<<<$fg[white] %D{%d. %B %Y (%a)}  -  %D{%k:%M:%S} $fg[red] >>> 
$fg_bold[$hostcolor]%n@%m  -  $fg_bold[blue]%~ $are_im_root%# $terminfo[sgr0] 
> "
export PS2="> "
#export RPS1="foo"
SPROMPT='zsh: korrigiere '%R' nach '%r'? ([Y]es/[N]o/[E]dit/[A]bort) '

# source them
[ -f ~/.alias/alias-general ] && source ~/.alias/alias-general
[ -f ~/.alias/alias-home ] && source ~/.alias/alias-home
[ -f ~/.alias/alias-autoliv ] && source ~/.alias/alias-autoliv
[ -f ~/.alias/alias-fs20 ] && source ~/.alias/alias-fs20

Last edited by Archie_Enthusiasm (2010-12-11 20:37:03)

Offline

#5 2010-12-11 20:13:29

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED]ZSH-Shell config .zshrc .dir_colors problem

Please don't bump your posts: https://wiki.archlinux.org/index.php/Fo … te#Bumping

And learn how to use the \[code\] tags


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2010-12-11 20:23:26

Archie_Enthusiasm
Member
Registered: 2010-10-23
Posts: 99

Re: [SOLVED]ZSH-Shell config .zshrc .dir_colors problem

"Do your own research, continue to troubleshoot, post the results, and be patient with the community. If people are reading your thread without answering or offering help, you may try supplying more details, or ask to be pointed in the right direction. Often, the reason for posts remaining unanswered is due in large part to the sparse details in the original post itself, or, the obvious availability of solutions in the wiki, on the forum (by using the search function) or on the web, and the community's unwillingness to point out the obvious. "

@Community:

Honestly, I do not want to violate any of the rules above. I just need my zsh shell as soon as possible. I need to do urgent work with it. (if this coloring configuration works fine, I will be able to work with vim with coloring scheme => The only environment for me to do coding)

Therefore, please do not understand it in a wrong way. Any kind of help would be welcome. I am checking my post continiously.

Thanks a million in advance!!!

Offline

#7 2010-12-12 18:05:39

o1911
Member
From: Hobart, Australia
Registered: 2009-04-28
Posts: 106

Re: [SOLVED]ZSH-Shell config .zshrc .dir_colors problem

Not sure if I'm answering your question, but have you tried an alias for ls or grep?  For instance, I have:

ls: ls -F --color=auto

I believe this is what default ubuntu shell rc files have by default, off the top of my head.  Of course, I'm sure you could customise the "auto" to something you would prefer.


Arch x86_64

Offline

Board footer

Powered by FluxBB