~ mitry
/.bashrc
# @(#) ~mitry/.bashrc - user specific aliases and functions
# $Id: .bashrc,v b6ff4764027d 2008/09/05 05:27:55 dmitry $
# -----------------------------------
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# Source global definitions
[ -r /etc/bashrc ] && . /etc/bashrc
# Load aliases
[ -r ~/.bash_aliases ] && . ~/.bash_aliases
# -----------------------------------
# Enviroment: {{{1
# Colored prompt:
#export PS1='\[\e[1;35m\]\u\[\e[1;33m\]@\[\e[1;34m\]\h\[\e[1;32m\] \w\n\[\e[1;33m\]\$\[\e[m\] '
# escape-последовательности XTerm
# \e]0;строка\a -- Устанавливает строку в качестве имени иконки и заголовка окна
# \e]1;строка\a -- Устанавливает имя иконки
# \e]2;строка\a -- Устанавливает текст заголовка окна
PS1="\[\e]0;\u@\h: \w - Bash (\#/\!:\j)\a\e[1;33m\]\$\[\e[m\] "
CDPATH='.:~:~/src:/usr/scr:~/Download'
#export HISTIGNORE="&:ls:ls *:history*:mutt:[bf]g:exit:cls:*--help"
HISTIGNORE="&:ls:mutt:[bf]g:exit:bye:cls:*--help"
TMOUT=0 # Don't exit because of inactivity
HISTCONTROL="ignoreboth" # lines which begin with a space character &
# lines matching the last history line are not
# entered on the history list.
#HISTTIMEFORMAT='%F %T' #
HISTTIMEFORMAT='%m-%d %H:%M:%S | '
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"
BROWSER="$WINDIR/system32/rundll32.exe shell32.dll,ShellExec_RunDLL"
export 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:';
: ${DISPLAY:=0:0} && export DISPLAY
## Получать уведомления о появлении новой почты в любом ящике в ~/Mail.
#MAILPATH=/var/spool/mail/$USER
#for i in `echo ~/Mail/[^.]*`
#do
# MAILPATH=$MAILPATH:$i
#done
#export MAILPATH
#unset i
## -----------------------------------
## KeyBindings: {{{1
# bind -x '\e[21~':'exit'
# bind -x '\e[[A':'start /c/usr/doc/GNU/bashref-2.05b.chm\C-m'
# bind '"\e[24~":"fortune\C-M"'
## Hack to map F10 to exit (\201 - any unused key)
## @see http://groups.google.com/group/comp.unix.shell/msg/3b7baccfdfa997c0
# bind -x '"\201":exit'
# bind '"\e[21~":"\201"'
## -----------------------------------
## Shell Options: {{{1
## Don't use autocomplete for host names:
shopt -u hostcomplete
shopt -s cdspell cmdhist histappend nocaseglob no_empty_cmd_completion
## -----------------------------------
## 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
## -----------------------------------
## Completion: {{{1
[ -r /etc/bash_completion.d/todo_completion.sh ] && . /etc/bash_completion.d/todo_completion.sh
complete -F _todo_sh -o default todo
#complete -W 'add append archive del rm list ls do listall lsa listpri lsp prepend pri replace remdup report -d -f -p -' todo
## -----------------------------------
## Functions: {{{1
function google { IFS='+'; command lynx -nolist -force_html -display_charset=windows-1251 -dump http://www.google.com/search\?q="$*" ;}
function gdef { google "define:$@" ;}
function gluck { google "$@&btnI=1" ;}
function log { echo -e `date '+%Y-%m-%d %T'`"\t$*" >> ~/.log;}
#function shexec { $WINDIR/system32/rundll32.exe shell32.dll,ShellExec_RunDLL "$*";}
function shexe {
if [[ $# -gt 1 ]]; then
/c/bin/nircmd.exe shexec "$@"
else
/c/bin/nircmd.exe shexec open "$@"
fi
}
# -----------------------------------
# Setup Windows ANSI codepage {{{1
if [ -n "$WINDIR" ]; then
$WINDIR/system32/chcp.com 1251 > /dev/null
fi
### }}}
### EOF ~/.bashrc