Advertisement
v1ral_ITS

Dl zsh and activate plugins

Jul 2nd, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 5.33 KB | None | 0 0
  1. Basic Installation
  2.  
  3. Oh My Zsh is installed by running one of the following commands in your terminal. You can install this via the command-line with either curl or wget.
  4.  
  5. via curl
  6.  
  7. sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
  8. via wget
  9.  
  10. sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
  11. Using Oh My Zsh
  12.  
  13. Plugins
  14.  
  15. Oh My Zsh comes with a shitload of plugins to take advantage of. You can take a look in the plugins directory and/or the wiki to see what's currently available.
  16.  
  17. Enabling Plugins
  18.  
  19. Once you spot a plugin (or several) that you'd like to use with Oh My Zsh, you'll need to enable them in the .zshrc file. You'll find the zshrc file in your $HOME directory. Open it with your favorite text editor and you'll see a spot to list all the plugins you want to load.
  20.  
  21. vi ~/.zshrc
  22. For example, this might begin to look like this:
  23.  
  24. plugins=(
  25.  git
  26.  bundler
  27.  dotenv
  28.  osx
  29.  rake
  30.  rbenv
  31.  ruby
  32. )
  33. Using Plugins
  34.  
  35. Most plugins (should! we're working on this) include a README, which documents how to use them.
  36.  
  37. Themes
  38.  
  39. We'll admit it. Early in the Oh My Zsh world, we may have gotten a bit too theme happy. We have over one hundred themes now bundled. Most of them have screenshots on the wiki. Check them out!
  40.  
  41. Selecting a Theme
  42.  
  43. Robby's theme is the default one. It's not the fanciest one. It's not the simplest one. It's just the right one (for him).
  44.  
  45. Once you find a theme that you'd like to use, you will need to edit the ~/.zshrc file. You'll see an environment variable (all caps) in there that looks like:
  46.  
  47. ZSH_THEME="robbyrussell"
  48. To use a different theme, simply change the value to match the name of your desired theme. For example:
  49.  
  50. ZSH_THEME="agnoster" # (this is one of the fancy ones)
  51. # see https://github.com/robbyrussell/oh-my-zsh/wiki/Themes#agnoster
  52. Note: many themes require installing the Powerline Fonts in order to render properly.
  53.  
  54. Open up a new terminal window and your prompt should look something like this:
  55.  
  56. Agnoster theme
  57.  
  58. In case you did not find a suitable theme for your needs, please have a look at the wiki for more of them.
  59.  
  60. If you're feeling feisty, you can let the computer select one randomly for you each time you open a new terminal window.
  61.  
  62. ZSH_THEME="random" # (...please let it be pie... please be some pie..)
  63. And if you want to pick random theme from a list of your favorite themes:
  64.  
  65. ZSH_THEME_RANDOM_CANDIDATES=(
  66.   "robbyrussell"
  67.   "agnoster"
  68. )
  69. Advanced Topics
  70.  
  71. If you're the type that likes to get their hands dirty, these sections might resonate.
  72.  
  73. Advanced Installation
  74.  
  75. Some users may want to change the default path, or manually install Oh My Zsh.
  76.  
  77. Custom Directory
  78.  
  79. The default location is ~/.oh-my-zsh (hidden in your home directory)
  80.  
  81. If you'd like to change the install directory with the ZSH environment variable, either by running export ZSH=/your/path before installing, or by setting it before the end of the install pipeline like this:
  82.  
  83. export ZSH="$HOME/.dotfiles/oh-my-zsh"; sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
  84. Manual Installation
  85.  
  86. 1. Clone the repository:
  87.  
  88. git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
  89. 2. Optionally, backup your existing ~/.zshrc file:
  90.  
  91. cp ~/.zshrc ~/.zshrc.orig
  92. 3. Create a new zsh configuration file
  93.  
  94. You can create a new zsh config file by copying the template that we have included for you.
  95.  
  96. cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
  97. 4. Change your default shell
  98.  
  99. chsh -s /bin/zsh
  100. 5. Initialize your new zsh configuration
  101.  
  102. Once you open up a new terminal window, it should load zsh with Oh My Zsh's configuration.
  103.  
  104. Installation Problems
  105.  
  106. If you have any hiccups installing, here are a few common fixes.
  107.  
  108. You might need to modify your PATH in ~/.zshrc if you're not able to find some commands after switching to oh-my-zsh.
  109. If you installed manually or changed the install location, check the ZSH environment variable in ~/.zshrc.
  110. Custom Plugins and Themes
  111.  
  112. If you want to override any of the default behaviors, just add a new file (ending in .zsh) in the custom/ directory.
  113.  
  114. If you have many functions that go well together, you can put them as a XYZ.plugin.zsh file in the custom/plugins/ directory and then enable this plugin.
  115.  
  116. If you would like to override the functionality of a plugin distributed with Oh My Zsh, create a plugin of the same name in the custom/plugins/ directory and it will be loaded instead of the one in plugins/.
  117.  
  118. Getting Updates
  119.  
  120. By default, you will be prompted to check for upgrades every few weeks. If you would like oh-my-zsh to automatically upgrade itself without prompting you, set the following in your ~/.zshrc:
  121.  
  122. DISABLE_UPDATE_PROMPT=true
  123. To disable automatic upgrades, set the following in your ~/.zshrc:
  124.  
  125. DISABLE_AUTO_UPDATE=true
  126. Manual Updates
  127.  
  128. If you'd like to upgrade at any point in time (maybe someone just released a new plugin and you don't want to wait a week?) you just need to run:
  129.  
  130. upgrade_oh_my_zsh
  131. Magic! tada
  132.  
  133. Uninstalling Oh My Zsh
  134.  
  135. Oh My Zsh isn't for everyone. We'll miss you, but we want to make this an easy breakup.
  136.  
  137. If you want to uninstall oh-my-zsh, just run uninstall_oh_my_zsh from the command-line. It will remove itself and revert your previous bash or zsh configuration.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement