summaryrefslogtreecommitdiff
path: root/etc/alias
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-05-19 19:33:01 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-05-19 19:33:01 +0200
commit42562531389e9998c83a1c05a1551244e4457f55 (patch)
tree726751aa9e3eae2e7df7d68fbb813bdca38ef3fa /etc/alias
initial commit
Diffstat (limited to 'etc/alias')
-rw-r--r--etc/alias/default52
-rw-r--r--etc/alias/font10
-rw-r--r--etc/alias/global9
-rw-r--r--etc/alias/short95
-rw-r--r--etc/alias/suffix38
5 files changed, 204 insertions, 0 deletions
diff --git a/etc/alias/default b/etc/alias/default
new file mode 100644
index 0000000..3b66907
--- /dev/null
+++ b/etc/alias/default
@@ -0,0 +1,52 @@
+## Some useful default options
+## To evade them, use '=foo' instead of 'foo'
+## vim:ft=zsh
+
+# The free/used/total space of encfs type filesystems is broken here
+[ $uname = Linux ] && alias df='df --human-readable --local --exclude-type=fuse.encfs' || alias df='df -hl'
+
+[ $uname = Linux ] && alias du='du --human-readable --summarize' || alias du='du -sh'
+
+alias feh='feh --quiet'
+
+alias fgrep='grep -F --color=auto'
+
+# find does globbing itself
+alias find='noglob find'
+
+alias grep='grep --color=auto'
+
+alias host='host -a'
+
+# I often use it for just *viewing* things, which works fine without root
+alias ifconfig='/sbin/ifconfig'
+
+# 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 --clear-screen --RAW-CONTROL-CHARS --quit-if-one-screen --ignore-case --tabs=5'
+
+# classify = "/" after dirs, "*" after executables etc
+[ $uname = Linux ] && alias ls='ls --color=auto --classify --human-readable' || alias ls='ls -Fh'
+
+# Somehow folllowing the 'learn something new every day' ;-)
+[ $uname = Linux ] && alias man='man --all' || alias man='man -a'
+
+# Useful on sshfs or similar
+alias mplayer='mplayer -cache 6000 -cache-min 50'
+
+alias mv='mv -i'
+
+alias mx='mx -aZ'
+
+# Only TCP/TCP6, not sockets and such
+[ $uname = Linux ] && alias netstat='sudo netstat --program --listening --all --tcp --extend' || alias netstat='sudo netstat -latp tcp'
+
+# BSD style
+alias ps='ps aux'
+
+# use unicode, reattach anyway
+alias screen='screen -DUR'
+
+# Don't collapse trees
+alias todo='todo -f +children'
diff --git a/etc/alias/font b/etc/alias/font
new file mode 100644
index 0000000..a2310f3
--- /dev/null
+++ b/etc/alias/font
@@ -0,0 +1,10 @@
+## 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
new file mode 100644
index 0000000..4398484
--- /dev/null
+++ b/etc/alias/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/alias/short b/etc/alias/short
new file mode 100644
index 0000000..e6c56a3
--- /dev/null
+++ b/etc/alias/short
@@ -0,0 +1,95 @@
+## Short aliases
+## vim:ft=zsh
+
+## Debian package system (aptitude/apt-get, apt-cache, dpkg)
+
+# Search the packages list
+alias acse='apt-cache search'
+alias apse='aptitude search'
+
+# Show package information
+alias acsh='apt-cache show'
+alias apsh='aptitude show'
+alias dps='dpkg --status'
+
+# Update packages list
+alias agu='sudo apt-get update'
+alias apu='sudo aptitude update'
+
+# Update packages
+alias ags='sudo apt-get upgrade'
+alias agf='sudo apt-get dist-upgrade'
+alias aps='sudo aptitude safe-upgrade'
+alias apf='sudo aptitude full-upgrade'
+
+# Install packages
+alias agi='sudo apt-get install'
+alias api='sudo aptitude install'
+alias dpi='sudo dpkg --install'
+
+# Clean packages cache
+alias agc='sudo apt-get clean'
+alias apc='sudo aptitude clean'
+
+# Remove/Purge packages
+alias agp='sudo apt-get purge'
+alias agr='sudo apt-get remove'
+alias dpp='sudo dpkg --purge'
+alias dpr='sudo dpkg --remove'
+
+# Configure packages
+alias dprc='sudo dpkg-reconfigure'
+
+
+alias acp='apt-cache policy'
+
+## feh
+alias fehf='feh -Tfull' # Fullscreen
+alias fehi='feh .fehindex.jpg'
+alias fehj='feh -Tjust' # Screensaver-like
+for i in {5,10,15,20}; {
+ alias fehj$i='feh -Tjust'$i
+ alias fehf$i='feh -Tfull'$i
+}
+alias fehjx='feh -Tjust --slideshow-delay'
+alias fehfx='feh -Tjust --slideshow-delay'
+alias feht='feh -Tthumbnail' # List thumbnails
+
+## Mercurial (hg)
+alias hga='hg add'
+alias hgc='hg commit -m'
+alias hgd='hg diff | less'
+alias hgf='hg fetch'
+alias hgg='hg glog | less'
+alias hgh='hg heads'
+alias hgi='hg incoming'
+alias hgl='hg log | less'
+alias hgm='hg merge'
+alias hgp='hg push'
+alias hgrm='hg remove'
+alias hgrv='hg revert'
+alias hgs='hg status'
+alias hgu='hg update'
+alias hgv='hg verify'
+
+# List archive files
+alias lsb='tar tvjf'
+alias lst='tar tvf'
+alias lsz='tar tvzf'
+
+# Automatically upload screenshot plzkthx
+alias putscreen='FILE=$(screenshot); put $FILE; unset FILE'
+
+# Useful when a beamer is connected to my laptop
+alias rplayer='mplayer -vo x11 -zoom -vf scale=1024:-2'
+
+## Suspend
+alias s2d='sudo s2disk'
+alias s2r='sudo s2ram -f'
+
+## Snownews
+alias sn='snownews'
+alias snu='snownews -u'
+
+# start x and log out immediately
+alias x='startx &! exit'
diff --git a/etc/alias/suffix b/etc/alias/suffix
new file mode 100644
index 0000000..30c96c8
--- /dev/null
+++ b/etc/alias/suffix
@@ -0,0 +1,38 @@
+## 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)
+
+# Formats
+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)
+
+# 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'
+
+# 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