-
Notifications
You must be signed in to change notification settings - Fork 7
/
.bashrc.local
executable file
·149 lines (127 loc) · 3.71 KB
/
.bashrc.local
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=40000
HISTFILESIZE=80000
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# mkdir and ls in one command
md () { mkdir -p "$@" && cd "$_"; }
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
if test "$(type -p gnome-terminal)" != '' ; then
alias terminal='gnome-terminal &'
fi
if test "$(type -p vim)" != '' ; then
alias vi='vim -p'
fi
# git aliases
alias gc='git commit'
alias gca='git commit -a'
alias gcam='git commit -a -m'
alias gl='git log'
# gs is sometimes used because of 'Ghostscript', but overwrite it anyway
alias gs='git status'
alias gd='git diff'
alias ga='git add'
alias gu='git push'
alias gp='git pull'
alias gb='git branch'
#set -o vi
export EDITOR=vi
# python startup
export PYTHONSTARTUP="$(python -m jedi repl 2>/dev/null)"
# py.test watch
function pywatch() {
# Substract the header lines of watch
l=$(expr $LINES - 2)
watch -n 1 --color sh -c $(echo "'"'py.test --color=yes '$@' | tail -n '$l"'")
}
# define console colors
# Reset
Color_Off='\e[0m' # Text Reset
# Regular Colors
Black='\e[0;30m' # Black
Red='\e[0;31m' # Red
Green='\e[0;32m' # Green
Yellow='\e[0;33m' # Yellow
Blue='\e[0;34m' # Blue
Purple='\e[0;35m' # Purple
Cyan='\e[0;36m' # Cyan
White='\e[0;37m' # White
# Bold
BBlack='\e[1;30m' # Black
BRed='\e[1;31m' # Red
BGreen='\e[1;32m' # Green
BYellow='\e[1;33m' # Yellow
BBlue='\e[1;34m' # Blue
BPurple='\e[1;35m' # Purple
BCyan='\e[1;36m' # Cyan
BWhite='\e[1;37m' # White
# Underline
UBlack='\e[4;30m' # Black
URed='\e[4;31m' # Red
UGreen='\e[4;32m' # Green
UYellow='\e[4;33m' # Yellow
UBlue='\e[4;34m' # Blue
UPurple='\e[4;35m' # Purple
UCyan='\e[4;36m' # Cyan
UWhite='\e[4;37m' # White
# Background
On_Black='\e[40m' # Black
On_Red='\e[41m' # Red
On_Green='\e[42m' # Green
On_Yellow='\e[43m' # Yellow
On_Blue='\e[44m' # Blue
On_Purple='\e[45m' # Purple
On_Cyan='\e[46m' # Cyan
On_White='\e[47m' # White
# High Intensty
IBlack='\e[0;90m' # Black
IRed='\e[0;91m' # Red
IGreen='\e[0;92m' # Green
IYellow='\e[0;93m' # Yellow
IBlue='\e[0;94m' # Blue
IPurple='\e[0;95m' # Purple
ICyan='\e[0;96m' # Cyan
IWhite='\e[0;97m' # White
# Bold High Intensty
BIBlack='\e[1;90m' # Black
BIRed='\e[1;91m' # Red
BIGreen='\e[1;92m' # Green
BIYellow='\e[1;93m' # Yellow
BIBlue='\e[1;94m' # Blue
BIPurple='\e[1;95m' # Purple
BICyan='\e[1;96m' # Cyan
BIWhite='\e[1;97m' # White
# High Intensty backgrounds
On_IBlack='\e[0;100m' # Black
On_IRed='\e[0;101m' # Red
On_IGreen='\e[0;102m' # Green
On_IYellow='\e[0;103m' # Yellow
On_IBlue='\e[0;104m' # Blue
On_IPurple='\e[10;95m' # Purple
On_ICyan='\e[0;106m' # Cyan
On_IWhite='\e[0;107m' # White
# define prompt color
# export PS1='\u@\h:\w\$ ' # default
export PS1="\[$Cyan\]\u\[$Green\]@\h\[$Color_Off\]:\w\$ "
alias mp3-dl="youtube-dl --extract-audio --audio-format mp3"
alias wetter="curl wttr.in/Zurich"
tomp3 ()
{
ffmpeg -i "$1" -vn -ar 44100 -ac 2 -b:a 192k "$(basename "$1" .wav)".mp3
}
mp3toogg ()
{
ffmpeg -i "$1" -c:a libvorbis -q:a 4 "$(basename "$1" .mp3)".ogg
}
export PYTHONSTARTUP=$HOME/.pythonrc.py