.zshrc 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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. #
  51. # dl () {
  52. # emulate -L zsh
  53. # autoload -U colors
  54. # local color=$fg_bold[blue]
  55. # integer i=0
  56. # dirs -p | while read dir
  57. # do
  58. # local num="${$(printf "%-4d " $i)/ /.}"
  59. # printf " %s $color%s$reset_color\n" $num $dir
  60. # (( i++ ))
  61. # done
  62. # integer dir=-1
  63. # read -r 'dir?Jump to directory: ' || return
  64. # (( dir == -1 )) && return
  65. # if (( dir < 0 || dir >= i ))
  66. # then
  67. # echo d: no such directory stack entry: $dir
  68. # return 1
  69. # fi
  70. # cd ~$dir
  71. # }
  72. #
  73. # pcat
  74. alias pcat='pygmentize -f terminal256 -O style=native -g'
  75. # Fuckin' TERM env for ssh
  76. function ssh {
  77. if [[ "${TERM}" = tmux* ]]; then
  78. env TERM=xterm /bin/ssh "$@"
  79. else
  80. /bin/ssh "$@"
  81. fi
  82. }
  83. ## Misc
  84. export MANPATH="/usr/local/man:$MANPATH"
  85. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
  86. export EDITOR=vim
  87. # You may need to manually set your language environment
  88. # export LANG=en_US.UTF-8
  89. # Preferred editor for local and remote sessions
  90. # if [[ -n $SSH_CONNECTION ]]; then
  91. # export EDITOR='vim'
  92. # else
  93. # export EDITOR='mvim'
  94. # fi
  95. # Compilation flags
  96. # export ARCHFLAGS="-arch x86_64"
  97. # ssh
  98. # export SSH_KEY_PATH="~/.ssh/rsa_id"
  99. # Set personal aliases, overriding those provided by oh-my-zsh libs,
  100. # plugins, and themes. Aliases can be placed here, though oh-my-zsh
  101. # users are encouraged to define aliases within the ZSH_CUSTOM folder.
  102. # For a full list of active aliases, run `alias`.
  103. #
  104. # Example aliases
  105. # alias zshconfig="mate ~/.zshrc"
  106. # alias ohmyzsh="mate ~/.oh-my-zsh"
  107. ## Flutter
  108. export PATH=$PATH:/opt/flutter/bin/
  109. ## Go
  110. export GOPATH=~/.go
  111. export PATH=$PATH:$GOPATH/bin
  112. ## Aliases
  113. alias t="tmux -2"
  114. alias sy="systemctl"
  115. alias ssy="sudo systemctl"
  116. alias sl="cmatrix -b -s"
  117. alias cd..="cmatrix -b -s -C yellow"
  118. alias lt="ls -lt"
  119. alias lh="ls -lh"
  120. alias la="ls -la"
  121. alias ll="ls -l"
  122. alias lrt="ls -lrt"
  123. #ZSH_CACHE_DIR=$HOME/.cache/oh-my-zsh
  124. #if [[ ! -d $ZSH_CACHE_DIR ]]; then
  125. # mkdir $ZSH_CACHE_DIR
  126. #fi
  127. # source $ZSH/oh-my-zsh.sh
  128. # Setup fzf
  129. # ---------
  130. if [[ ! "$PATH" == */home/leo/Documents/coding/fzf/bin* ]]; then
  131. export PATH="$PATH:/home/leo/Documents/coding/fzf/bin"
  132. fi
  133. # Auto-completion
  134. # ---------------
  135. [[ $- == *i* ]] && source "/home/leo/Documents/coding/fzf/shell/completion.zsh" 2> /dev/null
  136. # Key bindings
  137. # ------------
  138. source "/home/leo/Documents/coding/fzf/shell/key-bindings.zsh"
  139. # Tig
  140. # ---
  141. if [ -f /usr/share/bash-completion/completions/tig ]; then
  142. source /usr/share/bash-completion/completions/tig
  143. fi
  144. # virtualenvwrapper
  145. # -----------------
  146. if [ -f /usr/bin/virtualenvwrapper_lazy.sh ]; then
  147. source /usr/bin/virtualenvwrapper_lazy.sh
  148. fi
  149. # geoiplookup
  150. # -----------
  151. alias geocityiplookup="geoiplookup -f /usr/share/GeoIP/GeoLiteCity.dat"
  152. # mailbundle
  153. # ----------
  154. alias mutt="neomutt"
  155. # vim: et sw=2 ts=2