forked from syscools/commandline
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmybashrc
More file actions
executable file
·50 lines (44 loc) · 1.26 KB
/
mybashrc
File metadata and controls
executable file
·50 lines (44 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
if (($(echo $BASH_VERSION |cut -d'.' -f2)>=3));then
export HISTFILESIZE=-1 HISTSIZE=-1
a="[1;31m"
b="[0;36m"
c="[1;34m"
p="\342\224\214"
q="\342\224\200"
r="\342\224\224"
E="\e"
. ~/src/commandline/git-prompt.sh
#export PS1="\[$E$b\]$p$q[\$?\[$E$c\]|\[$E$b\]\$msgcount\[$E$b\]]$q\[$E$b\][\$(__git_ps1)]$q<\[$E$b\]\h:\[$E$c\]\w\[$E$b\]>\n$r\[$E$b\]"
export PS1="\[$E$b\]$p$q[\$?\[$E$c\]|\[$E$b\]\$msgcount\[$E$b\]]$q\[$E$b\][\$(__git_ps1)]$q<\h:\[$E$b\]\[$E$c\]\w\[$E$b\]>\n$r\[$E$b\]"
else
export HISTFILESIZE=400000000
export HISTSIZE=10000
fi
mkdir ~/bash_history/ 2>/dev/null || true
HISTCONTROL=ignoreboth
export HISTIGNORE="&:ls:[bf]g:exit:pwd:clear:history:mount:umount:[ \t]*"
PROMPT_COMMAND="history -a;history -n;notif"
HISTFILE=~/bash_history/$(date +%Y-%m)
shopt -s histappend
notif() {
# asynchronous messages goes to this file
f=~/inbox
if [ -f $f ];then
msgcount=$(wc -l < $f)
else
unset msgcount
fi
}
HISTORY() {
[ $# -eq 0 ] && return
grep $1 ~/bash_history/*
}
alias od='od -w32 --endian=big -t x1z'
# let the user decide
#if [ -z "$TMUX" ];then
# if tmux ls 2>/dev/null; then
# tmux attach -t "main"
# else
# tmux new-session -s "main"
# fi
#fi