-
Notifications
You must be signed in to change notification settings - Fork 2
/
.bashrc
50 lines (35 loc) · 1.07 KB
/
.bashrc
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
50
#!/bin/bash
configure_history() {
# Force multiline commands to one
shopt -s cmdhist
# Some history magic
shopt -s histappend
# On Disk buffersize
export HISTFILESIZE=100000
# Memort Buffer Size
export HISTSIZE=100000
# Commands to ignore
export HISTIGNORE="&:bg:fg:ls:ll"
# Add timestamps to the commands
export HISTTIMEFORMAT="(%F %T %Z) "
# Ignore whitespace and repeated commands
export HISTCONTROL=ignoreboth
}
save_history() {
history 1 | cut -c 8- >> $HOME/.history_repo/history.$(date +%Y%m)
}
configure_prompt() {
export GIT_PROMPT_THEME=Solarized
export GIT_PROMPT_SHOW_UPSTREAM=1
export GIT_PROMPT_SHOW_UNTRACKED_FILES=normal
export GIT_PROMPT_START_USER="_LAST_COMMAND_INDICATOR_ ${BoldMagenta}${PathShort}${ResetColor}"
export GIT_PROMPT_START_ROOT="_LAST_COMMAND_INDICATOR_ ${GIT_PROMPT_START_USER}"
}
# Load Hist config
configure_history
# Load the prompt configuration
configure_prompt
export PROMPT_COMMAND="save_history; $PROMPT_COMMAND"
# Make bash check its window size after a process completes
shopt -s checkwinsize
eval "$(jenv init -)"