cat ~/.bashrc
(...)
alias ls='ls --color -lhXp --group-directories-first'
alias cc='cc -Wall -g'
alias gcc='gcc -Wall -g'
alias rm='rm -i'
alias mv='mv -i'
alias cp='cp -i'
alias grep='grep --color'
alias diff='colordiff'
function svndiff () { svn diff $@ | colordiff; } #'colorizar' diffs do svn
alias less='less -R'
alias mp3br='for i in *.mp3; do mp3info -p "%r KB/s %f\n" "$i"; done'
alias MP3br='for i in *.MP3; do mp3info -p "%f: %r KB/s \n" "$i"; done'
(...)
PS1="[\t] "$PS1 #Indicação das horas, entre parêntesis rectos
# cores para manpages com o less
export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[31m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;44;33m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[04;32m'
# comando para mostrar a vermelho linhas impressas no stderr
colerr () {
$@ 2> >(while line=$(line); do echo -e "\e[01;31m$line\e[0m"; done)
}
Referências:
less colors for manpages by Nico Golde
Bash Prompt HOWTO: 6. ANSI Escape Sequences: Colours and Cursor Movement
code | less - Viewing svn diff result in colors - Comments.
1 comentário:
usei o teu exemplo e tenho ainda o seguinte:
PS1='\[\e[0;31m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[0;31m\]\$ \[\e[m\]\[\e[0;32m\]'
if [ "$TERM" != "dumb" ]; then
eval "`dircolors -b`"
alias ls='ls --color=auto'
alias dir='ls --color=auto --format=vertical'
alias vdir='ls --color=auto --format=long'
alias grep='grep --color=auto'
fi
alias uscriptkill='for process in $(ps -U uscripts -u uscripts u|cut -d " " -f2-3); do kill -9 $process; done'
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
# go further back in history defining the size:
HISTSIZE=100000
HISTFILESIZE=100000
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
;;
*)
;;
esac
# cores para manpages com o less
export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[31m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;44;33m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[04;32m'
Enviar um comentário