source: lab.git/TipAndDoc/.bashrc @ a53ff5b

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

update bashrc

  • Property mode set to 100644
File size: 1.4 KB
Line 
1
2umask 022   # create new file with '644'
3ulimit -c 0 # no dump core
4export PAGER=less
5export LESS='-FRX -i -P ?f%f:(stdin).  ?lb%lb?L/%L..  [?eEOF:?pb%pb\%..]'
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
14
15
16# view last 30 history or search from last 1000 history
17function i {
18    if [ "$1" ]; then history 1000 | grep "$@"; else history 30; fi
19}
20
21# view last 30 history or search from all history
22function I {
23    if [ "$1" ]; then history | grep "$@"; else history 30; fi
24}
25
26if [ -f /usr/share/git/completion/git-prompt.sh ]; then
27    source /usr/share/git/completion/git-prompt.sh
28    export PS1='\u@\h:\w$(__git_ps1)\$ '
29else
30    export PS1='\u@\h:\w\$ '
31fi
32
33agent="$HOME/.ssh/ssh-agent-$USER"
34if [ -S "$SSH_AUTH_SOCK" ]; then
35    case $SSH_AUTH_SOCK in
36    /tmp/*/agent.[0-9]*)
37        ln -snf "$SSH_AUTH_SOCK" $agent && export SSH_AUTH_SOCK=$agent
38    esac
39elif [ -S $agent ]; then
40    export SSH_AUTH_SOCK=$agent
41else
42    echo "no ssh-agent"
43fi
44
45if [ -d "$HOME/bin" ]; then
46    PATH="$HOME/bin:$PATH"
47fi
48
49alias vi='vim'
50alias sudo='sudo -H '
51alias rm='rm -v'
52alias screen='screen -U -R'
53alias mv='mv -i'
54alias cp='cp -i'
Note: See TracBrowser for help on using the repository browser.