Advertisement
Guest User

Untitled

a guest
Jul 24th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. export PATH="$PATH":/usr/local/pgsql/bin:~/.local/bin
  2. export EDITOR="vim"
  3. export PAGER="bat -n"
  4.  
  5. export COLOR_NC='\e[0m' # No Color
  6. export COLOR_WHITE='\e[1;37m'
  7. export COLOR_BLACK='\e[0;30m'
  8. export COLOR_BLUE='\e[0;34m'
  9. export COLOR_LIGHT_BLUE='\e[1;34m'
  10. export COLOR_GREEN='\e[0;32m'
  11. export COLOR_LIGHT_GREEN='\e[1;32m'
  12. export COLOR_CYAN='\e[0;36m'
  13. export COLOR_LIGHT_CYAN='\e[1;36m'
  14. export COLOR_RED='\e[0;31m'
  15. export COLOR_LIGHT_RED='\e[1;31m'
  16. export COLOR_PURPLE='\e[0;35m'
  17. export COLOR_LIGHT_PURPLE='\e[1;35m'
  18. export COLOR_BROWN='\e[0;33m'
  19. export COLOR_YELLOW='\e[1;33m'
  20. export COLOR_GRAY='\e[0;30m'
  21. export COLOR_LIGHT_GRAY='\e[0;37m'
  22.  
  23. alias grep="egrep --color=always"
  24. alias ls="ls --color=always -a"
  25. alias vim="/usr/bin/nvim"
  26.  
  27. __set_bash_prompt(){
  28. local last_exit_code=$?
  29. local last_exit_code_token=""
  30. [[ $last_exit_code != 0 ]] && last_exit_code_token="$COLOR_RED[$last_exit_code]$COLOR_NC "
  31.  
  32. local branch_name=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
  33. local branch_token=""
  34. [[ -n "$branch_name" ]] && branch_token=" $COLOR_YELLOW($branch_name)$COLOR_NC"
  35.  
  36. local dir_token="$COLOR_LIGHT_BLUE[\w]$COLOR_NC"
  37.  
  38. local user_token="[\u@\h, \s]"
  39. [[ $last_exit_code == 0 ]] && user_token="$COLOR_GREEN$user_token$COLOR_NC"
  40.  
  41. PS1="$dir_token\n$last_exit_code_token$user_token$branch_token "
  42. }
  43.  
  44. PROMPT_COMMAND=__set_bash_prompt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement