author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Sat, 13 Mar 2010 18:27:45 +0200 | |
changeset 27 | 55688ec975f9 |
parent 18 | 2e991b769c95 |
child 30 | 669c0e5c3f58 |
permissions | -rw-r--r-- |
11
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
1 |
|
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
2 |
# XXX |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
3 |
# [ -f /etc/bashrc ] && . /etc/bashrc |
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 for mc, cvs, svn, ... |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
6 |
# export EDITOR=vim |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
7 |
|
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
8 |
# XXX vim and gnome-terminal have support for 256 colours in fedora 8 at least |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
9 |
# Note debian/ubuntu users should install the ncurses-term package to support this |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
10 |
# export TERM=xterm-256color |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
11 |
|
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
12 |
# XXX highlight $HOST:$PWD prompt |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
13 |
# PS1='\[\e[1m\]\h:\w\$\[\e[0m\] ' |
17
e11e0adb941b
More verbose prompt, to prevent tangling with another shells.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
16
diff
changeset
|
14 |
PS1='bash# ' |
11
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
15 |
|
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
16 |
# Don't store duplicate adjacent items in the history. |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
17 |
# ignorespace do not save lines that start with space |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
18 |
# 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
|
19 |
# the history list before that line is saved |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
20 |
HISTCONTROL=igrorespace:erasedups |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
21 |
|
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
22 |
# Don't store noisy/dumb items. |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
23 |
HISTIGNORE=" ?cd *":"e *":"sudo mv *":"sudo rm *":"sudo cp *":"sudo mkdir *":"sudo chmod *":"sudo chown *":ls:pwd:"vlc*" |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
24 |
|
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
25 |
# 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
|
26 |
# HISTFILE=~/.bash_history # where is command history stored |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
27 |
# HISTFILESIZE=500 # how many lines been in $HISTFILE |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
28 |
# HISTSIZE=500 # how many lines been stored in bash process |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
29 |
|
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
30 |
# Can be XXX /visible. I like bell. |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
31 |
# set bell-style visible |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
32 |
|
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
33 |
|
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
34 |
# Adjust settings according to current terminal window width |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
35 |
# which may have changed while the last command was running |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
36 |
# (which is a common occurance for vim/less/etc.) |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
37 |
# 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
|
38 |
shopt -s checkwinsize |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
39 |
|
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
40 |
# Let me have core dumps |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
41 |
ulimit -c unlimited |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
42 |
|
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
43 |
|
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
44 |
####################################### |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
45 |
# shortcut aliases |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
46 |
####################################### |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
47 |
|
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
48 |
alias ..="cd .." #go to parent dir |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
49 |
alias ...="cd ../.." #go to grandparent dir |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
50 |
alias -- -="cd -" #go to previous dir |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
51 |
alias l.='ls -d .*' #list hidden files |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
52 |
alias ll='ls -lhrt' #extra info compared to "l" |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
53 |
alias lld='ls -lUd */' #list directories |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
54 |
|
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
55 |
# make and change to a directory |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
56 |
md () { mkdir -p "$1" && cd "$1"; } |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
57 |
|
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
58 |
# GREP_COLOR=bright yellow on black bg. |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
59 |
# use GREP_COLOR=7 to highlight whitespace on black terminals |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
60 |
# LANG=C for speed. See also: http://www.pixelbeat.org/scripts/findrepo |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
61 |
# alias grep='GREP_COLOR="1;33;40" LANG=C grep --color=auto' |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
62 |
|
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
63 |
# alias ls="BLOCK_SIZE=\'1 ls --color=auto" #enable thousands grouping and colour |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
64 |
# alias minicom='minicom -c on' #enable colour |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
65 |
# alias cal='cal -3' #show 3 months by default |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
66 |
# alias units='units -t' #terse mode |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
67 |
# 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
|
68 |
# alias lynx='lynx -force_html -width=$COLUMNS' #best settings for viewing HTML |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
69 |
# alias links='links -force-html' #need to enable colour in config menu manually |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
70 |
# alias xterm='xterm -fb "" -bg black -fg gray -fa "Sans Mono" -fs 10 +sb -sl 3000 -g 80x50+1+1' |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
71 |
# 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
|
72 |
# 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
|
73 |
# alias gdb='gdb -tui' #enable the text window interface if possible |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
74 |
|
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
75 |
# what most people want from od (hexdump) |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
76 |
# alias hd='od -Ax -tx1z -v' |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
77 |
|
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
78 |
# canonicalize path (including resolving symlinks) |
339675ac5fd3
Base version of .bashrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
79 |
# alias realpath='readlink -f' |