[ -z "$PS1" ] && return
if [ $(tty) = "/dev/tty1" ]; then
exec startx
fi
HISTFILE="$HOME/.cache/zsh_histfile"
HISTSIZE=10000
SAVEHIST=10000
setopt append_history hist_find_no_dups hist_ignore_all_dups hist_ignore_space
setopt hist_lex_words hist_reduce_blanks
bindkey "$key[Up]" history-beginning-search-backward
bindkey "$key[Down]" history-beginning-search-forward
bindkey "^r" history-incremental-search-backward
setopt beep
unsetopt nomatch # Descomentar: si el glob falla, deja la ER como literal
zstyle :compinstall filename '/home/draco/.zshrc'
autoload -Uz compinit
compinit
source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh
source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
case "$TERM" in
"xterm"*)
bindkey -s '\C-e' '\eOF &>/dev/null &!'
;;
"st"*)
bindkey -s '\C-e' '\e[4~ &>/dev/null &!'
;;
*)
bindkey -s '\C-e' '\eOF &>/dev/null &!'
;;
esac
autoload -z edit-command-line
zle -N edit-command-line
bindkey "^X^E" edit-command-line
vimode
bindkey -v '^?' backward-delete-char
autoload colors && colors
set -o PROMPT_SUBST
nhost=$(echo $HOST | md5sum | cut -d ' ' -f 1| tr a-z A-Z | bc)
nhost=$(echo $nhost "% 6 + 1" | bc)
CH=$(printf "\e[3%dm" $nhost)
fg[blink]="\e[$color[blink]m"
fg[noblink]="\e[$color[no_blink]m"
fg[bold]="\e[$color[bold]m"
fPS1(){
res=$?
if [ $res -eq 0 ]; then
res="^_^"
else
res="T_T"
fi
if [ $(whoami) = "root" ]; then
printf "%%{$fg[red]$fg[blink]%%}[ROOT☭]%%{$fg[noblink]%%}"
fi
printf "%%{$fg[bold]$fg[green]%%}(%%{$reset_color%%}${res}"
printf "%%{$fg[green]%%})~(%%{$reset_color%%}%%T"
printf "%%{$fg[green]%%}|%%{$reset_color%%}%%j"
printf "%%{$fg[green]%%}|%%{$CH%%}${HOST}%%{$fg[green]%%})"
printf "%%{$reset_color%%}%%~%%{$fg[green]%%}>"
printf "%%{$reset_color%%}\n~> "
}
PS1='$(fPS1)'
alias ls='ls --color=auto --time-style=posix-long-iso'
alias grep='grep --color=auto'
eval $(dircolors)
alias ll='ls -l -h'
alias la='ls -a'
export LESS="-j2 -R -i"
alias deltmp='rm -fr *~'
ntharg() {
shift $1
printf '%s\n' "$1"
}
rm(){
if [ "$(ntharg $# "$@")" = '-rf' ]; then
echo "Don't put '-rf' at the end!!"
return 1
else
/bin/rm -i "$@"
fi
}
alias rr='trash-put'
alias rr-put='trash-put'
alias rr-list='trash-list'
alias rr-rm='trash-rm'
alias rr-empty='trash-empty'
alias rr-restore='trash-restore'
export QUOTING_STYLE=literal
alias mv='mv --interactive'
alias cp='cp --interactive'
alias sudo='sudo -E'
alias mpv='mpv --no-audio-display'
alias yt='mpv --ytdl-format="bestvideo[height<=480]+bestaudio"'
alias mpvnv='mpv --ytdl-format="bestaudio" --no-video'
alias clima='curl -s "http://wttr.in/neuquen,neuquen?Q&2"'
alias cal="ncal -C"
alias feh="feh --force-aliasing"
waitN(){
[ $# -lt 1 ] && return 0;
while [ $(jobs |wc -l) -gt $1 ]; do
sleep 1;
done
}
wide() {
echo "$*" | toilet -f wideterm
}
dance(){
printf "(>'-')> "
sleep 0.5
printf "\r<('-'<) "
sleep 0.5
printf "\r^(' - ')^"
sleep 0.5
printf "\r<('-'<) "
sleep 0.5
printf "\r\n"
}
echo "GLaDOS 0.7.1b @ $HOST"
todo(){
TODOFILE=$HOME/todo.txt
if [ -e $TODOFILE ]; then
TODOFILE_CONT=$(cat $TODOFILE | grep -v -e '^#' -e '^$')
if [ $(echo "$TODOFILE_CONT" | wc -l) != '1' ]; then
echo "$TODOFILE_CONT" | /usr/games/cowsay -n
fi
fi
}
[ $((RANDOM % 20)) -eq '0' ] && todo | lolcat
clearHist(){
(
setopt pipe_fail
tmpfile=$(mktemp)
tac "$HISTFILE" | sed 's-^[\t ]*--;s-[\t ]*$--g' |
awk '(!x[$0]++){print $0}' | tac > $tmpfile &&
mv -f $tmpfile "$HISTFILE"
)
}
alias unhist="unset HISTFILE"
[ $((RANDOM % 20)) -eq '0' ] && clearHist
true
application/octet-stream
This content has been proxied by September (ba2dc).