.bashrc
rating: 0+x
# @(#) ~mitry/.bashrc
# User specific aliases and functions
# $Id: .bashrc,v 1.22 2007/11/19 21:08:12 SYSTEM Exp $
# -----------------------------------

# -----------------------------------
# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# -----------------------------------
# Source global definitions
[ -r /etc/bashrc ] && . /etc/bashrc

#[ -z "$DISPLAY" ] && export DISPLAY=0:0
: ${DISPLAY:=0:0} && export DISPLAY

export CDPATH='.:~:~/src:/usr/scr:~/Download'
export HISTIGNORE="&:ls:history *:mutt:[bf]g:exit"
export LANG='Russian_Russia.cp1251'
# export LANG='ru_RU.cp866'
#export CODEPAGE=${LANG/*./}

export LS_OPTIONS="-bhAC --more --classify --file-type --color=auto --recent --streams"
export GREP_COLOR="1;33"
export GREP_OPTIONS="--color=auto --mmap --directories=recurse"
export BROWSER="$WINDIR/system32/rundll32.exe shell32.dll,ShellExec_RunDLL"

# bind -x '\e[21~':'exit'
# bind -x '\e[[A':'start /c/usr/doc/GNU/bashref-2.05b.chm\C-m'

function ps    { /c/usr/opt/SysInternals/pslist.exe $@ | sed -ne '8,$p' ;}

# Don't use autocomplete for host names:
shopt -u hostcomplete

alias ll='msys-ls -Fhl --color=auto'
alias ls='msys-ls -Fh --color=auto'
alias make='mingw32-make'
alias lynx='lynx -nomargins -nolist -force_html -display_charset=windows-1251'

# Попробуйте добавить следующие команды к вашему ~/.bash_profile, чтобы
# получать уведомления о появлении новой почты в любом ящике в ~/Mail.
#
#MAILPATH=/var/spool/mail/$USER
#for i in `echo ~/Mail/[^.]*`
#do
#    MAILPATH=$MAILPATH:$i
#done
#export MAILPATH
#unset i

# BlackBox support: {{{1
function @    { command ~/.blackbox/blackbox.exe -exec @$*;}
function bbCore    { @ $FUNCNAME.$* ;}
function bbCfg    { @ $FUNCNAME.$* ;}
function menu    { command ~/.blackbox/blackbox.exe -exec @BBCore.ShowMenu ${1:-$PWD};}

complete -W 'showMenu hideMenu prevWindow nextWindow prevWindowAllWorkspaces nextWindowAllWorkspaces raiseWindow lowerWindow shadeWindow closeWindow minimizeWindow maximizeWindow maximizeVertical maximizeHorizontal restoreWindow minimizeAll restoreAll cascadeWindow tileVertical tileHorizontal leftWorkspace rightWorkspace moveWindowLeft moveWindowRight gatherWindows addWorkspace delWorkspace editWorkspaceNames switchToWorkspace togglePlugins aboutStyle aboutPlugins reconfig restart exit editStyle editMenu editPlugins editExtensions editBlackBox edit shutdown reboot logoff hibernate suspend lockWorkstation exitWindows exec style rootCommand run showAppnames message' bbCore
complete -W 'abortshutdown beep cdrom changesysvolume changesysvolume2 clipboard clipboard closeprocess cmdshortcut cmdshortcutkey cmdwait dlg dlgany emptybin exec exec2 execmd exitwin gac hibernate inetdial infobox inidelsec inidelval inisetval initshutdown killprocess lockws memdump monitor movecursor multiremote mutesysvolume nir.exefile param.paramname paramsfile qbox qboxcom rasdial rasdialdlg rashangup regdelkey regdelval regedit regsetval regsvr remote returnval screensaver script sendkey sendmouse service setcursor setdialuplogon setdisplay setfilefoldertime setfiletime setsysvolume setsysvolume2 setvolume shexec shortcut standby stdbeep sys.varname sysrefresh urlshortcut wait win' nircmd nircmd.exe NirCmd NirCmd.exe
complete -P plugin. -W 'load inslit add' bbCfg
complete -W 'add co checkout ci checkin admin diff' svn cvs

# todo.sh        {{{1
alias todo='/bin/todo.sh'
#alias 2do='sed -nr "s/^[ ]+(\[_\])/\1/p" ~/diary/*/*/*.cal|sort|uniq'
alias cal='cal -m'
alias when='/c/usr/perl/bin/perl.exe c:/usr/perl/site/bin/when.pl'
#complete -W 'add append archive del rm list ls do listall lsa listpri lsp prepend pri replace remdup report -d -f -p -' todo
source /etc/bash_completion.d/todo_completion.sh
complete -F _todo_sh -o default todo

alias mkisofs='mkisofs -D -U -J -iso-level 4 -jcharset cp1251 -hide-joliet-trans-tbl -nobak -duplicates-once'
alias cdrecord='cdrecord -overburn -tao dev=1,1,0 driveropts=burnfree'

# fortune        {{{1
# no need to recode output as we use cp1251 as console codepage with `chcp.com 1251`
#function fortune { /bin/fortune $* | enca -c -L ru -x ${LANG/*./} ;}
bind '"\e[24~":"fortune\C-M"'
# }}}

alias play='~/mplayer/mplayer.exe'
alias weather="curl -s http://informer.gismeteo.ru/text/26063-1.JS|sed -e 's/[^<]*//;s/[^>]*$//;s/\(<[^>]*>\)\{1,\}/\n/g'"

#alias ins="sudo apt-get install"
#alias tw="~/.bashrc.d/twitter.sh"

#function shexec    { $WINDIR/system32/rundll32.exe shell32.dll,ShellExec_RunDLL "$*";}
function google    { IFS='+'; start http://www.google.com/search\?q="$*";}
function gdef    { lynx -nomargins -nolist -force_html -display_charset=windows-1251 -dump "http://www.google.com/xhtml/search?q=define:$@";}

function log     { echo -e `date '+%Y-%m-%d %T'`"\t$*" >> ~/.log;}

function shexe    {
    if [[ $# -gt 1 ]]; then
        /c/bin/nircmd.exe shexec "$@"
    else
        /c/bin/nircmd.exe shexec open "$@"
    fi
}

# -----------------------------------
# Setup Windows ANSI codepage
if [ -n "$WINDIR" ]; then
    $WINDIR/system32/chcp.com 1251 > /dev/null
fi

LS_COLORS='no=00:fi=00:di=01;37:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.cmd=01;32:*.wsf=01;32:*.hta=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=0;32:*.jpe=0;32:*.jpeg=0;32:*.gif=0;32:*.bmp=0;32:*.pbm=0;32:*.pgm=0;32:*.ppm=0;32:*.tga=0;32:*.xbm=0;32:*.xpm=0;32:*.tif=0;32:*.tiff=0;32:*.png=0;32:*.eps=0;32:*.mpg=0;32:*.mpeg=0;32:*.avi=0;32:*.fli=0;32:*.gl=0;32:*.dl=0;32:*.xcf=0;32:*.xwd=0;32:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:*.m4a=01;35:*.o=01;33:*.c=01;33:*.cpp=01;33:*.h=01;33:*.hpp=01;33:*.java=01;33:*.sql=01;33:*.vbs=01;33:*.js=01;33:*Makefile=0;35:*.mk=00;35:*.diff=00;33:*tags=00;33:*~=01;30:*.swp=01;30:*README=00;31:*.tex=00;31:*.htm=00;31:*.html=00;31:*.xml=00;31:*.xsl=00;31:*readme=00;31:*.pdf=00;31:*.ps=00;31:*.dvi=00;31:';
export LS_COLORS
### EOF .bashrc
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License