* update .bashrc for useful options and aliases
authormitty <mitty@7d2118f6-f56c-43e7-95a2-4bb3031d96e7>
Tue, 17 Nov 2009 01:43:01 +0000 (01:43 +0000)
committermitty <mitty@7d2118f6-f56c-43e7-95a2-4bb3031d96e7>
Tue, 17 Nov 2009 01:43:01 +0000 (01:43 +0000)
git-svn-id: https://lab.mitty.jp/svn/lab/trunk@28 7d2118f6-f56c-43e7-95a2-4bb3031d96e7

.bashrc

diff --git a/.bashrc b/.bashrc
index bf4fff5..04038ca 100644 (file)
--- a/.bashrc
+++ b/.bashrc
@@ -91,3 +91,33 @@ fi
 if [ -f /etc/bash_completion ]; then
     . /etc/bash_completion
 fi
+
+umask 022   # create new file with '644'
+ulimit -c 0 # no dump core
+export PAGER=less
+export LESS='-X -i -P ?f%f:(stdin).  ?lb%lb?L/%L..  [?eEOF:?pb%pb\%..]'
+
+HISTSIZE=50000
+HISTFILESIZE=50000
+
+set -o notify   # notify end of background job immediately
+
+shopt -s histappend     # append command history instead of overwrite
+shopt -s checkhash      # check always PATH hash table
+shopt -s cmdhist        # save multi lines command to one line
+shopt -s no_empty_cmd_completion    # no complementation with no input
+shopt -s histverify     # check command history before execute
+
+
+# view last 30 history or search from last 1000 history
+function i {
+    if [ "$1" ]; then history 1000 | grep "$@"; else history 30; fi
+}
+
+# view last 30 history or search from all history
+function I {
+    if [ "$1" ]; then history | grep "$@"; else history 30; fi
+}
+
+alias vi='vim'
+alias sudo='sudo -H '