Changing prompt

Glenn Dawson glenn at antimatter.net
Tue Mar 28 11:00:11 UTC 2006


At 02:29 AM 3/28/2006, Vaaf wrote:
>At 12:24 28.03.2006, Rodrigo G. Tavares de Souza wrote:
>>Hi,
>>
>>   How could I show the path on prompt or see colored files when I 
>> make a ls command?
>>
>>Best Regards,
>>Rodrigo Souza
>>Sao Paulo - Brazil
>>_______________________________________________
>>freebsd-questions at freebsd.org mailing list
>>http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>>To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
>
>Try to install /usr/ports/shells/zsh, and use this as your /etc/zshrc:
>
>###  BEGIN
>
>umask 022
>
>alias vi='vim'
>alias j='jobs -l'
>alias h='history'
>alias ls='ls -G'
>alias cd..='cd ..'
>alias cd...='cd ../..'
>alias cd....='cd ../../..'
>alias cd.....='cd ../../../..'
>alias cd......='cd ../../../../..'
>alias cd/='cd /'
>alias wf='w -f'
>alias ws='w -s'
>alias df='df -h'
>alias ftp='lftp'
>alias pfdump='tcpdump -n -e -ttt -r /var/log/pflog'
>alias pfmonitor='tcpdump -n -e -ttt -i pflog0'
>alias pfreload='pfctl -F all && pfctl -f /etc/pf.conf'
>alias pfshow='pfctl -vvsr'
>
>autoload -U compinit
>compinit -C
>
>zstyle ':completion:*' completer _complete _prefix
>zstyle ':completion::prefix-1:*' completer _complete
>zstyle ':completion:incremental:*' completer _complete _correct
>zstyle ':completion:predict:*' completer _complete
>zstyle ':completion::complete:*' use-cache 1
>zstyle ':completion::complete:*' cache-path ~/.zsh/cache/$HOST
>zstyle ':completion:*' expand 'yes'
>zstyle ':completion:*' squeeze-slashes 'yes'
>zstyle ':completion::complete:*' '\'
>zstyle ':completion::complete:*:tar:directories' file-patterns '*~.*(-/)'
>zstyle ':completion:*:complete:-command-::commands' ignored-patterns '*\~'
>zstyle ':completion:*:matches' group 'yes'
>zstyle ':completion:*:options' description 'yes'
>zstyle ':completion:*:options' auto-description '%d'
>zstyle ':completion:*:history-words' stop verbose
>zstyle ':completion:*:history-words' remove-all-dups yes
>zstyle ':completion:*:history-words' list false
>zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
>
>PROMPT=$'%{\e[01;36m%}(%{\e[22;36m%}%n%{\e[01;30m%}@'
>PROMPT+=$'%{\e[22;36m%}%m%{\e[01;36m%})%{\e[01;36m%}%{\e[01;36m%}('
>PROMPT+=$'%{\e[22;36m%}%D{%H:%M}%{\e[01;30m%}+%{\e[22;36m%}%D{%m/%d/%y}'
>PROMPT+=$'%{\e[01;36m%})%{\e[01;30m\e[00m%}\n%{\e[01;36m%}('
>PROMPT+=$'%{\e[22;36m%}%#%{\e[01;30m%}:%{\e[22;36m%}%~%{\e[01;36m%})'
>PROMPT+=$'%{\e[01;30m\e[00m%} '
>
>if [[ `whoami` = root ]] then
>         PROMPT=$'%{\e[01;31m%}(%{\e[22;31m%}%n%{\e[01;30m%}@'
>         PROMPT+=$'%{\e[22;31m%}%m%{\e[01;31m%})%{\e[01;31m%}%{\e[01;31m%}('
> 
>PROMPT+=$'%{\e[22;31m%}%D{%H:%M}%{\e[01;30m%}+%{\e[22;31m%}%D{%m/%d/%y}'
>         PROMPT+=$'%{\e[01;31m%})%{\e[01;30m\e[00m%}\n%{\e[01;31m%}('
>         PROMPT+=$'%{\e[22;31m%}%#%{\e[01;30m%}:%{\e[22;31m%}%~%{\e[01;31m%})'
>         PROMPT+=$'%{\e[01;30m\e[00m%} '
>fi
>
>###  END
>
>This is truly a beautiful prompt.

Yikes.

If you're using /bin/csh that comes with FreeBSD, the following will 
do what you asked about:

set prompt="%/ "
setenv CLICOLOR

For more info, see the prompt variable in the csh(1) man page, and 
the environment section of the ls(1) man page.

-Glenn


>Enjoy,
>Vaaf
>
>_______________________________________________
>freebsd-questions at freebsd.org mailing list
>http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"



More information about the freebsd-questions mailing list