Skip to content

Instantly share code, notes, and snippets.

@orymate

orymate/zshrc Secret

Created October 13, 2013 08:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orymate/ea997c3d08115850bc66 to your computer and use it in GitHub Desktop.
Save orymate/ea997c3d08115850bc66 to your computer and use it in GitHub Desktop.
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=10000
SAVEHIST=10000
setopt autocd extendedglob nomatch notify
bindkey -v
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/maat/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstall
# http://www.erat.org/shell.html
autoload colors zsh/terminfo
if [[ "$terminfo[colors]" -ge 8 ]]; then
colors
fi
for color in BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
eval PR_LIGHT_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
eval PR_$color='%{$fg[${(L)color}]%}'
(( count = $count + 1 ))
done
PR_PLAIN="%{$terminfo[sgr0]%}"
case `hostname` in
huba)
PROMPT="$PR_GREEN%m$PR_YELLOW%# $PR_PLAIN"
RPROMPT="${PR_LIGHT_BLACK}[$PR_PLAIN$PR_WHITE%~${PR_LIGHT_BLACK}]$PR_PLAIN"
;;
irenke)
PROMPT="$PR_GREEN%m$PR_BLUE%# $PR_PLAIN"
RPROMPT="${PR_LIGHT_BLACK}[$PR_PLAIN$PR_WHITE%~${PR_LIGHT_BLACK}]$PR_PLAIN"
;;
doszgep2)
PROMPT="$PR_YELLOW%m$PR_GREEN%# $PR_PLAIN"
RPROMPT="${PR_LIGHT_BLACK}[$PR_PLAIN$PR_WHITE%~${PR_LIGHT_BLACK}]$PR_PLAIN"
;;
ottokar)
PROMPT="$PR_RED%m$PR_GREEN%# $PR_PLAIN"
RPROMPT="${PR_LIGHT_BLACK}[$PR_PLAIN$PR_WHITE%~${PR_LIGHT_BLACK}]$PR_PLAIN"
;;
*)
PROMPT="$PR_PLAIN%m$PR_PLAIN%# $PR_PLAIN"
RPROMPT="${PR_LIGHT_BLACK}[$PR_PLAIN$PR_WHITE%~${PR_LIGHT_BLACK}]$PR_PLAIN"
;;
esac
preexec () {
grep -q screen <<<$TERM && echo -ne "\ek${1%% *}\e\\"
}
# switch to temporary directories http://www.erat.org/shell.html
function tempdir() {
gothere=$1
base=$HOME/temp
create=1
if test "$2"; then
if echo "$2" | egrep -q '^[0-9]+$' && test $2 -gt 0; then
dir=$base/`date -d "$2 days ago" +%Y%m%d`
create=0
else
dir="$base/$2"
fi
else
dir=$base/`date +%Y%m%d`
fi
if [ $create = 1 ] && test \! -e "$dir"; then
mkdir -p "$dir"
fi
if [ $gothere = 1 ]; then
cd $dir
else
echo $dir
fi
ln -sTf $dir ~/t
}
t() { tempdir 1 $1; }
tp() { tempdir 0 $1; }
tn() { nautilus `tp`; }
ssh() {
print -Pn "\e]0;$*\a"
command ssh $*;
}
alias cp="cp --interactive"
alias mv="mv --interactive"
alias gerp=grep
alias df='LANG=C df'
alias ls="ls --color=auto -F"
alias ll="ls -l"
export PATH="$PATH:/home/maat/scripts:/home/maat/run/bin:/usr/local/sicstus4.2.0/bin:/var/lib/gems/1.8/bin/:/home/maat/.gem/ruby/1.8/bin"
local configuredhosts="$([ -r $HOME/.ssh/config ] && awk '/\<Host\>/ {if ($2 != "*") print $2;}' $HOME/.ssh/config)"
zstyle ':completion:*:(ssh|scp|sftp):*' hosts ${(z)configuredhosts}
local users="$(awk -F: '$3 >= 1000 && $7 ~ /sh$/ {print $1}' /etc/passwd)"
zstyle ':completion:*:(ssh|scp|sftp):*' users ${(z)users}
bindkey "\e[1~" beginning-of-line
bindkey "\e[4~" end-of-line
bindkey "\e[5~" beginning-of-history
bindkey "\e[6~" end-of-history
bindkey "\e[3~" delete-char
bindkey "\e[2~" quoted-insert
bindkey "\e[5C" forward-word
bindkey "\eOc" emacs-forward-word
bindkey "\e[5D" backward-word
bindkey "\eOd" emacs-backward-word
bindkey "\e\e[C" forward-word
bindkey "\e\e[D" backward-word
# for non RH/Debian xterm, can't hurt for RH/Debian xterm
bindkey "\eOH" beginning-of-line
bindkey "\eOF" end-of-line
if [ $TERM = xterm ]
then
precmd () {print -Pn "\e]0;@%m: %~\a"}
fi
help () { man zshbuiltins| awk '/^ [^ ]/ {p=0}/^ '"$1"'/{p=1}p'|less }
evince () { /usr/bin/evince $* &>/dev/null }
ebreszto () { at $* <<<'rhythmbox-client --play' }
kabare () { rhythmbox-client --pause; mplayer "http://stream001.radio.hu:443/stream/`date +%Y%m%d --date='last saturday'`_130700_1.mp3" }
export SVN_EDITOR=vim
alias :e=vim
scp () {
for i in $*
do case $i in
*:*) command scp $*
return $?
esac
done
echo No remote path parameter. Aborting.
return 1
}
export GIT_AUTHOR_NAME="Őry Máté"
export GIT_AUTHOR_EMAIL=ory.mate@cloud.bme.hu
export GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"
export GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"
source /usr/local/bin/virtualenvwrapper.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment