-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbashrc
88 lines (69 loc) · 3.05 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
############################################################################
# ALIASES #
############################################################################
if [ -f "$HOME/.aliases" ]; then
. "$HOME/.aliases"
fi
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
alias ll='ls -alhF'
alias la='ls -A'
alias l='ls -CF'
alias howmuch="du -hs"
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
############################################################################
# EXPORTS #
############################################################################
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
export VISUAL=vim
export EDITOR="$VISUAL"
export PIP_REQUIRE_VIRTUALENV=false
############################################################################
# HISTORY #
############################################################################
# don't put duplicate lines or lines starting with space in the history.
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
HISTTIMEFORMAT="%d.%m.%y %T "
############################################################################
# 3RD PARTY #
############################################################################
# Automatically adapt bash to window size
shopt -s checkwinsize
# Make less more friendly for non-text input files
[ -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
gpip(){
PIP_REQUIRE_VIRTUALENV="" pip "$@"
}
if [ -f /usr/share/autojump/autojump.sh ]; then
. /usr/share/autojump/autojump.sh
fi
if [ -f /usr/local/bin/brew ]; then
[[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh
fi
############################################################################
# PROMPT #
############################################################################
PROMPT_COMMAND='pwd2=$(sed "s:\([^/]\)[^/]*/:\1/:g" <<<$PWD)'
PS1='\[\e[01;30m\]\t \[\e[1;49;35m\]\u@\h \[\e[00;34m\]$pwd2 \[\e[00m\]\$ '