From 2ea9d99d207cc1d0263767fe0b006460915f4da0 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 12 Mar 2009 10:43:52 +0100 Subject: Moved aliases directory out of the core zshrc --- etc/alias | 7 +++++ etc/alias/default | 86 ----------------------------------------------------- etc/alias/font | 9 ------ etc/alias/global | 9 ------ etc/alias/short | 43 --------------------------- etc/alias/suffix | 40 ------------------------- etc/aliases/default | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++ etc/aliases/font | 9 ++++++ etc/aliases/global | 9 ++++++ etc/aliases/short | 43 +++++++++++++++++++++++++++ etc/aliases/suffix | 40 +++++++++++++++++++++++++ etc/rc | 6 +--- 12 files changed, 195 insertions(+), 192 deletions(-) create mode 100644 etc/alias delete mode 100644 etc/alias/default delete mode 100644 etc/alias/font delete mode 100644 etc/alias/global delete mode 100644 etc/alias/short delete mode 100644 etc/alias/suffix create mode 100644 etc/aliases/default create mode 100644 etc/aliases/font create mode 100644 etc/aliases/global create mode 100644 etc/aliases/short create mode 100644 etc/aliases/suffix diff --git a/etc/alias b/etc/alias new file mode 100644 index 0000000..4bc2e19 --- /dev/null +++ b/etc/alias @@ -0,0 +1,7 @@ +## vim:ft=zsh +zrc_status aliases +source $ZDIR/aliases/suffix +source $ZDIR/aliases/font +source $ZDIR/aliases/default +source $ZDIR/aliases/global +source $ZDIR/aliases/short diff --git a/etc/alias/default b/etc/alias/default deleted file mode 100644 index 6165ed6..0000000 --- a/etc/alias/default +++ /dev/null @@ -1,86 +0,0 @@ -## vim:ft=zsh -## Some useful default options -## To evade them, use '=foo' instead of 'foo' - - -# -# grep -# - -linux: { - alias egrep='grep -E --color=auto' - alias fgrep='grep -F --color=auto' - alias grep='grep --color=auto' -} - - -# -# file and filesystem information -# - -# human-readable sizes, local filesystems only -linux: alias df='df -hl --exclude-type=fuse.encfs' || - alias df='df -hl' - -# human-readable sizes, summarize, dereference args -linux: alias du='du -shD' || - alias du='du -shH' - -# human-readable sizes, mark executables with '*' etc. -linux: alias ls='ls -Fh --color=auto' || - alias ls='ls -Fh' - - -# -# networking -# - -# I often use it for just *viewing* things, which works fine without root -alias ifconfig='/sbin/ifconfig' - -alias host='host -a' -alias mx='mx -aZ' - -# Only TCP/TCP6, not sockets and such -linux: salias netstat='netstat --program --all --tcp --extend' || - salias netstat='netstat -atp tcp' - - -# -# various other stuff -# - -alias cal='cal -m' -alias cp='cp -i' -alias fbi='fbi -readahead' -alias feh='feh --quiet --verbose' - -# find does globbing itself -alias find='noglob find' - -# This is an export, so that also man() and other apps using less as pager get it -# clear-screen = much faster scrolling on ttys -# RAW-CONTROL-CHARS = Don't produce crap if the file contains ANSI color sequences -export LESS='--silent --no-init --clear-screen --RAW-CONTROL-CHARS --quit-if-one-screen --ignore-case --tabs=5' - -# Show manuals in all sections -alias man='man -a' - -alias mv='mv -i' - -# BSD style -alias ps='ps aux' - -# use unicode, reattach anyway, resize if neccessary -alias screen='screen -ADRUa' - -# alias expansion with sudo -alias sudo='sudo ' - -alias tilp='gksudo "tilp --calc=ti84+ --cable=DirectLink"' - -# Don't collapse trees -alias todo='noglob todo -f +children' - -# smooth scrolling -alias xload='xload -jumpscroll 1' diff --git a/etc/alias/font b/etc/alias/font deleted file mode 100644 index 986df27..0000000 --- a/etc/alias/font +++ /dev/null @@ -1,9 +0,0 @@ -## Shamelessly stolen from http://git.kitenet.net/?p=joey/home-etc;a=summary -## vim:ft=zsh -alias font-tiny='echo -en "\033]50;-misc-fixed-medium-r-normal--8-80-75-75-c-50-iso10646-1\007"' -alias font-small='echo -en "\033]50;6x10\007"' -alias font-default='echo -e "\033]50;-misc-fixed-medium-r-semicondensed--13-*-*-*-*-*-iso10646-1\007"' -alias font-medium='echo -en "\033]50;-misc-fixed-medium-r-normal--13-120-75-75-c-80-iso10646-1\007"' -alias font-large='echo -en "\033]50;-misc-fixed-medium-*-*-*-15-*-*-*-*-*-iso10646-1\007"' -alias font-larger='echo -en "\033]50;-misc-fixed-medium-r-normal--18-*-*-*-*-*-iso10646-1\007"' -alias font-huge='echo -en "\033]50;-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1\007"' diff --git a/etc/alias/global b/etc/alias/global deleted file mode 100644 index 4398484..0000000 --- a/etc/alias/global +++ /dev/null @@ -1,9 +0,0 @@ -## Global aliases -## evil, but rarely messy -## vim:ft=zsh -alias -g EG='|egrep' -alias -g FG='|fgrep' -alias -g G='|grep' -alias -g H='|head' -alias -g L='|less' -alias -g T='|tail' diff --git a/etc/alias/short b/etc/alias/short deleted file mode 100644 index 5cb9cd8..0000000 --- a/etc/alias/short +++ /dev/null @@ -1,43 +0,0 @@ -## Short aliases -## vim:ft=zsh - -## For Loops -alias allf='for i in *(.);' -alias alld='for i in *(/);' -alias alle='for i in *(*);' -alias alll='for i in *(@);' -alias all='for i in *;' - -alias allfr='for i in **/*(.);' -alias alldr='for i in **/*(/);' -alias aller='for i in **/*(*);' -alias alllr='for i in **/*(@);' -alias allr='for i in **/*;' - -alias dua='du --apparent-size' - -## fbi -alias fbif='fbi -a' -alias fbij='fbi -a -u' - -for i in ~/var/gtd/*(.N); { - alias gtd-${i:t}='todo --database '$i -} - -# File listings -alias lsb='tar tvjf' -alias lsgz='tar tvzf' -alias lsi='feh --list' -alias lst='tar tvf' -alias lsz='unzip -l' - -alias nb='newsbeuter' -alias nbr='newsbeuter -r' - -alias rd='rmdir' - -alias rsync-serve="rsync --daemon --port=10873 --no-detach --config=/dev/stdin --log-file=/dev/stdout -v <<< $'[.]\n\tpath = .\n\tuse chroot = no'" - -## Suspend -salias s2d='s2disk' -salias s2r='s2ram -f' diff --git a/etc/alias/suffix b/etc/alias/suffix deleted file mode 100644 index 95b763a..0000000 --- a/etc/alias/suffix +++ /dev/null @@ -1,40 +0,0 @@ -## Sufix aliases -## Like, enter "somefile.ogg" and zsh will automatically open it using $audio_app -## vim:ft=zsh -# part 1: what filetypes to open whith what app? -# List of filetypes covered by aliases -filetypes=(archive audio midi video image document raw office emul web) - -# File extensions -archive_formats=(tar.bz2 tar.gz tar bz2 gz zip rar) -audio_formats=(flac mp3 ogg wav wma) -midi_formats=(mid s3m) -video_formats=(avi divx flv m4v mkv mp4 mpg mpeg ogm wmv) -image_formats=(bmp jpg jpeg gif png) -document_formats=(pdf ps) -raw_formats=(conf ini log txt htm html xhtml c cpp lst) -office_formats=(doc odt ott rtf sxw) -emul_formats=(exe) -web_formats=(com de net org) - -# Applications -archive_app='extr' -audio_app='mplayer' -video_app='mplayer' -midi_app='timidity' -image_app='feh -Tfull' -document_app='kpdf' -raw_app='vim' -office_app='openoffice' -emul_app='wine' -web_app='x-www-browser' - -# part 2: create the aliases -for meta in $filetypes; do - for format in $(eval echo -n "$"${meta}_formats); do - eval alias -s $format="$"${meta}_app - done - unset ${meta}_{formats,app} -done - -unset filetypes meta format diff --git a/etc/aliases/default b/etc/aliases/default new file mode 100644 index 0000000..6165ed6 --- /dev/null +++ b/etc/aliases/default @@ -0,0 +1,86 @@ +## vim:ft=zsh +## Some useful default options +## To evade them, use '=foo' instead of 'foo' + + +# +# grep +# + +linux: { + alias egrep='grep -E --color=auto' + alias fgrep='grep -F --color=auto' + alias grep='grep --color=auto' +} + + +# +# file and filesystem information +# + +# human-readable sizes, local filesystems only +linux: alias df='df -hl --exclude-type=fuse.encfs' || + alias df='df -hl' + +# human-readable sizes, summarize, dereference args +linux: alias du='du -shD' || + alias du='du -shH' + +# human-readable sizes, mark executables with '*' etc. +linux: alias ls='ls -Fh --color=auto' || + alias ls='ls -Fh' + + +# +# networking +# + +# I often use it for just *viewing* things, which works fine without root +alias ifconfig='/sbin/ifconfig' + +alias host='host -a' +alias mx='mx -aZ' + +# Only TCP/TCP6, not sockets and such +linux: salias netstat='netstat --program --all --tcp --extend' || + salias netstat='netstat -atp tcp' + + +# +# various other stuff +# + +alias cal='cal -m' +alias cp='cp -i' +alias fbi='fbi -readahead' +alias feh='feh --quiet --verbose' + +# find does globbing itself +alias find='noglob find' + +# This is an export, so that also man() and other apps using less as pager get it +# clear-screen = much faster scrolling on ttys +# RAW-CONTROL-CHARS = Don't produce crap if the file contains ANSI color sequences +export LESS='--silent --no-init --clear-screen --RAW-CONTROL-CHARS --quit-if-one-screen --ignore-case --tabs=5' + +# Show manuals in all sections +alias man='man -a' + +alias mv='mv -i' + +# BSD style +alias ps='ps aux' + +# use unicode, reattach anyway, resize if neccessary +alias screen='screen -ADRUa' + +# alias expansion with sudo +alias sudo='sudo ' + +alias tilp='gksudo "tilp --calc=ti84+ --cable=DirectLink"' + +# Don't collapse trees +alias todo='noglob todo -f +children' + +# smooth scrolling +alias xload='xload -jumpscroll 1' diff --git a/etc/aliases/font b/etc/aliases/font new file mode 100644 index 0000000..986df27 --- /dev/null +++ b/etc/aliases/font @@ -0,0 +1,9 @@ +## Shamelessly stolen from http://git.kitenet.net/?p=joey/home-etc;a=summary +## vim:ft=zsh +alias font-tiny='echo -en "\033]50;-misc-fixed-medium-r-normal--8-80-75-75-c-50-iso10646-1\007"' +alias font-small='echo -en "\033]50;6x10\007"' +alias font-default='echo -e "\033]50;-misc-fixed-medium-r-semicondensed--13-*-*-*-*-*-iso10646-1\007"' +alias font-medium='echo -en "\033]50;-misc-fixed-medium-r-normal--13-120-75-75-c-80-iso10646-1\007"' +alias font-large='echo -en "\033]50;-misc-fixed-medium-*-*-*-15-*-*-*-*-*-iso10646-1\007"' +alias font-larger='echo -en "\033]50;-misc-fixed-medium-r-normal--18-*-*-*-*-*-iso10646-1\007"' +alias font-huge='echo -en "\033]50;-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1\007"' diff --git a/etc/aliases/global b/etc/aliases/global new file mode 100644 index 0000000..4398484 --- /dev/null +++ b/etc/aliases/global @@ -0,0 +1,9 @@ +## Global aliases +## evil, but rarely messy +## vim:ft=zsh +alias -g EG='|egrep' +alias -g FG='|fgrep' +alias -g G='|grep' +alias -g H='|head' +alias -g L='|less' +alias -g T='|tail' diff --git a/etc/aliases/short b/etc/aliases/short new file mode 100644 index 0000000..5cb9cd8 --- /dev/null +++ b/etc/aliases/short @@ -0,0 +1,43 @@ +## Short aliases +## vim:ft=zsh + +## For Loops +alias allf='for i in *(.);' +alias alld='for i in *(/);' +alias alle='for i in *(*);' +alias alll='for i in *(@);' +alias all='for i in *;' + +alias allfr='for i in **/*(.);' +alias alldr='for i in **/*(/);' +alias aller='for i in **/*(*);' +alias alllr='for i in **/*(@);' +alias allr='for i in **/*;' + +alias dua='du --apparent-size' + +## fbi +alias fbif='fbi -a' +alias fbij='fbi -a -u' + +for i in ~/var/gtd/*(.N); { + alias gtd-${i:t}='todo --database '$i +} + +# File listings +alias lsb='tar tvjf' +alias lsgz='tar tvzf' +alias lsi='feh --list' +alias lst='tar tvf' +alias lsz='unzip -l' + +alias nb='newsbeuter' +alias nbr='newsbeuter -r' + +alias rd='rmdir' + +alias rsync-serve="rsync --daemon --port=10873 --no-detach --config=/dev/stdin --log-file=/dev/stdout -v <<< $'[.]\n\tpath = .\n\tuse chroot = no'" + +## Suspend +salias s2d='s2disk' +salias s2r='s2ram -f' diff --git a/etc/aliases/suffix b/etc/aliases/suffix new file mode 100644 index 0000000..95b763a --- /dev/null +++ b/etc/aliases/suffix @@ -0,0 +1,40 @@ +## Sufix aliases +## Like, enter "somefile.ogg" and zsh will automatically open it using $audio_app +## vim:ft=zsh +# part 1: what filetypes to open whith what app? +# List of filetypes covered by aliases +filetypes=(archive audio midi video image document raw office emul web) + +# File extensions +archive_formats=(tar.bz2 tar.gz tar bz2 gz zip rar) +audio_formats=(flac mp3 ogg wav wma) +midi_formats=(mid s3m) +video_formats=(avi divx flv m4v mkv mp4 mpg mpeg ogm wmv) +image_formats=(bmp jpg jpeg gif png) +document_formats=(pdf ps) +raw_formats=(conf ini log txt htm html xhtml c cpp lst) +office_formats=(doc odt ott rtf sxw) +emul_formats=(exe) +web_formats=(com de net org) + +# Applications +archive_app='extr' +audio_app='mplayer' +video_app='mplayer' +midi_app='timidity' +image_app='feh -Tfull' +document_app='kpdf' +raw_app='vim' +office_app='openoffice' +emul_app='wine' +web_app='x-www-browser' + +# part 2: create the aliases +for meta in $filetypes; do + for format in $(eval echo -n "$"${meta}_formats); do + eval alias -s $format="$"${meta}_app + done + unset ${meta}_{formats,app} +done + +unset filetypes meta format diff --git a/etc/rc b/etc/rc index 7ff9256..c28e520 100644 --- a/etc/rc +++ b/etc/rc @@ -27,11 +27,7 @@ source $ZDIR/zle source $ZDIR/prompt source $ZDIR/directories source $ZDIR/keys -source $ZDIR/alias/suffix -source $ZDIR/alias/font -source $ZDIR/alias/default -source $ZDIR/alias/global -source $ZDIR/alias/short +source $ZDIR/alias source $ZDIR/../provided/includes xsource $ZDIR/local # local configuration, not in git xsource $HOME/var/tmp/envstore-raw-$UID # envstore -- cgit v1.2.3