vasyansk

zsh-config

Jul 19th, 2022
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 7.03 KB | None | 0 0
  1. # If you come from bash you might have to change your $PATH.
  2.  
  3.  
  4. # Set name of the theme to load --- if set to "random", it will
  5. # load a random theme each time oh-my-zsh is loaded, in which case,
  6. # to know which specific one was loaded, run: echo $RANDOM_THEME
  7. # See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
  8. #ZSH_THEME="gallois"
  9. ZSH_THEME="bira"
  10. #ZSH_THEME="powerlevel10k/powerlevel10k"
  11. #POWERLEVEL9K_MODE="nerdfont-complete"
  12.  
  13. # Set list of themes to pick from when loading at random
  14. # Setting this variable when ZSH_THEME=random will cause zsh to load
  15. # a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
  16. # If set to an empty array, this variable will have no effect.
  17. # ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
  18.  
  19. # Uncomment the following line to use case-sensitive completion.
  20. # CASE_SENSITIVE="true"
  21.  
  22. # Uncomment the following line to use hyphen-insensitive completion.
  23. # Case-sensitive completion must be off. _ and - will be interchangeable.
  24. # HYPHEN_INSENSITIVE="true"
  25.  
  26. # Uncomment the following line to disable bi-weekly auto-update checks.
  27. #DISABLE_AUTO_UPDATE="true"
  28.  
  29. # Uncomment the following line to automatically update without prompting.
  30. DISABLE_UPDATE_PROMPT="true"
  31.  
  32. # Uncomment the following line to change how often to auto-update (in days).
  33. # export UPDATE_ZSH_DAYS=13
  34.  
  35. # Uncomment the following line if pasting URLs and other text is messed up.
  36. # DISABLE_MAGIC_FUNCTIONS=true
  37.  
  38. # Uncomment the following line to disable colors in ls.
  39. # DISABLE_LS_COLORS="true"
  40.  
  41. # Uncomment the following line to disable auto-setting terminal title.
  42. # DISABLE_AUTO_TITLE="true"
  43.  
  44. # Uncomment the following line to enable command auto-correction.
  45. # ENABLE_CORRECTION="true"
  46.  
  47. # Uncomment the following line to display red dots whilst waiting for completion.
  48. # COMPLETION_WAITING_DOTS="true"
  49.  
  50. # Uncomment the following line if you want to disable marking untracked files
  51. # under VCS as dirty. This makes repository status check for large repositories
  52. # much, much faster.
  53. # DISABLE_UNTRACKED_FILES_DIRTY="true"
  54.  
  55. # Uncomment the following line if you want to change the command execution time
  56. # stamp shown in the history command output.
  57. # You can set one of the optional three formats:
  58. # "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
  59. # or set a custom format using the strftime function format specifications,
  60. # see 'man strftime' for details.
  61. # HIST_STAMPS="mm/dd/yyyy"
  62.  
  63. ZSH_DISABLE_COMPFIX=true
  64.  
  65. # Would you like to use another custom folder than $ZSH/custom?
  66. # ZSH_CUSTOM=/path/to/new-custom-folder
  67.  
  68. # Which plugins would you like to load?
  69. # Standard plugins can be found in ~/.oh-my-zsh/plugins/*
  70. # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
  71. # Example format: plugins=(rails git textmate ruby lighthouse)
  72. # Add wisely, as too many plugins slow down shell startup.
  73. plugins=(git docker docker-compose zsh-syntax-highlighting brew kubectl macos helm)
  74.  
  75. source $ZSH/oh-my-zsh.sh
  76.  
  77. # User configuration
  78.  
  79. # export MANPATH="/usr/local/man:$MANPATH"
  80.  
  81. # You may need to manually set your language environment
  82. # export LANG=en_US.UTF-8
  83.  
  84. # Preferred editor for local and remote sessions
  85. # if [[ -n $SSH_CONNECTION ]]; then
  86. #   export EDITOR='mcedit'
  87. # else
  88. #   export EDITOR='nano'
  89. # fi
  90.  
  91. # Compilation flags
  92. # export ARCHFLAGS="-arch x86_64"
  93.  
  94. # Set personal aliases, overriding those provided by oh-my-zsh libs,
  95. # plugins, and themes. Aliases can be placed here, though oh-my-zsh
  96. # users are encouraged to define aliases within the ZSH_CUSTOM folder.
  97. # For a full list of active aliases, run `alias`.
  98. #
  99. # Example aliases
  100. # alias zshconfig="mate ~/.zshrc"
  101. # alias ohmyzsh="mate ~/.oh-my-zsh"
  102.  
  103. # added by travis gem
  104. #[ -f /Users/vasyansk/.travis/travis.sh ] && source /Users/vasyansk/.travis/travis.sh
  105.  
  106. # myaliases
  107.  
  108. # Git
  109. alias gitbd="git branch | grep -v "master" | xargs git branch -D"
  110.  
  111. # Terraform
  112. alias tfp="terraform plan"
  113. alias tfa="terraform apply -auto-approve"
  114. alias tfd="terraform destroy -auto-approve"
  115. alias tfi="terraform init"
  116. alias tfo="terraform output"
  117.  
  118. # Vagrant
  119. alias vgu="vagrant up"
  120. alias vgd="vagrant destroy -f"
  121. alias vgp="vagrant provision"
  122.  
  123. #go
  124. alias gob="go build"
  125.  
  126. #kube
  127. KUBE_PS1_SYMBOL_ENABLE=false
  128. KUBE_PS1_NS_ENABLE=false
  129. source "/opt/homebrew/opt/kube-ps1/share/kube-ps1.sh"
  130. PS1='$(kube_ps1)'$PS1
  131.  
  132. export KUBECONFIG=$(find /Users/vasyansk/Configs/.kube -maxdepth 1 -type f -name '*' | tr "\n" ":")
  133. #alias kex="export KUBECONFIG=$(find /Users/vasyansk/Configs/.kube -maxdepth 1 -type f -name '*' | tr '\n' ':')"
  134.  
  135. source <(kubectl completion zsh)
  136.  
  137. alias kube="kubectl"
  138. alias kaf="kubectl apply -f"
  139. alias kud="kubectl delete"
  140. alias kgd="kubectl get deployment"
  141. alias kgp="kubectl get pods"
  142. alias kgpa="kubectl get pods --all-namespaces"
  143. alias kgn="kubectl get nodes"
  144. alias kgi="kubectl get ingress"
  145. alias kgs="kubectl get service"
  146. alias kgj="kubectl get jobs"
  147. alias kgcj="kubectl get cronjobs"
  148. alias kgpv="kubectl get persistentvolume"
  149. alias kls="kubectl logs"
  150. alias kec="kubectl exec -ti"
  151. alias kd="kubectl describe"
  152. alias kgc="kubectl config get-contexts"
  153. alias kuc="kubectl config use-context"
  154.  
  155. # Docker
  156. #alias docker-start="eval $(docker-machine env default)"
  157.  
  158. # Tmux
  159. #alias tma="tmux attach"
  160. #alias tmd="tmux deattach"
  161. #alias tmk="tmux kill-server"
  162. #alias ssp="echo set synchronize-panes | pbcopy"
  163. #alias sspof="echo set synchronize-panes off | pbcopy"
  164.  
  165. # hstr
  166. alias hh=hstr                    # hh to be alias for hstr
  167. setopt histignorespace           # skip cmds w/ leading space from history
  168. export HSTR_CONFIG=hicolor       # get more colors
  169.  
  170. # minikube
  171. #source ~/.minikube-completion
  172.  
  173. #system
  174.  
  175. #alias mc="mc --nosubshell"
  176.  
  177. alias cls="clear"
  178. #alias ssh="ssh -o 'StrictHostKeyChecking=no' -o 'UserKnownHostsFile=/dev/null'"
  179. alias ssh-copy="cat ~/.ssh/id_rsa.pub | tr -d '\n\r' | pbcopy"
  180. alias netstat="netstat -an -ptcp | grep LISTEN"
  181. alias ls="ls -la"
  182.  
  183. alias pwgen="openssl rand -base64 16 | tr -dc _A-Z-a-z-0-9 | pbcopy && pbpaste"
  184. alias pwgenfull="LC_ALL=C tr -dc 'A-Za-z0-9!#$%&()*,./:;<=>?@[\]^_{|}~' </dev/urandom | head -c 16 | pbcopy && pbpaste"
  185.  
  186. alias apti="echo 'apt update && apt install -y mc htop zip wget curl git net-tools gnupg2 open-iscsi' | tr -d '\n\r' | pbcopy"
  187. alias getdocker='echo "curl https://get.docker.com -o install.sh && sh install.sh && apt install docker-compose-plugin" | tr -d "\n\r" | pbcopy'
  188.  
  189. alias np="nslookup"
  190. alias getmyip="echo $(curl -s http://ifconfig.io | tr -d '"')"
  191.  
  192. alias uh="echo 'unset HISTFILE' | tr -d '\n\r' | pbcopy"
  193.  
  194. geturl() {
  195.     ~/Developers/MyProject/66.Shorten-Selfhosted/shoturl $1 | tr -d '\n\r' | pbcopy && pbpaste
  196. }
  197.  
  198. getip() {
  199.     curl -s "https://ifconfig.co/json?ip=$1" | jq -r '.country'
  200. }
  201.  
  202. b64() {
  203.     [ -z $1 ] && echo "null string!" || echo -n $1 | base64 | tr -d '\n\r' | pbcopy && pbpaste
  204. }
  205.  
  206. b64dec() {
  207.     [ -z $1 ] && echo "null string!" || echo -n $1 | base64 --decode | tr -d '\n\r' | pbcopy && pbpaste
  208. }
  209.  
  210. alias bash="/usr/local/bin/bash"
  211.  
  212. alias 'docker ps -a'='docker ps -a --format "table {{.ID}}\t{{.Image}}\t{{.CreatedAt}}\t{{.Names}}"'
Add Comment
Please, Sign In to add comment