# enable color support of ls if [ "$TERM" != "dumb" ]; then eval `dircolors -b` #alias ls='ls --color=auto' alias ls='ls --color=auto --group-directories-first' fi # ls aliases alias ll='ls -l' alias la='ls -a' alias lv='ls -la' # sort by reverse time modified (last modified) alias lm='ls -latr' alias clr='clear' # protection from rogue rm commands # alias rm='rm -i' # dir size - see the total size of the contents of this dir alias ds='du --max-depth=1 -h' # make grep use extended regex by default alias grep='egrep' # p for print - print to screen and leave it alias p='more' alias pn='clear; more' # se for sudoedit alias se='sudoedit' alias emacs='emacs -nw' # e for editor - moved to shell script #alias e='$EDITOR' # # r for read - moved to shell script #alias r='$PAGER' # b for browser (CLI, for local html docs) alias b='elinks' ##################### ## personal aliases # ##################### #irssi with different conf file for jabber/xmpp alias irxmpp='irssi --config=~/.irssi/xmpp_config' # long date alias ldate='/bin/date' # time of day alias clock='/bin/date +%T' # day of the year alias doy='/bin/date +%j\ %Y ' # week number (1-52) alias week='/bin/date +%V\ %G' # just the year alias year='/bin/date +%Y' # date/time alias dt='/bin/date +%Y-%m-%d\ %R' # date in ISO format alias date='/bin/date +%Y-%m-%d' # date with day of week YYYY-MM-DD_DAY alias date_day='/bin/date +%Y-%m-%d_%a' set $TERM to screen when running screen alias screen='TERM=screen screen' alias screen-admin='TERM=screen /usr/bin/screen -S admin -t admin' alias screen-irc='TERM=screen /usr/bin/screen -S irc -t irc' alias screen-xmpp='TERM=screen /usr/bin/screen -S xmpp -t xmpp' alias screen-mail='TERM=screen /usr/bin/screen -S mail -t mail' alias screen-feed='TERM=screen /usr/bin/screen -S feed -t feed' alias screen-web='TERM=screen /usr/bin/screen -S web -t web' # BitTorrent alias screen-bt='TERM=screen /usr/bin/screen -S bt -t bt' #alias js='rhino' ######### ## temp # ######### # pulseaudio wrapper stuff alias wine='padsp wine' alias winecfg='padsp winecfg' ############## ## functions # ############## # Compress the cd, ls -l series of commands. function cl () { cd "$@" && ll } # moz moved to shell script function moz-img () { suiterunner -no-remote -P img & } function moz-dev () { suiterunner -no-remote -P dev & } function ff () { firefox --ProfileManager & } function ff-dev () { firefox -no-remote -P dev & } function vb () { firefox -no-remote --P vimperator & } function journal () { year=$(/bin/date +%Y) curdate=$(date_day) vim ~/doc/writing/journal/$year/$curdate.txt } function cdrip () { dd bs=2048 if=$1 of=$2 } #cp with a progress bar, by Chris Lamb cp_p () { set -e strace -q -ewrite cp -- "${1}" "${2}" 2>&1 \ | awk '{ count += $NF if (count % 10 == 0) { percent = count / total_size * 100 printf "%3d%% [", percent for (i=0;i<=percent;i++) printf "=" printf ">" for (i=percent;i<100;i++) printf " " printf "]\r" } } END { print "" }' total_size=$(stat -c '%s' "${1}") count=0 } #function man () #{ # vim -c "Man $*" -c "silent! only" #} #function r1 () #{ # filename="$@" # ext=${filename##*.} # # if [[ "$ext" =~ *htm* ]]; then # elinks $filename # else # most $filename # fi #}