-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbashrc.bash
More file actions
36 lines (28 loc) · 830 Bytes
/
bashrc.bash
File metadata and controls
36 lines (28 loc) · 830 Bytes
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
export EDITOR=vim
function csvview { column -s, -tn < "$1"; }
export -f csvview
function csvless { column -s, -t < "$1" | less -#2 -N -S; }
export -f csvless
#some git niceness
alias gitv="git --no-pager log --graph --full-history --all --color --date=short --date-order --pretty=format:\"%Cred%x09%h %Creset%ad%Cblue%d %Creset %s %C(bold)(%an)%Creset\" | head"
export LESS=R
function timer_start {
timer=${timer:-$SECONDS}
}
function timer_stop {
cmdtime=$(($SECONDS - $timer))
if (( $cmdtime > 10 )); then
timer_show="[${cmdtime}s]"
else
timer_show=""
fi
unset timer
}
trap 'timer_start' DEBUG
PROMPT_COMMAND=timer_stop
# Shorthand for trash
alias t=trash
export PS1='\[\e[1;91m\]${timer_show}\[\e[1;32m\]<\t>\h:\w$\[\e[0m\] '
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi