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.

59 lines
1.6 KiB

6 years ago
6 years ago
6 years ago
6 years ago
4 years ago
6 years ago
6 years ago
4 years ago
6 years ago
4 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 lst='ls -altr'
  35. # alias
  36. alias n='nvim'
  37. alias t='tmux'
  38. alias c='calcurse-caldav && calcurse && calcurse-caldav'
  39. alias gdf='git difftool --tool=vimdiff'
  40. export PATH=$PATH:/home/user/bin
  41. # go
  42. export PATH=$PATH:/usr/local/go/bin
  43. export GOPATH=$HOME/go
  44. # rust
  45. export PATH="$HOME/.cargo/bin:$PATH"
  46. # python
  47. alias python='/usr/bin/python3.6'
  48. alias pip='/usr/bin/pip3'
  49. export EDITOR=vim
  50. export LC_ALL="en_US.UTF-8"