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.

46 lines
1.2 KiB

5 years ago
5 years ago
5 years ago
5 years ago
3 years ago
5 years ago
3 years ago
3 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. export PATH=$PATH:/home/user/bin
  29. # go
  30. export PATH=$PATH:/usr/local/go/bin
  31. export GOPATH=$HOME/go
  32. # rust
  33. export PATH="$HOME/.cargo/bin:$PATH"
  34. # python
  35. alias python='/usr/bin/python3.6'
  36. alias pip='/usr/bin/pip3'
  37. export EDITOR=vim
  38. export LC_ALL="en_US.UTF-8"
  39. source ~/.sh_alias