defcon
Kaiser
saiki schrieb:eigentlich müsste man so einen thread mal über zsh machen
Hier mal meine .zshrc
Code:
autoload -U compinit
compinit
# Prompt
PROMPT="%n@%m %c %# "
# Options for zsh
export HISTFILE=~/.zsh_history
export HISTSIZE=50000
export SAVEHIST=50000
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path ~/.zsh/cache
zstyle ':completion:*:kill:*' menu yes select
zstyle ':completion:*:kill:*' force-list always
#choice processes
zstyle ':completion:*:processes' command 'ps -A'
alias -g ...='../..'
alias -g ....='../../..'
alias -g .....='../../../..'
alias c="clear"
alias x="exit"
alias q="exit"
alias s="screen"
alias v="vim"
alias sv="sudo vim"
alias start_cpan='perl -MCPAN -e shell'
# ls colors
alias d="ls --color"
alias ls="ls --color=auto"
alias ll="ls --color -l"
alias la="ls --color -al"
# Debian Apt
alias sea="apt-cache search"
alias ins="sudo apt-get install"
alias rem="sudo apt-get remove"
alias upd="sudo apt-get update"
bindkey '^?' backward-delete-char
bindkey '^[[1~' beginning-of-line
#bindkey '^[[5~' up-line-or-history
bindkey '^[[3~' delete-char
bindkey '^[[4~' end-of-line
#bindkey '^[[6~' down-line-or-history
bindkey '^[[A' up-line-or-search
bindkey '^[[D' backward-char
bindkey '^[[B' down-line-or-search
bindkey '^[[C' forward-char
bindkey '^[[5~' history-search-backward
bindkey '^[[6~' history-search-forward
# archive entpacken
extract() {
if [[ -z "$1" ]]; then
print -P "usage: \e[1;36mextract\e[1;0m < filename >"
print -P " Extract the file specified based on the extension"
elif [[ -f $1 ]]; then
case ${(L)1} in
*.tar.bz2) tar -jxvf $1;;
*.tar.gz) tar -zxvf $1;;
*.bz2) bunzip2 $1 ;;
*.gz) gunzip $1 ;;
*.jar) unzip $1 ;;
*.rar) unrar x $1 ;;
*.tar) tar -xvf $1 ;;
*.tbz2) tar -jxvf $1;;
*.tgz) tar -zxvf $1;;
*.zip) unzip $1 ;;
*.Z) uncompress $1;;
*) echo "Unable to extract '$1' :: Unknown extension"
esac
else
echo "File ('$1') does not exist!"
fi
}
# archive packen
smartcompress() {
if [ $2 ]; then
case $2 in
tgz | tar.gz) tar -zcvf$1.$2 $1 ;;
tbz2 | tar.bz2) tar -jcvf$1.$2 $1 ;;
tar.Z) tar -Zcvf$1.$2 $1 ;;
tar) tar -cvf$1.$2 $1 ;;
gz | gzip) gzip $1 ;;
bz2 | bzip2) bzip2 $1 ;;
*)
echo "Error: $2 is not a valid compression type"
;;
esac
else
smartcompress $1 tar.gz
fi
}
# debian upgrade
upgrade () {
if [ -z $1 ] ; then
sudo apt-get update
sudo apt-get -u upgrade
else
ssh $1 sudo apt-get update
# ask before the upgrade
local dummy
ssh $1 sudo apt-get --no-act upgrade
echo -n "Process the upgrade ?"
read -q dummy
if [[ $dummy == "y" ]] ; then
ssh $1 sudo apt-get -u upgrade --yes
fi
fi
}
# screenshot knipsen
sshot() {
[[ ! -d ~/shots ]] && mkdir ~/shots
#cd ~/shots ; sleep 5 ; import -window root -depth 8 -quality 80 `date "+%Y-%m-%d--%H:%M:%S"`.png
cd ~/shots ; sleep 5; import -window root shot_`date --iso-8601=m`.jpg
}
Zuletzt bearbeitet: