arnaucube
arnaucube/configsPublic Self-hosted repository
configs/.bashrc
.bashrcRaw
 1#
 2# [...]
 3#
 4# after the default config
 5
 6# Show git branch name and if there are files not commited show the number
 7force_color_prompt=yes
 8color_prompt=yes
 9parse_git_branch() {
10 git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
11}
12check_files_changed() {
13  if [ -d .git ]; then
14    if ((0!=$(git diff-index HEAD | wc -l))); then
15      echo "["$(git diff-index HEAD | wc -l)"]";
16    fi;
17  fi
18}
19if [ "$color_prompt" = yes ]; then
20 # for username green:
21 PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;95m\]$(parse_git_branch)\[\033[01;90m\]$(check_files_changed)\[\033[00m\]\$ '
22 # for username pink:
23 # PS1='${debian_chroot:+($debian_chroot)}\[\033[01;33m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;95m\]$(parse_git_branch)\[\033[01;93m\]$(check_files_changed)\[\033[00m\]\$ '
24else
25 PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(parse_git_branch)\$ '
26fi
27unset color_prompt force_color_prompt
28
29# gitg branch views, line from https://gitlab.com/dhole/dot_files/blob/master/.bash_aliases#L39
30alias gitg="git log --color --graph --abbrev-commit --pretty=format:'%Cred%h%Creset%C(yellow)%d%Creset %s %Cgreen(%ar)%C(cyan) %an<%ae>%Creset'"
31
32# ls aliases
33alias ll='ls -alF'
34alias la='ls -A'
35alias l='ls -CF'
36
37# alias
38alias n='nvim'
39alias t='tmux'
40alias c='calcurse-caldav && calcurse && calcurse-caldav'
41
42# go
43export PATH=$PATH:/usr/local/go/bin
44export GOPATH=$HOME/go
45
46# rust
47export PATH="$HOME/.cargo/bin:$PATH"
48
49# python
50alias python='/usr/bin/python3.6'
51alias pip='/usr/bin/pip3'
52
53export EDITOR=vim