.bashrc
author Oleksandr Gavenko <gavenkoa@gmail.com>
Tue, 13 Nov 2012 19:01:48 +0200
changeset 589 e1812451b4f8
parent 586 5b1adc5f0669
child 594 521916a26ee2
permissions -rw-r--r--
Fix syntax error.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
250
405b343c1214 Add remainder how debug.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 242
diff changeset
     1
405b343c1214 Add remainder how debug.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 242
diff changeset
     2
# set -x
405b343c1214 Add remainder how debug.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 242
diff changeset
     3
# set -u
11
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     4
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     5
# XXX
265
acd29a6e6d8d Use bash built-in 'test' command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 264
diff changeset
     6
# [[ -f /etc/bashrc ]] && . /etc/bashrc
11
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     7
586
5b1adc5f0669 Use ISO date format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 578
diff changeset
     8
TIME_STYLE=long-iso
5b1adc5f0669 Use ISO date format.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 578
diff changeset
     9
480
4d0ff0dfdeb9 Rename '.bash_path' to '.bashenv'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 477
diff changeset
    10
if [[ -f ~/.bashenv ]]; then
4d0ff0dfdeb9 Rename '.bash_path' to '.bashenv'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 477
diff changeset
    11
  . ~/.bashenv
282
3710f0a122cd Load PATH settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 280
diff changeset
    12
fi
3710f0a122cd Load PATH settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 280
diff changeset
    13
17
e11e0adb941b More verbose prompt, to prevent tangling with another shells.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 16
diff changeset
    14
PS1='bash# '
182
af9e9693646e Set magenta bold font.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 181
diff changeset
    15
# Set magenta bold font.
af9e9693646e Set magenta bold font.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 181
diff changeset
    16
case "$TERM" in
491
1f952c2d0135 Use coloured prompt under Emacs term-mode.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 483
diff changeset
    17
  xterm*|eterm-color)
244
64924a7c3689 Colorize PS2.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 241
diff changeset
    18
    PS1='\[\033[31m\033[1m\]\h\[\033[35m\]+bash# \[\033[0m\]'
64924a7c3689 Colorize PS2.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 241
diff changeset
    19
    PS2='\[\033[32m\]> \[\033[0m\]'
182
af9e9693646e Set magenta bold font.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 181
diff changeset
    20
  ;;
af9e9693646e Set magenta bold font.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 181
diff changeset
    21
esac
11
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    22
576
3d5ba8711141 Add current dir to xterm title.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 565
diff changeset
    23
# Add current dir to xterm title.
3d5ba8711141 Add current dir to xterm title.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 565
diff changeset
    24
case "$TERM" in
578
c4ed974c79ce Add user and host info to xterm title.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 576
diff changeset
    25
  xterm*) PS1='\[\033]0;\u@\h+bash: \w\007\]'$PS1 ;;
576
3d5ba8711141 Add current dir to xterm title.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 565
diff changeset
    26
esac
3d5ba8711141 Add current dir to xterm title.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 565
diff changeset
    27
304
c6ae628708d5 Enable dircolors. Check for 'dircolors' command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 300
diff changeset
    28
if command -v dircolors >/dev/null 2>&1 && [[ -f ~/.dircolors ]]; then
c6ae628708d5 Enable dircolors. Check for 'dircolors' command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 300
diff changeset
    29
  eval "`dircolors -b ~/.dircolors`"
c6ae628708d5 Enable dircolors. Check for 'dircolors' command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 300
diff changeset
    30
fi
208
ba6619e43b22 Add '.dircolors' but don't enable it.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 193
diff changeset
    31
482
3860547a5594 Set HISTTIMEFORMAT to force Bash to store timestamp.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 481
diff changeset
    32
# Can be XXX /visible. I like bell.
3860547a5594 Set HISTTIMEFORMAT to force Bash to store timestamp.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 481
diff changeset
    33
# set bell-style visible
3860547a5594 Set HISTTIMEFORMAT to force Bash to store timestamp.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 481
diff changeset
    34
11
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    35
# Don't store duplicate adjacent items in the history.
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    36
#   ignorespace     do not save lines that start with space
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    37
#   erasedups       all previous lines matching the current line to be removed from
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    38
#                   the history list before that line is saved
481
9b1b0a64635b Fix old sad typo.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 480
diff changeset
    39
HISTCONTROL=ignorespace:erasedups
11
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    40
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    41
# Don't store noisy/dumb items.
104
653e4ea98ff9 Exclude 'cd' command from history which comes from MC.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 93
diff changeset
    42
# TIP: MC command start with space.
107
43f69ef5ec58 Remove ? from patterns as I previously incorrectly understand its meaning.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 106
diff changeset
    43
HISTIGNORE=\
294
91a01838d930 Remember 'cd ..' commands.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 290
diff changeset
    44
" cd *":\
107
43f69ef5ec58 Remove ? from patterns as I previously incorrectly understand its meaning.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 106
diff changeset
    45
"e *":\
43f69ef5ec58 Remove ? from patterns as I previously incorrectly understand its meaning.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 106
diff changeset
    46
"sudo mv *":"sudo rm *":"sudo cp *":"sudo mkdir *":"sudo chmod *":"sudo chown *":\
43f69ef5ec58 Remove ? from patterns as I previously incorrectly understand its meaning.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 106
diff changeset
    47
"vlc *":ls:pwd
11
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    48
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    49
# To these options assigned default value, as they satisfy my needs I comment them.
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    50
# HISTFILE=~/.bash_history  # where is command history stored
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    51
# HISTFILESIZE=500          # how many lines been in $HISTFILE
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    52
# HISTSIZE=500              # how many lines been stored in bash process
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    53
482
3860547a5594 Set HISTTIMEFORMAT to force Bash to store timestamp.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 481
diff changeset
    54
HISTTIMEFORMAT="%F %T "
11
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    55
171
47aa0a6acc75 Make Bash append rather than overwrite the history.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 168
diff changeset
    56
# Make Bash append rather than overwrite the history.
47aa0a6acc75 Make Bash append rather than overwrite the history.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 168
diff changeset
    57
shopt -s histappend
47aa0a6acc75 Make Bash append rather than overwrite the history.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 168
diff changeset
    58
193
2e4cebaae3cc histreedit histverify
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 182
diff changeset
    59
shopt -s histreedit
2e4cebaae3cc histreedit histverify
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 182
diff changeset
    60
shopt -s histverify
2e4cebaae3cc histreedit histverify
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 182
diff changeset
    61
483
f02dbcb71260 Technique to share command history across Bash secctions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 482
diff changeset
    62
# Technique to share command history across Bash secctions.
f02dbcb71260 Technique to share command history across Bash secctions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 482
diff changeset
    63
# Just run:
f02dbcb71260 Technique to share command history across Bash secctions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 482
diff changeset
    64
#   history -n
f02dbcb71260 Technique to share command history across Bash secctions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 482
diff changeset
    65
# to reload history.
f02dbcb71260 Technique to share command history across Bash secctions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 482
diff changeset
    66
# This setting automatically update history file, but ignore HISTCONTROL=erasedups settings.
f02dbcb71260 Technique to share command history across Bash secctions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 482
diff changeset
    67
# PROMPT_COMMAND='history -a'
f02dbcb71260 Technique to share command history across Bash secctions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 482
diff changeset
    68
28
da6841fb89e9 Minor errors in the spelling of a directory component in a cd command will be corrected.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 16
diff changeset
    69
# Minor errors in the spelling of a directory component in a cd command will
da6841fb89e9 Minor errors in the spelling of a directory component in a cd command will be corrected.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 16
diff changeset
    70
# be corrected.
da6841fb89e9 Minor errors in the spelling of a directory component in a cd command will be corrected.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 16
diff changeset
    71
shopt -s cdspell
11
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    72
43
6c53a61678d7 Added useful bash settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    73
# Save all lines of a multiple-line command in the same history entry.
6c53a61678d7 Added useful bash settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    74
shopt -s cmdhist
6c53a61678d7 Added useful bash settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    75
6c53a61678d7 Added useful bash settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    76
# Allows files beginning with a dot ('.') to be returned in the results of path-name expansion.
6c53a61678d7 Added useful bash settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    77
shopt -s dotglob
6c53a61678d7 Added useful bash settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 42
diff changeset
    78
168
0371cfe5a8f5 ksh-88 egrep-style extended pattern matching .
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 157
diff changeset
    79
# ksh-88 egrep-style extended pattern matching.
0371cfe5a8f5 ksh-88 egrep-style extended pattern matching .
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 157
diff changeset
    80
shopt -s extglob
0371cfe5a8f5 ksh-88 egrep-style extended pattern matching .
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 157
diff changeset
    81
11
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    82
# Adjust settings according to current terminal window width
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    83
# which may have changed while the last command was running
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    84
# (which is a common occurance for vim/less/etc.)
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    85
# Note this is already set in /etc/bashrc on Fedora 8 at least.
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    86
shopt -s checkwinsize
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    87
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    88
# Let me have core dumps
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    89
ulimit -c unlimited
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    90
44
e4703f904e4b Use bash-completion, if available.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 43
diff changeset
    91
################################################################
11
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    92
# shortcut aliases
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    93
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    94
alias ..="cd .."        #go to parent dir
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    95
alias ...="cd ../.."    #go to grandparent dir
109
40feef132306 Fix "alias: --: неправильная опция".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 107
diff changeset
    96
alias -- -="cd -"       # go to previous dir
11
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    97
alias l.='ls -d .*'     #list hidden files
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    98
alias ll='ls -lhrt'     #extra info compared to "l"
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    99
alias lld='ls -lUd */'  #list directories
231
84c9533f2675 I prefer EN man pages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 230
diff changeset
   100
# I prefer EN man pages.
84c9533f2675 I prefer EN man pages.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 230
diff changeset
   101
alias man='LANG=C man'
11
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   102
251
30e947dddaa3 Shorter alias for jobs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 250
diff changeset
   103
alias j='jobs '
565
de7293aa414f Add alias for opening current directory in Emacs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 491
diff changeset
   104
alias e.='e .'
251
30e947dddaa3 Shorter alias for jobs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 250
diff changeset
   105
11
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   106
# make and change to a directory
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   107
md () { mkdir -p "$1" && cd "$1"; }
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   108
305
72032902cdd1 Enable colours for 'ls' and 'grep'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 304
diff changeset
   109
# LANG=C for speed.
72032902cdd1 Enable colours for 'ls' and 'grep'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 304
diff changeset
   110
alias grep='GREP_COLOR="31;47" LANG=C grep -n --color=auto'
72032902cdd1 Enable colours for 'ls' and 'grep'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 304
diff changeset
   111
alias ls='ls --color=auto'
306
d669711ea6b1 Cleanup aliases.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 305
diff changeset
   112
alias minicom='minicom -c on'
11
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   113
308
8b7a40575cdb Weeks start on Monday.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 306
diff changeset
   114
# Show 3 months. Weeks start on Monday.
309
d98ee1ad029c Add ncal as cal try be compatible with old and week can not start from Monday.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 308
diff changeset
   115
alias cal='cal -3'
d98ee1ad029c Add ncal as cal try be compatible with old and week can not start from Monday.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 308
diff changeset
   116
alias ncal='ncal -3 -M'
306
d669711ea6b1 Cleanup aliases.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 305
diff changeset
   117
11
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   118
# alias diff='LC_ALL=C TZ=GMT0 diff -Naur' #normalise diffs for distribution
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   119
# alias sudo='sudo env PATH=$PATH' #work around sudo built --with-secure-path (ubuntu)
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   120
# alias vim='vim -X' #don't try to contact xserver (which can hang on network issues)
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   121
# alias gdb='gdb -tui' #enable the text window interface if possible
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   122
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   123
# what most people want from od (hexdump)
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   124
# alias hd='od -Ax -tx1z -v'
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   125
57
99d0eb7974d6 Remove --comment-delimiters-on-blank-lines option from indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 45
diff changeset
   126
# --blank-lines-after-procedures --break-before-boolean-operator --braces-on-if-line --braces-on-struct-decl-line
99d0eb7974d6 Remove --comment-delimiters-on-blank-lines option from indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 45
diff changeset
   127
# --comment-indentationn --space-after-cast --line-comments-indentationn --declaration-indentationn --honour-newlines
99d0eb7974d6 Remove --comment-delimiters-on-blank-lines option from indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 45
diff changeset
   128
# --no-space-after-function-call-names --no-tabs --struct-brace-indentationn --start-left-side-of-comments
99d0eb7974d6 Remove --comment-delimiters-on-blank-lines option from indent.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 45
diff changeset
   129
alias indent-bifit="indent -bap -bbo -br -brs -cdw -ce -cli0 -c0 -cs -d0 -di0 -hnl -l120 -lc90 -i4 -npcs -ppi 3 -npsl -nut -sbi4 -sc"
45
5c94d2613433 Added alias for reindent code for our job rules.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 44
diff changeset
   130
11
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   131
# canonicalize path (including resolving symlinks)
339675ac5fd3 Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   132
# alias realpath='readlink -f'
32
031655c93305 Special case for CYGWIN to properly display russian letters in rxvt.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 30
diff changeset
   133
469
83c0cf64c18d Fix lang under X.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 449
diff changeset
   134
# Fix lang under X.
477
d0c29482707d Switch to kbdd program for manage input method.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 469
diff changeset
   135
alias en="dbus-send --dest=ru.gentoo.KbddService /ru/gentoo/KbddService ru.gentoo.kbdd.set_layout uint32:0"
d0c29482707d Switch to kbdd program for manage input method.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 469
diff changeset
   136
alias ут="dbus-send --dest=ru.gentoo.KbddService /ru/gentoo/KbddService ru.gentoo.kbdd.set_layout uint32:0"
469
83c0cf64c18d Fix lang under X.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 449
diff changeset
   137
150
18b75d04721b Add Completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 127
diff changeset
   138
################################################################
174
f862e6d84d02 Move key binding as dabbrev-expand defined only in bash.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 171
diff changeset
   139
# Key binding.
f862e6d84d02 Move key binding as dabbrev-expand defined only in bash.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 171
diff changeset
   140
176
88a4aa7a6e7c set -o emacs
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 174
diff changeset
   141
set -o emacs
88a4aa7a6e7c set -o emacs
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 174
diff changeset
   142
174
f862e6d84d02 Move key binding as dabbrev-expand defined only in bash.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 171
diff changeset
   143
bind '"\e/": dabbrev-expand'
179
ed15e30ff41a Set editor to VIM. Bind edit command for shells.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 176
diff changeset
   144
bind '"\ee": edit-and-execute-command'
174
f862e6d84d02 Move key binding as dabbrev-expand defined only in bash.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 171
diff changeset
   145
f862e6d84d02 Move key binding as dabbrev-expand defined only in bash.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 171
diff changeset
   146
################################################################
150
18b75d04721b Add Completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 127
diff changeset
   147
# Completion.
18b75d04721b Add Completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 127
diff changeset
   148
283
eb383cf7ba80 Move completions to separate file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 282
diff changeset
   149
# Use system wide completion, if available.
284
3351fda649d5 Switch to Bash built-in 'test' command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 283
diff changeset
   150
if [[ -f /etc/bash_completion ]]; then
283
eb383cf7ba80 Move completions to separate file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 282
diff changeset
   151
  # Under Cygwin bash completition take a long time for starting.
284
3351fda649d5 Switch to Bash built-in 'test' command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 283
diff changeset
   152
  if [[ ! $OSTYPE = cygwin ]]; then
240
62bea4f80160 Take more priority for 'bash_completion' instead my completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 239
diff changeset
   153
    . /etc/bash_completion
62bea4f80160 Take more priority for 'bash_completion' instead my completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 239
diff changeset
   154
  fi
284
3351fda649d5 Switch to Bash built-in 'test' command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 283
diff changeset
   155
elif [[ -f ~/usr/etc/bash_completion ]]; then
3351fda649d5 Switch to Bash built-in 'test' command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 283
diff changeset
   156
  . ~/usr/etc/bash_completion
240
62bea4f80160 Take more priority for 'bash_completion' instead my completion.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 239
diff changeset
   157
fi
283
eb383cf7ba80 Move completions to separate file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 282
diff changeset
   158
# Load local completions.
284
3351fda649d5 Switch to Bash built-in 'test' command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 283
diff changeset
   159
if [[ -f ~/.bash_completion ]]; then
283
eb383cf7ba80 Move completions to separate file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 282
diff changeset
   160
  . ~/.bash_completion
eb383cf7ba80 Move completions to separate file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 282
diff changeset
   161
fi
284
3351fda649d5 Switch to Bash built-in 'test' command.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 283
diff changeset
   162
if [[ -d ~/.bash_completion.d ]]; then
283
eb383cf7ba80 Move completions to separate file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 282
diff changeset
   163
  for f in ~/.bash_completion.d/* ~/.bash_completion.d/.*; do
290
e19be6298b09 Fix error: "bash: .: /cygdrive/d/home/.bash_completion.d/..: является директорией"
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 284
diff changeset
   164
    [[ -f "$f" ]] && . "$f"
283
eb383cf7ba80 Move completions to separate file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 282
diff changeset
   165
  done
eb383cf7ba80 Move completions to separate file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 282
diff changeset
   166
fi
eb383cf7ba80 Move completions to separate file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 282
diff changeset
   167
449
63fe7a1ebae4 Load custom settings (user editable).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 309
diff changeset
   168
################################################################
63fe7a1ebae4 Load custom settings (user editable).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 309
diff changeset
   169
# Load custom settings (user editable).
63fe7a1ebae4 Load custom settings (user editable).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 309
diff changeset
   170
# Placed to the end to allow override skel settings.
63fe7a1ebae4 Load custom settings (user editable).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 309
diff changeset
   171
63fe7a1ebae4 Load custom settings (user editable).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 309
diff changeset
   172
if [[ -f ~/.bash_custom ]]; then
63fe7a1ebae4 Load custom settings (user editable).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 309
diff changeset
   173
  . ~/.bash_custom
63fe7a1ebae4 Load custom settings (user editable).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 309
diff changeset
   174
fi
63fe7a1ebae4 Load custom settings (user editable).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 309
diff changeset
   175