source: lab.git/TipAndDoc/.bashrc

Last change on this file was 3c848da, checked in by Ken-ichi Mito <mitty@…>, 6 years ago

append a session's history on shell exit and unlimited history list

  • Property mode set to 100644
File size: 1.5 KB
RevLine 
[e5094b1]1
2umask 022   # create new file with '644'
3ulimit -c 0 # no dump core
4export PAGER=less
[b949a0f]5export LESS='-FRX -i -P ?f%f:(stdin).  ?lb%lb?L/%L..  [?eEOF:?pb%pb\%..]'
[e5094b1]6
7set -o notify   # notify end of background job immediately
8
9shopt -s histappend     # append command history instead of overwrite
10shopt -s checkhash      # check always PATH hash table
11shopt -s cmdhist        # save multi lines command to one line
12shopt -s no_empty_cmd_completion    # no complementation with no input
13shopt -s histverify     # check command history before execute
[3c848da]14shopt -s histappend
15
16# unlimited history list
17export HISTFILESIZE=-1
18export HISTSIZE=-1
[e5094b1]19
20
21# view last 30 history or search from last 1000 history
22function i {
23    if [ "$1" ]; then history 1000 | grep "$@"; else history 30; fi
24}
25
26# view last 30 history or search from all history
27function I {
28    if [ "$1" ]; then history | grep "$@"; else history 30; fi
29}
30
[ddb1335]31if [ -f /usr/share/git/completion/git-prompt.sh ]; then
32    source /usr/share/git/completion/git-prompt.sh
33    export PS1='\u@\h:\w$(__git_ps1)\$ '
[b949a0f]34else
[ddb1335]35    export PS1='\u@\h:\w\$ '
[b949a0f]36fi
37
[a53ff5b]38agent="$HOME/.ssh/ssh-agent-$USER"
39if [ -S "$SSH_AUTH_SOCK" ]; then
40    case $SSH_AUTH_SOCK in
41    /tmp/*/agent.[0-9]*)
42        ln -snf "$SSH_AUTH_SOCK" $agent && export SSH_AUTH_SOCK=$agent
43    esac
44elif [ -S $agent ]; then
45    export SSH_AUTH_SOCK=$agent
46else
47    echo "no ssh-agent"
48fi
49
50if [ -d "$HOME/bin" ]; then
51    PATH="$HOME/bin:$PATH"
52fi
53
[e5094b1]54alias vi='vim'
55alias sudo='sudo -H '
[d1c9ece]56alias rm='rm -v'
[e024caf]57alias screen='screen -U -R'
[adaba09]58alias mv='mv -i'
59alias cp='cp -i'
Note: See TracBrowser for help on using the repository browser.