Advertisement
anujpandey

zshrc-2021

Nov 10th, 2021
1,105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 7.94 KB | None | 0 0
  1. # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
  2. # Initialization code that may require console input (password prompts, [y/n]
  3. # confirmations, etc.) must go above this block; everything else may go below.
  4. if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
  5.   source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
  6. fi
  7.  
  8. # If you come from bash you might have to change your $PATH.
  9. # export PATH=$HOME/bin:/usr/local/bin:$PATH
  10.  
  11. # Path to your oh-my-zsh installation.
  12. export ZSH="/Users/anuj/.oh-my-zsh"
  13.  
  14. # Set name of the theme to load --- if set to "random", it will
  15. # load a random theme each time oh-my-zsh is loaded, in which case,
  16. # to know which specific one was loaded, run: echo $RANDOM_THEME
  17. # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
  18. ZSH_THEME="robbyrussell"
  19.  
  20. # Set list of themes to pick from when loading at random
  21. # Setting this variable when ZSH_THEME=random will cause zsh to load
  22. # a theme from this variable instead of looking in $ZSH/themes/
  23. # If set to an empty array, this variable will have no effect.
  24. # ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
  25.  
  26. # Uncomment the following line to use case-sensitive completion.
  27. # CASE_SENSITIVE="true"
  28.  
  29. # Uncomment the following line to use hyphen-insensitive completion.
  30. # Case-sensitive completion must be off. _ and - will be interchangeable.
  31. # HYPHEN_INSENSITIVE="true"
  32.  
  33. # Uncomment the following line to disable bi-weekly auto-update checks.
  34. # DISABLE_AUTO_UPDATE="true"
  35.  
  36. # Uncomment the following line to automatically update without prompting.
  37. # DISABLE_UPDATE_PROMPT="true"
  38.  
  39. # Uncomment the following line to change how often to auto-update (in days).
  40. # export UPDATE_ZSH_DAYS=13
  41.  
  42. # Uncomment the following line if pasting URLs and other text is messed up.
  43. # DISABLE_MAGIC_FUNCTIONS="true"
  44.  
  45. # Uncomment the following line to disable colors in ls.
  46. # DISABLE_LS_COLORS="true"
  47.  
  48. # Uncomment the following line to disable auto-setting terminal title.
  49. # DISABLE_AUTO_TITLE="true"
  50.  
  51. # Uncomment the following line to enable command auto-correction.
  52. # ENABLE_CORRECTION="true"
  53.  
  54. # Uncomment the following line to display red dots whilst waiting for completion.
  55. # COMPLETION_WAITING_DOTS="true"
  56.  
  57. # Uncomment the following line if you want to disable marking untracked files
  58. # under VCS as dirty. This makes repository status check for large repositories
  59. # much, much faster.
  60. # DISABLE_UNTRACKED_FILES_DIRTY="true"
  61.  
  62. # Uncomment the following line if you want to change the command execution time
  63. # stamp shown in the history command output.
  64. # You can set one of the optional three formats:
  65. # "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
  66. # or set a custom format using the strftime function format specifications,
  67. # see 'man strftime' for details.
  68. # HIST_STAMPS="mm/dd/yyyy"
  69.  
  70. # Would you like to use another custom folder than $ZSH/custom?
  71. # ZSH_CUSTOM=/path/to/new-custom-folder
  72.  
  73. # Which plugins would you like to load?
  74. # Standard plugins can be found in $ZSH/plugins/
  75. # Custom plugins may be added to $ZSH_CUSTOM/plugins/
  76. # Example format: plugins=(rails git textmate ruby lighthouse)
  77. # Add wisely, as too many plugins slow down shell startup.
  78. plugins=(
  79.   battery
  80.   bgnotify
  81.   brew
  82.   catimg
  83.   colorize
  84.   colored-man-pages
  85.   command-not-found
  86.   direnv
  87.   docker
  88.   docker-compose
  89.   fast-syntax-highlighting
  90.   fd
  91.   fzf
  92.   git
  93.   gitfast
  94.   git-flow
  95.   golang
  96.   httpie
  97.   kube-ps1
  98.   kubectl
  99.   nmap
  100.   python
  101.   pyenv
  102.   pylint
  103.   osx
  104.   ripgrep
  105.   sudo
  106.   tmux
  107.   urltools
  108.   sbt
  109.   scala
  110.   vi-mode
  111.   vscode
  112. )
  113.  
  114. source $ZSH/oh-my-zsh.sh
  115.  
  116. # User configuration
  117.  
  118. # export MANPATH="/usr/local/man:$MANPATH"
  119.  
  120. # You may need to manually set your language environment
  121. # export LANG=en_US.UTF-8
  122.  
  123. # Preferred editor for local and remote sessions
  124. # if [[ -n $SSH_CONNECTION ]]; then
  125. #   export EDITOR='vim'
  126. # else
  127. #   export EDITOR='mvim'
  128. # fi
  129.  
  130. # Compilation flags
  131. # export ARCHFLAGS="-arch x86_64"
  132.  
  133. # Set personal aliases, overriding those provided by oh-my-zsh libs,
  134. # plugins, and themes. Aliases can be placed here, though oh-my-zsh
  135. # users are encouraged to define aliases within the ZSH_CUSTOM folder.
  136. # For a full list of active aliases, run `alias`.
  137. #
  138. # Example aliases
  139. # alias zshconfig="mate ~/.zshrc"
  140. # alias ohmyzsh="mate ~/.oh-my-zsh"
  141.  
  142. test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
  143.  
  144. #THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
  145. export SDKMAN_DIR="/Users/anuj/.sdkman"
  146. [[ -s "/Users/anuj/.sdkman/bin/sdkman-init.sh" ]] && source "/Users/anuj/.sdkman/bin/sdkman-init.sh"
  147. if [ /usr/local/bin/kubectl ]; then source <(kubectl completion zsh); fi
  148.  
  149. source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh
  150.  
  151. # Git
  152. alias g='git s'
  153. alias gap='git ap'
  154. alias gd='git d'
  155. alias gds='git ds'
  156. alias gl='git l'
  157. alias gl='git l --color --oneline --decorate'
  158. alias gs='git s'
  159. alias gaa='git aa'
  160. alias gc='git c'
  161. alias gcm='git commit -m'
  162.  
  163. setp(){
  164.     export http_proxy=http://www-proxy-hqdc.us.oracle.com:80
  165.     export HTTP_PROXY=http://www-proxy-hqdc.us.oracle.com:80
  166.     export https_proxy=http://www-proxy-hqdc.us.oracle.com:80
  167.     export HTTPS_PROXY=http://www-proxy-hqdc.us.oracle.com:80
  168.     export no_proxy=localhost,127.0.0.1,.us.oracle.com,.oraclecorp.com
  169.     export NO_PROXY=localhost,127.0.0.1,.us.oracle.com,.oraclecorp.com
  170.     # imgcat ~/Downloads/Oracle-Open-World-Hero.jpg
  171. }
  172.  
  173. unsp()
  174. {
  175.     unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY no_proxy NO_PROXY
  176. }
  177.  
  178. export TERM=xterm-256color
  179. alias pubip='curl -4 -s icanhazip.com'
  180.  
  181. alias ff="printf \"e[?1004l\""
  182. whoseport() { lsof -i ":$1" | grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn} LISTEN }
  183.  
  184. goset() {
  185.     export GOPATH=~/GO
  186.     export PATH=$PATH:/$GOPATH/bin
  187.     # imgcat ~/Downloads/gopher.png
  188. }
  189.  
  190. kset() {
  191.     alias k=kubectl
  192.     alias kns="kubectl -n kube-system"
  193.     kn(){ kubectl -n $ns "$@";}
  194.     ka(){ kubectl "$@" --all-namespaces;}
  195.     # imgcat ~/Downloads/k8s.jpg
  196. }
  197.  
  198. autoload -U +X bashcompinit && bashcompinit
  199. complete -o nospace -C /usr/local/bin/vault vault
  200. export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
  201.  
  202. function prev() {
  203.   PREV=$(fc -lrn | head -n 1)
  204.   sh -c "pet new `printf %q "$PREV"`"
  205. }
  206.  
  207. #source /usr/local/opt/powerlevel9k/powerlevel9k.zsh-theme
  208. #POWERLEVEL9K_MODE='nerdfont-complete'
  209.  
  210. [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
  211. # /usr/share/fzf/completion.zsh
  212. # /usr/share/fzf/key-bindings.zsh
  213.  
  214.  
  215. eval "$(direnv hook zsh)"
  216.  
  217. source /Users/anuj/.oh-my-zsh/plugins/kube-ps1/kube-ps1.plugin.zsh
  218.  
  219. export SSHPROXY="ProxyCommand=nc -X 5 -x www-proxy.us.oracle.com:80 %h %p"
  220. export PATH=$PATH:~/.poetry/bin:/Users/anuj/.cargo/bin/
  221.  
  222. alias sshp="ssh -o ProxyCommand=\"nc -X connect -x www-proxy.us.oracle.com:80 %h %p\""
  223.  
  224. codi() {
  225.    local syntax="${1:-python}"
  226.    shift
  227.    nvim -c \
  228.      "let g:startify_disable_at_vimenter = 1 |\
  229.     set bt=nofile ls=0 noru nonu nornu |\
  230.     hi CodiVirtualText guifg=red
  231.     hi ColorColumn ctermbg=NONE |\
  232.     hi VertSplit ctermbg=NONE |\
  233.     hi NonText ctermfg=0 |\
  234.     Codi $syntax" "$@"
  235. }
  236.  
  237. #source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
  238.  
  239. export PATH="/usr/local/opt/ncurses/bin:$PATH"
  240. ZSH_THEME="powerlevel9k/powerlevel9k"
  241.  
  242. alias free="python2 /Users/anuj/.memusage.py"
  243.  
  244. # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
  245. [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
  246.  
  247. bindkey '^x^e' edit-command-line
  248. set editing-mode vi
  249. set show-mode-in-prompt on
  250. set vi-ins-mode-string +
  251. set vi-cmd-mode-string :
  252. set -o vi
  253. bindkey -e
  254. bindkey '^[[1;9C' forward-word
  255. bindkey '^[[1;9D' backward-word
  256. bindkey '^[b' backward-word
  257. bindkey '^[f' forward-word
  258. bindkey '^[a' beginning-of-line
  259. bindkey '^[e' end-of-line
  260. export PATH="/usr/local/opt/python@3.10/bin:$PATH"
  261. set -o vi
  262.  
  263.  
  264. source ~/.zsh-autopair/autopair.zsh
  265. autopair-init
  266. source "$HOME/.zsh/plugins/zsh-system-clipboard/zsh-system-clipboard.zsh"
  267.  
  268.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement