.zshrc 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. source /usr/share/zsh/share/antigen.zsh
  2. antigen use oh-my-zsh
  3. antigen theme agnoster
  4. antigen bundle colored-man-pages
  5. antigen bundle docker
  6. antigen bundle git
  7. #antigen bundle tmux
  8. antigen bundle virtualenv
  9. #antigen bundle virtualenvwrapper
  10. antigen bundle ael-code/zsh-gpg-agent
  11. antigen bundle ael-code/zsh-plugin-fasd-fzf
  12. antigen bundle gangleri/pipenv
  13. antigen bundle leophys/zsh-plugin-fzf-finder
  14. #antigen bundle junegunn/fzf
  15. antigen apply
  16. # User configuration
  17. # LS_COLORS
  18. # eval `dircolors /home/leo/Documents/coding/dircolors-solarized/dircolors.ansi-dark`
  19. # FASD
  20. eval "$(fasd --init auto)"
  21. # eval "$(pipenv --completion)"
  22. #compdef pipenv
  23. _pipenv() {
  24. eval $(env COMMANDLINE="${words[1,$CURRENT]}" _PIPENV_COMPLETE=complete-zsh pipenv)
  25. }
  26. if [[ "$(basename ${(%):-%x})" != "_pipenv" ]]; then
  27. autoload -U compinit && compinit
  28. compdef _pipenv pipenv
  29. fi
  30. ## Set SSH to use gpg-agent
  31. unset SSH_AGENT_PID
  32. if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
  33. export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh"
  34. fi
  35. ## Node and NVM
  36. export NVM_DIR=/home/leo/.nvm
  37. function nvm {
  38. if [ -s "$NVM_DIR/nvm.sh" ]; then
  39. . "$NVM_DIR/nvm.sh"
  40. nvm use system
  41. nvm $@
  42. fi
  43. }
  44. ## Ruby and RVM
  45. [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
  46. export PATH=/home/leo/.gem/ruby/2.5.0/bin:$PATH
  47. source /home/leo/.rvm/scripts/rvm
  48. export rvmsudo_secure_path=1
  49. ## Taken from old .zshrc
  50. dl () {
  51. emulate -L zsh
  52. autoload -U colors
  53. local color=$fg_bold[blue]
  54. integer i=0
  55. dirs -p | while read dir
  56. do
  57. local num="${$(printf "%-4d " $i)/ /.}"
  58. printf " %s $color%s$reset_color\n" $num $dir
  59. (( i++ ))
  60. done
  61. integer dir=-1
  62. read -r 'dir?Jump to directory: ' || return
  63. (( dir == -1 )) && return
  64. if (( dir < 0 || dir >= i ))
  65. then
  66. echo d: no such directory stack entry: $dir
  67. return 1
  68. fi
  69. cd ~$dir
  70. }
  71. # pcat
  72. alias pcat='pygmentize -f terminal256 -O style=native -g'
  73. # Fuckin' TERM env for ssh
  74. function ssh {
  75. if [[ "${TERM}" = tmux* ]]; then
  76. env TERM=xterm /bin/ssh "$@"
  77. else
  78. /bin/ssh "$@"
  79. fi
  80. }
  81. ## Misc
  82. export MANPATH="/usr/local/man:$MANPATH"
  83. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
  84. export EDITOR=vim
  85. # You may need to manually set your language environment
  86. # export LANG=en_US.UTF-8
  87. # Preferred editor for local and remote sessions
  88. # if [[ -n $SSH_CONNECTION ]]; then
  89. # export EDITOR='vim'
  90. # else
  91. # export EDITOR='mvim'
  92. # fi
  93. # Compilation flags
  94. # export ARCHFLAGS="-arch x86_64"
  95. # ssh
  96. # export SSH_KEY_PATH="~/.ssh/rsa_id"
  97. # Set personal aliases, overriding those provided by oh-my-zsh libs,
  98. # plugins, and themes. Aliases can be placed here, though oh-my-zsh
  99. # users are encouraged to define aliases within the ZSH_CUSTOM folder.
  100. # For a full list of active aliases, run `alias`.
  101. #
  102. # Example aliases
  103. # alias zshconfig="mate ~/.zshrc"
  104. # alias ohmyzsh="mate ~/.oh-my-zsh"
  105. ## Flutter
  106. export PATH=$PATH:/opt/flutter/bin/
  107. ## Go
  108. export GOPATH=~/.go
  109. export PATH=$PATH:$GOPATH/bin
  110. ## Aliases
  111. alias t="tmux -2"
  112. alias sy="systemctl"
  113. alias ssy="sudo systemctl"
  114. alias sl="cmatrix -b -s"
  115. alias cd..="cmatrix -b -s -C yellow"
  116. alias lt="ls -lt"
  117. alias lh="ls -lh"
  118. alias la="ls -la"
  119. alias ll="ls -l"
  120. alias lrt="ls -lrt"
  121. ZSH_CACHE_DIR=$HOME/.cache/oh-my-zsh
  122. if [[ ! -d $ZSH_CACHE_DIR ]]; then
  123. mkdir $ZSH_CACHE_DIR
  124. fi
  125. source $ZSH/oh-my-zsh.sh
  126. # Setup fzf
  127. # ---------
  128. if [[ ! "$PATH" == */home/leo/Documents/coding/fzf/bin* ]]; then
  129. export PATH="$PATH:/home/leo/Documents/coding/fzf/bin"
  130. fi
  131. # Auto-completion
  132. # ---------------
  133. [[ $- == *i* ]] && source "/home/leo/Documents/coding/fzf/shell/completion.zsh" 2> /dev/null
  134. # Key bindings
  135. # ------------
  136. source "/home/leo/Documents/coding/fzf/shell/key-bindings.zsh"
  137. # Tig
  138. # ---
  139. if [ -f /usr/share/bash-completion/completions/tig ]; then
  140. source /usr/share/bash-completion/completions/tig
  141. fi
  142. # virtualenvwrapper
  143. # -----------------
  144. if [ -f /usr/bin/virtualenvwrapper_lazy.sh ]; then
  145. source /usr/bin/virtualenvwrapper_lazy.sh
  146. fi
  147. # geoiplookup
  148. # -----------
  149. alias geocityiplookup="geoiplookup -f /usr/share/GeoIP/GeoLiteCity.dat"
  150. # mailbundle
  151. # ----------
  152. alias mutt="neomutt"
  153. # antigen apply
  154. antigen apply
  155. # vim: et sw=2 ts=2