Advertisement
Januschan

.zshrc

May 25th, 2020 (edited)
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 7.48 KB | None | 0 0
  1. # If you come from bash you might have to change your $PATH.
  2. # export PATH=$HOME/bin:/usr/local/bin:$PATH
  3.  
  4. # Path to your oh-my-zsh installation.
  5. export ZSH="/Users/$USER/.oh-my-zsh"
  6.  
  7. # Set name of the theme to load --- if set to "random", it will
  8. # load a random theme each time oh-my-zsh is loaded, in which case,
  9. # to know which specific one was loaded, run: echo $RANDOM_THEME
  10. # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
  11. ZSH_THEME="robbyrussell"
  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 $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. # Would you like to use another custom folder than $ZSH/custom?
  64. # ZSH_CUSTOM=/path/to/new-custom-folder
  65.  
  66. # Which plugins would you like to load?
  67. # Standard plugins can be found in $ZSH/plugins/
  68. # Custom plugins may be added to $ZSH_CUSTOM/plugins/
  69. # Example format: plugins=(rails git textmate ruby lighthouse)
  70. # Add wisely, as too many plugins slow down shell startup.
  71. plugins=(git)
  72.  
  73. source $ZSH/oh-my-zsh.sh
  74.  
  75. # User configuration
  76.  
  77. # export MANPATH="/usr/local/man:$MANPATH"
  78.  
  79. # You may need to manually set your language environment
  80. # export LANG=en_US.UTF-8
  81.  
  82. # Preferred editor for local and remote sessions
  83. # if [[ -n $SSH_CONNECTION ]]; then
  84. #   export EDITOR='vim'
  85. # else
  86. #   export EDITOR='mvim'
  87. # fi
  88.  
  89. # Compilation flags
  90. # export ARCHFLAGS="-arch x86_64"
  91.  
  92. # Set personal aliases, overriding those provided by oh-my-zsh libs,
  93. # plugins, and themes. Aliases can be placed here, though oh-my-zsh
  94. # users are encouraged to define aliases within the ZSH_CUSTOM folder.
  95. # For a full list of active aliases, run `alias`.
  96. #
  97. # Example aliases
  98. # alias zshconfig="mate ~/.zshrc"
  99. # alias ohmyzsh="mate ~/.oh-my-zsh"
  100.  
  101. export PROMPT="[$USER] $PROMPT"
  102. export EDITOR='code'
  103.  
  104. echo
  105. echo
  106. echo Aliases:
  107. echo
  108. echo     ll, dir, copy, move, rename, delete,
  109. echo     mkdir, rmdir, cls, start,
  110. echo     explorer, powershell, wget, notepad,
  111. echo     update, reboot, code
  112. echo
  113. echo     edit_zshrc, zshrc, edit_bashrc, bashrc
  114. echo
  115. echo     runas_owner, runas_root, set_execute
  116. echo
  117.  
  118. # System-wide .zshrc file for interactive zsh(1) shells.
  119. if [ "$PS1Sentinel" ]; then
  120.     return
  121. fi
  122.  
  123. pathappend() {
  124.   for ARG in "$@"
  125.   do
  126.     if [ -d "$ARG" ] && [[ ":$PATH:" != *":$ARG:"* ]]; then
  127.         PATH="${PATH:+"$PATH:"}$ARG"
  128.     fi
  129.   done
  130. }
  131.  
  132.  # TODO https://stackoverflow.com/questions/11530090/adding-a-new-entry-to-the-path-variable-in-zsh
  133. pathprepend() {
  134.   for ((i=$#; i>0; i--));
  135.   do
  136.     eval ARG="$i"
  137.     if [ -d "$ARG" ] && [[ ":$PATH:" != *":$ARG:"* ]]; then
  138.         PATH="$ARG${PATH:+":$PATH"}"
  139.     fi
  140.   done
  141. }
  142.  
  143. export LOCAL_PATH=$PATH
  144.  
  145. pathappend /usr/sbin
  146. pathappend /usr/local/bin
  147. pathappend /Library/Frameworks/Mono.framework/Versions/Current/Commands
  148. pathappend /usr/local/share/dotnet
  149. pathappend /Users/$USER/Library/Android/sdk/platform-tools/
  150. pathappend /Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin
  151.  
  152. #macports.org
  153. #      > sudo port selfupdate
  154. #      > sudo port install putty
  155. #      > putty
  156. #      > cp /opt/local/bin/putty ~/Desktop/putty
  157.  
  158.  
  159. pathappend /opt/local/bin
  160. pathappend /opt/local/sbin
  161. export MANPATH=/opt/local/share/man:$MANPATH
  162.  
  163. ## TODO fix for ZSH
  164. ## pathprepend /Library/Frameworks/Python.framework/Versions/3.5/bin
  165. ## pathprepend /Library/Frameworks/Python.framework/Versions/3.8/bin
  166. ##
  167. ### append
  168. ##path+=('/home/david/pear/bin')
  169. ### or prepend
  170. ##path=('/home/david/pear/bin' $path)
  171.  
  172. path=('/Library/Frameworks/Python.framework/Versions/3.5/bin' $path)
  173. path=('/Library/Frameworks/Python.framework/Versions/3.8/bin' $path)
  174.  
  175. export HOMEBREW_CASK_OPTS="--no-quarantine"
  176. export FASTLANE_DIR="/Users/$USER/.fastlane/bin"
  177.  
  178. [ -d "$FASTLANE_DIR" ] && pathappend $FASTLANE_DIR && echo which fastlane && (which fastlane)
  179. echo which brew && (which brew)
  180. echo which wget && (which wget)
  181. echo
  182. echo Alola, $USER
  183. echo
  184. echo \$PATH was $LOCAL_PATH
  185. echo \$PATH was changed to $PATH
  186. echo
  187.  
  188. alias sudo='sudo ' #https://apple.stackexchange.com/questions/45735/can-sudo-use-my-existing-aliases
  189. alias powershell=pwsh
  190. alias ll="ls -lhA"
  191. alias la="ls -a"
  192. alias dir="ls -lhA"
  193. alias mkdir="mkdir -p"
  194. alias cls="clear"
  195. alias rename="mv"
  196. alias copy="cp"
  197. alias move="mv"
  198. alias delete="rm"
  199. alias del="rm"
  200. alias rmdir="rm -rf"
  201. alias start="open -a"
  202. alias explorer="open -a Finder"
  203. alias notepad="open -a Sublime\ Text"
  204. #alias code="open -a Visual\ Studio\ Code"
  205. alias markdown="open -a Typora"
  206. alias typora="open -a Typora"
  207. alias sublime="open -a Sublime\ Text"
  208. alias textedit="open -a TextEdit"
  209. alias simulator="open -a Finder ~/Library/Developer/CoreSimulator/Devices"
  210.  
  211. alias set_execute="sudo chmod a+x"
  212. alias takeown="sudo chown $USER *"
  213.  
  214. alias edit_zshrc="sudo $EDITOR /etc/zshrc"
  215. alias edit_bashrc="sudo $EDITOR /etc/bashrc"
  216. alias runas_owner="sudo -u owner"
  217. alias runas_root="sudo "
  218.  
  219. alias wget="wget --recursive --level=32 --convert-links --backup-converted"
  220.  
  221. alias zshrc="$EDITOR ~/.zshrc && source ~/.zshrc"
  222. alias bashrc="$EDITOR ~/.bashrc && source ~/.bashrc"
  223.  
  224. alias update="omz update; brew update; brew upgrade"
  225.  
  226. # if user is not root, pass commands via sudo #
  227. if [ $UID -ne 0 ]; then
  228.    alias reboot="sudo reboot"
  229.    #alias update='sudo apt-get upgrade'
  230. else
  231.    #alias update='apt-get upgrade'
  232. fi
  233.  
  234. [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
  235. [ "$PS1Sentinel" = "\\s-\\v\\\$ " ] && PS1Sentinel="[\u@\h \W]\\$ "
  236.  
  237. # Make bash check its window size after a process completes
  238. #shopt -s checkwinsize
  239.  
  240. [ -r "/etc/zshrc_$TERM_PROGRAM" ] && . "/etc/zshrc_$TERM_PROGRAM"
  241.  
  242. test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
  243.  
  244.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement