-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.bashrc
73 lines (61 loc) · 2.17 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
case $- in
*i*) ;;
*) return;;
esac
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
check_color_support ()
{
if [ "$TERM" == "xterm-color" ]; then
return 0
fi
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
return 0
fi
}
if [ check_color_support ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
# If this is an xterm set the title to user@host:dir
if [ "$TERM" == "xterm*" -o "$TERM" == "rxvt*" ]; then
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
fi
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /etc/bash_completion ]; then
source /etc/bash_completion
fi
if [ -f /usr/share/bash-completion/bash_completion ]; then
source /usr/share/bash-completion/bash_completion
fi
fi
moreSources=~/.bash/source/rc/*.sh
if stat -t $moreSources >/dev/null 2>&1; then
for f in $moreSources; do source $f; done
fi
# TMUX
if which tmux >/dev/null 2>&1; then
#if not inside a tmux session, and if no session is started, start a new session
test -z "$TMUX" && tmux -u new-session
fi
# Set bash mode as vi on new bash instance
set -o vi
export HISTCONTROL=ignoredups:erasedups # no duplicate entries
export HISTSIZE=10000 # big big history
export HISTFILESIZE=10000 # big big history
shopt -s histappend # append to history, don't overwrite it
# Save and reload the history after each command finishes
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
# Rust
export RUSTC_WRAPPER=sccache