Created
August 7, 2010 17:00
-
-
Save orymate/512984 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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]%}" | |
PROMPT="$PR_WHITE%m%# $PR_PLAIN" | |
RPROMPT="${PR_LIGHT_BLACK}[$PR_PLAIN$PR_WHITE%~${PR_LIGHT_BLACK}]$PR_PLAIN" | |
# 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() { echo -ne "\033]2;$*\007"; 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" | |
local configuredhosts="$(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} | |
rationalise-dot() { | |
if [[ $LBUFFER = *.. ]]; then | |
LBUFFER+=/.. | |
else | |
LBUFFER+=. | |
fi | |
} | |
zle -N rationalise-dot | |
bindkey . rationalise-dot | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment