Advertisement
Guest User

Untitled

a guest
Jul 18th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. # bash completion for the 'wp' command
  2. _wp_complete() {
  3. local cur=${COMP_WORDS[COMP_CWORD]}
  4.  
  5. IFS=$'\n'; # want to preserve spaces at the end
  6. local opts="$(wp cli completions --line="$COMP_LINE" --point="$COMP_POINT")"
  7.  
  8. if [[ "$opts" =~ \<file\>\s* ]]
  9. then
  10. COMPREPLY=( $(compgen -f -- $cur) )
  11. elif [[ $opts = "" ]]
  12. then
  13. COMPREPLY=( $(compgen -f -- $cur) )
  14. else
  15. COMPREPLY=( ${opts[*]} )
  16. fi
  17. }
  18. complete -o nospace -F _wp_complete wp
  19.  
  20.  
  21. # bash-completion
  22. if [ -f $(brew --prefix)/etc/bash_completion ]; then
  23. . $(brew --prefix)/etc/bash_completion
  24. fi
  25.  
  26. export GREP_OPTIONS="--color=auto"
  27. export GREP_COLOR="4;33"
  28. export CLICOLOR="auto"
  29.  
  30. #Colors
  31. NO_COLOR="\[\e[0m\]"
  32. BLACK="\[\033[0;30m\]"
  33. RED="\[\033[0;31m\]"
  34. GREEN="\[\033[0;32m\]"
  35. YELLOW="\[\033[0;33m\]"
  36. BLUE="\[\033[0;34m\]"
  37. MAGENTA="\[\033[0;35m\]"
  38. CYAN="\[\033[0;36m\]"
  39. WHITE="\[\033[0;37m\]"
  40.  
  41. GIT_PS1_SHOWDIRTYSTATE=true
  42. GIT_PS1_SHOWSTASHSTATE=true
  43. GIT_PS1_SHOWUNTRACKEDFILES=true
  44. GIT_STATUS='$(__git_ps1 "(%s)")'
  45.  
  46. export PS1="${BLUE}\u${GREEN}@${CYAN}\h${GREEN}:${RED}\W${YELLOW}${GIT_STATUS}${GREEN}\$${NO_COLOR} "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement