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   # to see the available colours: for COLOR in {1..255}; do echo -en "\e[38;5;${COLOR}m${COLOR} "; done; echo;
21 C_USER='99' # 48 for normal green, 99 for server purple
22 C_DIR='39'
23 C_BRANCH='207'
24 PS1='${debian_chroot:+($debian_chroot)}\[\e[01;38;5;'$C_USER'm\]\u@\h\[\033[00m\]:\[\e[01;38;5;'$C_DIR'm\]\w\[\e[38;5;'$C_BRANCH'm\]$(parse_git_branch)\[\033[01;90m\]\[\033[00m\]\$ '
25else
26 PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(parse_git_branch)\$ '
27fi
28unset color_prompt force_color_prompt
29
30export PATH=$PATH:/home/user/bin
31
32# go
33export PATH=$PATH:/usr/local/go/bin
34export GOPATH=$HOME/go
35
36# rust
37export PATH="$HOME/.cargo/bin:$PATH"
38
39# python
40alias python='/usr/bin/python3.6'
41alias pip='/usr/bin/pip3'
42
43export EDITOR=vim
44export LC_ALL="en_US.UTF-8"
45
46source ~/.sh_alias