forked from acornejo/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sh.bash
37 lines (33 loc) · 1.04 KB
/
sh.bash
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
PS2="> "
PS4="+ "
PROMPT_COMMAND="history -a; $PROMPT_COMMAND"
if [ -z "${TERM##*xterm*}" ] || [ -z "${TERM##*screen*}" ]; then
# set prompt color to green
if [ "$(uname)" != "Darwin" ]; then
echo -ne '\e]12;#00ff00\a'
fi
# set term title
PROMPT_COMMAND="echo -ne \"\033]0;\$(shortpwd)\$(__git_prompt)\007\"; $PROMPT_COMMAND"
fi
# customize fzf keys
bind '"\C-g": " \C-e\C-u$(fcd)\e\C-e\er\C-m"'
# set history options
HISTIGNORE="&:?:??:???:exit"
HISTCONTROL="ignorespace:ignoredups:erasedups"
HISTFILESIZE=50000
HISTSIZE=50000
shopt -s histappend # append to history file
shopt -s cmdhist # allow multiline history cmds
shopt -s histreedit # edit history if cmd failed
shopt -s histverify # allow editing history command before executing
history_reload () {
local TEMP=$(mktemp -t history.XXXXX)
awk '! x[$0]++' $HISTFILE > $TEMP
mv $TEMP $HISTFILE
history -c
history -r
}
# customize bash completion
bind 'set completion-ignore-case on'
bind 'set menu-complete-display-prefix on'
bind 'set show-all-if-ambiguous on'