Oh My Zsh安装与使用

文章地址 https://github.com/itgoyo/500Days-Of-Github/issues

本人github:itgoyo,欢迎关注 (๑•́ ₃•̀๑)

oh my zsh

  • curl or wget should be installed

  • git should be installed

Basic Installation

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.

  • via curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

  • via wget

sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"1

Plugins

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.

For example, this line might begin to look like this:

plugins=(git bundler osx rake ruby)

Themes

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).

Once you find a theme that you want to use, you will need to edit the ~/.zshrc file. You'll see an environment variable (all caps) in there that looks like:

ZSH_THEME="robbyrussell"

To use a different theme, simply change the value to match the name of your desired theme. For example:

ZSH_THEME="agnoster" # (this is one of the fancy ones)
# you might need to install a special Powerline font on your console's host for this to work
# see https://github.com/robbyrussell/oh-my-zsh/wiki/Themes#agnoster

出现乱码解决方式

执行以下命令来安装缺失的字体:
wget https://raw.githubusercontent.com/powerline/powerline/develop/font/10-powerline-symbols.conf
wget https://raw.githubusercontent.com/powerline/powerline/develop/font/PowerlineSymbols.otf
sudo mkdir /usr/share/fonts/OTF
sudo cp 10-powerline-symbols.conf /usr/share/fonts/OTF/ 
sudo mv 10-powerline-symbols.conf /etc/fonts/conf.d/
sudo mv PowerlineSymbols.otf /usr/share/fonts/OTF/

Open up a new terminal window and your prompt should look something like this:


image

In case you did not find a suitable theme for your needs, please have a look at the wiki for more of them.

If you're feeling feisty, you can let the computer select one randomly for you each time you open a new terminal window.

ZSH_THEME="random" # (...please let it be pie... please be some pie..)

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • The Inner Game of Tennis W Timothy Gallwey Jonathan Cape ...
    网事_79a3阅读 14,328评论 3 20
  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 12,211评论 0 10
  • 无聊的时候带上耳机,生活还是一往如此,我有多热忱,她就有多淡定,不疾不徐,她有多喧嚣,我就有多安静,格格不入,我...
    bangbangduang阅读 1,877评论 0 1
  • 念念不忘,必有回响,有一口气。 点一盏灯,亮了别人,更是照亮自己。 人生就是行走越来越远 1 知乎上ID柳侍墨说一...
    蓝胖说说阅读 6,130评论 20 77
  • 青山成墨,斗星如珍 我是行走在山间的歌,且歌且乐 晚风洗面,虫蛙低语 我是愚笨的文字,写不完的此刻
    关耳叔叔阅读 1,099评论 0 0

友情链接更多精彩内容