You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.5 KiB

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