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
30# gitg branch views, line from https://gitlab.com/dhole/dot_files/blob/master/.bash_aliases#L39
31alias gitg="git log --color --graph --abbrev-commit --pretty=format:'%Cred%h%Creset%C(yellow)%d%Creset %s %Cgreen(%ar)%C(cyan) %an<%ae>%Creset'"
32
33# ls aliases
34alias ll='ls -alF'
35alias la='ls -A'
36alias l='ls -CF'
37
38# alias
39alias n='nvim'
40alias t='tmux'
41alias c='calcurse-caldav && calcurse && calcurse-caldav'
42
43# go
44export PATH=$PATH:/usr/local/go/bin
45export GOPATH=$HOME/go
46
47# rust
48export PATH="$HOME/.cargo/bin:$PATH"
49
50# python
51alias python='/usr/bin/python3.6'
52alias pip='/usr/bin/pip3'
53
54export EDITOR=vim