# -*- conf -*- # Lines configured by zsh-newuser-install HISTFILE=~/.histfile HISTSIZE=10000 SAVEHIST=20000 setopt appendhistory autocd extendedglob nomatch unsetopt beep notify bindkey -e # End of lines configured by zsh-newuser-install # The following lines were added by compinstall zstyle ':completion:*' completer _oldlist _expand _complete _match _correct _approximate zstyle ':completion:*' expand prefix suffix zstyle ':completion:*' format 'Completing %d' zstyle ':completion:*' ignore-parents pwd .. zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} zstyle ':completion:*' list-suffixes true zstyle ':completion:*' matcher-list 'r:|[._-]=** r:|=**' 'r:|[._-]=** r:|=**' 'r:|[._-]=** r:|=**' 'l:|=* r:|=*' zstyle ':completion:*:match:*' original only zstyle ':completion:*' max-errors 1 numeric zstyle ':completion:*' menu select=0 zstyle ':completion:*' preserve-prefix '//[^/]##/' zstyle ':completion:*' select-prompt %l matches - %SScrolling active: current selection at %p%s zstyle ':completion:*' special-dirs true zstyle ':completion:*' squeeze-slashes true zstyle ':completion:*' use-compctl true zstyle ':completion:*' verbose true zstyle :compinstall filename '/home/fly5/.zshrc' autoload -Uz compinit compinit # End of lines added by compinstall export PATH=$PATH:/home/fly5/bin:/opt/cxoffice/bin path=(/usr/local/bin /usr/local/sbin /sbin /usr/sbin /bin /usr/bin /home/fly5/bin /opt/cxoffice/bin $path) typeset -U PATH # remove duplicate entries # rename help autoload -U zmv # compele only command we have zstyle ':completion:*:functions' ignored-patterns '_*' # process ids zstyle ':completion:*:*:kill:*' menu yes select zstyle ':completion:*:kill:*' force-list always # killall zstyle ':completion:*:killall:*' command 'ps -u $USER -o cmd' # cache (apt and dpkg are slow) zstyle ':completion:*' use-cache on zstyle ':completion:*' cache-path ~/.zsh/cache # täydentää tabit myös sanan keskeltä setopt COMPLETE_IN_WORD # istunnon komennot historiatiedoston loppuun eikä nollata setopt APPEND_HISTORY # komennot historiatiedostoon heti ku ne syötetty setopt INC_APPEND_HISTORY # ei piipata unsetopt BEEP setopt nobeep # GREEN=`tput setaf 2` # BRIGHTGREEN=`tput bold; tput setaf 2` # YELLOW=`tput setaf 3` # BRIGHTYELLOW=`tput bold; tput setaf 3` # BLACK=`tput setaf 0` # RED=`tput setaf 1` # BRIGHTRED=`tput bold; tput setaf 1` # BLUE=`tput setaf 4` # MAGENTA=`tput setaf 5` # CYAN=`tput setaf 6` # NORM=`tput sgr0` eval `dircolors -b` alias d="ls --color" alias ls="ls --color=auto" #alias ll="ls --color -l" alias ls='ls --color=auto' ### bashista konvertoidut aliakset alkaa #pikkunen funktio tekemään pientä jälkeä function pieni { iso="$*" iso=`echo $iso | tr "[:upper:]" "[:lower:]"` echo $iso } alias torrent='screen -S torrent btlaunchmanycurses.bittornado ~/Torrentit --minport 44001 --maxport 45000 --saveas ~/Lataukset --max_upload_rate 80 --max_download_rate 80 --max_uploads 6' alias torrenkeskit='screen -S torrent btlaunchmanycurses.bittornado ~/Torrentit --minport 44001 --maxport 45000 --saveas ~/Lataukset --max_upload_rate 60 --max_download_rate 60 --max_uploads 6' alias torrenthidas='screen -S torrent btlaunchmanycurses.bittornado ~/Torrentit --minport 44001 --maxport 45000 --saveas ~/Lataukset --max_upload_rate 40 --max_download_rate 40 --max_uploads 6' alias torrentnopee='screen -S torrent btlaunchmanycurses.bittornado ~/Torrentit --minport 44001 --maxport 45000 --saveas ~/Lataukset --max_upload_rate 80 --max_download_rate 160 --max_uploads 6' alias auttaja='screen -S auttaja /bin/sh -c "cd $HOME/Desktop/auttaja && './FAH504-Linux.exe'"' alias tänään='LC_ALL=fi_FI.UTF-8 date +"%A, %-d %Bta, %Y"' #alias lsf='ls -F --color=tty' #regular ls alias lsa='ls -la' alias la='ls -la' alias lsf='ls *(.)' # only files alias l.='ls -dF .[a-zA-Z0-9]* --color=tty' #only show dotfiles alias ll='ls -lhF --color=tty' #long listing ##alias lsd='ls -d */ | xargs -l basename' #dir alias lsd='ls -d */' #dirs alias lsdn='ls -ld *(-/DN)' # myös symlinkit ja piilot alias lsd.='ls -d .[a-zA-Z0-9]*/ --color=tty' # only dot dirs alias rmi="rm -i" alias cpi="cp -i" alias mvi="mv -i" alias du="du -h" alias df="df -h" alias bzip2='bzip2 -v' alias j=jobs alias cd..="cd .." #work around a common typo #Automatically do an ls after each cd cd() { if [ -n "$1" ]; then builtin cd "$@" && ls else builtin cd ~ && ls fi } alias hist='history | grep $1' alias vkeybd='vkeybd --octave 9' #alias cxoffice='$HOME/Ohjelmat/cxoffice/bin/wine' #alias cxrun='$HOME/Ohjelmat/cxoffice/bin/cxrun' alias sää='zenity --name=saa --title=Sää --width=300 --height=250 --window-icon=$HOME/Projektit/saa.png --text-info --filename $HOME/Projektit/saa.txt' alias resoluutio='gvidm' alias lordgame='telnet lord.nuklear.org 10240' alias dhmakejuttu='dh_make -c gpl -b' alias dosbox='dosbox -conf ~/.dosbox/dosbox.conf' alias funkki='telnet the-funk.net 7000' alias starwarssi='telnet towel.blinkenlights.nl' # now they use same command #service () { #sudo /etc/init.d/$* #} alias etsi='apt-cache search' alias asenna='sudo apt-get install' alias asenna-uudestaan='sudo apt-get install --reinstall' alias poista='sudo apt-get remove' alias poista-kokonaan='sudo apt-get --purge remove' alias nayta='apt-cache show' alias policy='apt-cache policy' alias update='sudo apt-get update' alias upgrade='sudo apt-get update && sudo apt-get upgrade' alias dist-upgrade='sudo apt-get update && sudo apt-get dist-upgrade' alias etsi-nimista='apt-cache search --names-only' alias kaantopaiva='LC_ALL=en_US.UTF-8 date +"%a, %-d %b %Y %H:%M:%S %z"' ### bashista konvertoidut aliakset loppuu ### PROMPT ### BLACK="%{"$'\033[01;30m'"%}" GREEN="%{"$'\033[01;32m'"%}" RED="%{"$'\033[01;31m'"%}" YELLOW="%{"$'\033[01;33m'"%}" BLUE="%{"$'\033[01;34m'"%}" BOLD="%{"$'\033[01;39m'"%}" NORM="%{"$'\033[00m'"%}" LGREEN="%{"$'\033[0;32m'"%}" ## kivat? värit #PROMPT="${LGREEN}%m${GREEN}[${LGREEN}%h${GREEN}]${LGREEN}:${BLUE}%~${LGREEN} %#${NORM} " #PROMPT="${LGREEN}%m${GREEN}[${LGREEN}%n${GREEN}]${LGREEN}:${BLUE}%~${LGREEN} %#${NORM} " PROMPT="${LGREEN}%n${GREEN}[${LGREEN}%m${GREEN}]${LGREEN}:${BLUE}%~${LGREEN} %#${NORM} " # oikeen reunan prompti RPROMPT="${GREEN}(${LGREEN}%T${GREEN})${NORM}" ### /PROMPT ### # STDERR punasella #exec 2>>(while read line; do #print '\e[91m'${(q)line}'\e[0m' > /dev/tty; done &) # pois flow control (se häiritsevä ctrl-s ctrl-q) stty -ixon # nätti ls alias ls='ls --color=auto' ZLS_COLORS=$LS_COLORS # globaaleja aliaksia alias -g '...'='../..' alias -g '....'='../../..' alias -g '.....'='../../../..' # poistuessa disownataan prosessi ettei sulkeudu sulje () { disown %1 exit 0 } #export PATH=$PATH:/home/fly5/bin:/opt/cxoffice/bin # my less is better than yours :P eval "$(lessfile)" alias avaabash='xterm -C /bin/bash' export KDE_NO_IPV6=true alias nayta-aito="sed -n -e 'l'" alias kirja="gjots2" alias tarkkaile-trackeria="tail -f ~/.local/share/tracker/tracker.log" alias pakkaa="tar czf" # titlefun case $TERM in *xterm*|*rxvt*|(dt|k|E)term) precmd () { print -Pn "\e]0;$(basename $SHELL): %~\a" } preexec () { print -Pn "\e]0;$1\a" } ;; screen) precmd () { print -Pn "\e]0;$(basename $SHELL):: %~\a" } preexec () { print -Pn "\e]0;$1\a" } esac # #preexec () { # echo -ne "\ek${(s: :)1[1]}\e\\" #} alias nethackscore="nethack -s all" export POWWOWEDITOR='emacs' #alias nethakki='urxvt +hold -bg black -fn "xft:Bitstream Vera Sans Mono:pixelsize=20" -title "netslashem" -e ssh purkki 2>/dev/null' nethakki() { urxvt \ +hold \ -bg black \ -fn "xft:Bitstream Vera Sans Mono:pixelsize=20" \ -title "netslas'hem" \ -geometry 82x24 \ -e ssh purkki \ 2>/dev/null } #hae() { #find . -type f -name "$@" #} alias -g hae='noglob find . -type f -name "$@"' # pois alias c='exec clear ${1+"$@"}' #alias uusinshotti='HAK="$HOME/Kuvat/screenshots"; FIL="$HAK/`ls -1 -t $HAK *.png *.jpg | head -n 1`"; gthumb "$FIL" 2>/dev/null 1>&2' # zsh-way #alias uusinshotti='HAK="$HOME/Kuvat/screenshots"; FIL=($HAK/screenshot*.??g(Nm0om[1])); gthumb "$FIL" 2>/dev/null 1>&2' alias giffit2png='for i in **/*.gif; convert $i $i:r.png' alias -g deitti='`date +"%F"`' # downloads alias lataa='echo "Download dir: `pwd`"; while read line; do wget -q $line 2>/dev/null 1>&2 && echo "OK: \"$line\"" || echo "Error with adr: \"$line\""; done' alias slashem-telnet="TERM=xterm telnet slashem.crash-override.net" alias slashem-ssh="echo -e '\nPassword: slashem\nPeli-tunnus: Katja\n' && TERM=rxvt ssh slashem@slashem.crash-override.net" alias smallinfo='echo "$(whoami)@$(hostname) - $(basename $SHELL)@$TERM - $(uname -sr)"' #alias isotermi='urxvt +hold -bg black -fn "xft:Bitstream Vera Sans Mono:pixelsize=20" 2>/dev/null' #alias isotermi='urxvt +hold -bg black -fn "xft:Bitstream Vera Sans Mono:pixelsize=20" 2>/dev/null' alias myip='ifconfig eth0|grep inet|cut -d : -f2|cut -d " " -f1' alias NAO='TERM=rxvt telnet nethack.alt.org' # rename "mmv photo_*.tiff photo_*.tif" alias mmv='noglob zmv -W' alias hiiri='sudo lomoco -8 2>/dev/null 1>&2' # fix for the ugly openoffice.org export OOO_FORCE_DESKTOP=kde alias down='while read line; do wget -q $line 2>/dev/null 1>&2 && echo "OK: \"$line\"" || echo "Error with adr: \"$line\""; done' #alias checkgmail-svn='sudo echo "---" && echo "siirrytaan temppi-kansioon" && cd /tmp >/dev/null && echo "ladataan" && wget -q "http://checkgmail.svn.sourceforge.net/viewvc/*checkout*/checkgmail/checkgmail" && echo "kopioidaan" && sudo mv checkgmail /usr/bin/ && echo "kayttooikeudet" && sudo chmod +x /usr/bin/checkgmail && echo "ok" && echo "---" || echo "virhe"' avi2mpg () { for i in *; do ffmpeg -i "$i" -target pal-vcd "${i:r}.mpg"; done } erikoisetpois () { zmv '(**/)(*)' '$1${2//[^A-Za-z0-9._]/_}' } avimpgpieniks () { zmv '(**/)(*).(#i)avi' '$1$2.avi' zmv '(**/)(*).(#i)mpg' '$1$2.mpg' } # tekstisaduksi () { # tiedosto="$1" # satutiedosto="satu-$tiedosto" # if [[ -z "$tiedosto" ]]; then # echo "Anna tekstitiedosto" # elif [[ ! -r "$tiedosto" ]]; then # echo "Tiedoston lukeminen epäonnistui" # else # cat "$tiedosto" > /tmp/ttv && iconv -f UTF-8 -t ISO8859-1 /tmp/ttv > "$satutiedosto" # festival -b '(language_finnish)' '(set! tts_hooks (list utt.synth save_tts_output))' '(tts "'"`echo $satutiedosto`"'" nil)' # bash $HOME/bin/combine_waves.sh # REMEMBER TO COPY # oggenc "tts_file_1.wav" -o "$satutiedosto.ogg" && rm "tts_file_1.wav" && rm "$satutiedosto" # [[ "$?" == "0" ]] && [[ -f "$satutiedosto.ogg" ]] && echo "Satu valmis: $satutiedosto.ogg" || echo "HUPS\! Nyt kävi virhe.." # fi # } mcd () { mkdir -p -- "$*" && cd "$*" } export EDITOR="emacs -nw" export ALSA_OUTPUT_PORTS="128:0" alias muokkaa="mped -tx" xmodmap -e "keycode 133 = Super_L" xmodmap -e "keycode 134 = Super_R" looppinainen() {for i in `seq 1 100000`; do puhu -n $@; done} looppimies() {for i in `seq 1 100000`; do puhu -m $@; done} alias puhutuplana='echo "Tuplana:\n";while read line; do puhu -n $line; puhu -m $line; done' alias puhunainen="puhu -in" alias puhumies="puhu -im" alias alwaysvpn='sudo openvpn --script-security 2 --config /etc/openvpn/alwaysvpn-tcp-Compatible.conf' alias lsnew=" ls -al --time-style=+%D | grep `date +%D` " alias dir-in-use="lsof +D" # for some game installs (after install: unset _POSIX2_VERSION) # export _POSIX2_VERSION=199209 alias rubyripper="rrip_gui" alias onecorestart="taskset -c 1" alias FretsOnFire="cd /mnt/war/PELIT/FretsOnFire/ && ./FretsOnFire" alias teema="gtk-chtheme" alias boffin="cd /home/fly5/Projektit/KAANTO/Boffin/boffin-0.0.4/_bin && LD_LIBRARY_PATH=. ./boffin" alias SoMI="cd ~/.wine_smisp/drive_c/Ohjelmatiedostot/Secret\ Of\ Monkey\ Island\ SE && WINEPREFIX=/home/fly5/.wine_smisp wine MISE.exe" alias SoMI_tapa="WINEPREFIX=/home/fly5/.wine_smisp wineserver -k" ## http://nion.modprobe.de/blog/archives/569-colored-manpages.html alias man="TERMINFO=~/.terminfo/ LESS=C TERM=mostlike PAGER=less man" alias deathrally='cd ~/.wine/drive_c/Ohjelmatiedostot/Death\ Rally && wine dr.exe' alias md5password='echo "import getpass, hashlib; print hashlib.md5(getpass.getpass()).hexdigest()" | python -' # i want space #sudo setxkbmap -option "nbsp:none" alias maili="ssh kapsi -t alpine" alias slashtermi="urxvt +hold -bg black -fn \"xft:Bitstream Vera Sans Mono:pixelsize=20\" -title \"netslas'hem\" -geometry 82x24" alias recentlastfm="wget -q 'http://ws.audioscrobbler.com/1.0/user/fly5/recenttracks.rss' -O- | grep '' | grep -v '' | sed -e 's/^ //g' -e 's/<\/title>//g'" punanenvirhe() { exec 2>>(while read line; do print '\e[91m'${(q)line}'\e[0m' > /dev/tty; done &) } source /etc/zsh_command_not_found #alias amarok='PATH=/opt/kde3/bin:/opt/kde3/games:/opt/kde3/bin:$PATH KDEDIRS=/usr/:/opt/kde3/ KDEHOME=$HOME/.kde3 XDG_DATA_DIRS=/opt/kde3/share/:/usr/share/:/usr/share/gnome:/usr/local/share/ MANPATH=/opt/kde3/share/man amarok' # PATH=/opt/kde3/bin:/opt/kde3/games:/opt/kde3/bin:$PATH # KDEDIRS=/usr/:/opt/kde3/ # KDEHOME=$HOME/.kde3 # XDG_DATA_DIRS=/opt/kde3/share/:/usr/share/:/usr/share/gnome:/usr/local/share/ # MANPATH=/opt/kde3/share/man alias OpenAlchemist="builtin cd /mnt/varasto/Pelit/OpenAlchemist && ./openalchemist" alias rumpus="builtin cd /mnt/varasto/Muut/Ohjelmat/Rumpus && java -jar Rumpus.jar" # List all directories leading up to a filename; this is useful to see # if some permissions are blocking access to a file. # lspath () { if [ "$1" = "${1##/}" ] then pathlist=(/ ${(s:/:)PWD} ${(s:/:)1}) else pathlist=(/ ${(s:/:)1}) fi allpaths=() filepath=$pathlist[0] shift pathlist for i in $pathlist[@] do allpaths=($allpaths[@] $filepath) filepath="${filepath%/}/$i" done allpaths=($allpaths[@] $filepath) ls -ld "$allpaths[@]" } alias -g ND='$(ls -d *(/om[1]))' # newest directory alias -g NF='$(ls *(.om[1]))' # newest file