https://www.cnblogs.com/EasonJim/p/7863099.html
Note: before installing the backup / etc / passwd
Start loading oh-my-zsh I was rejected, because this thing is easy to install, uninstall hard, really hard.
Mac Installation Reference: http://www.cnblogs.com/EasonJim/p/6283247.html
My difference with zsh-zsh-ON: http://www.cnblogs.com/EasonJim/p/7863093.html
Description: Ubuntu is not installed by default zsh, under Mac installed by default zsh.
Note: Installation environment variables after the oh-my-zsh entrance will become ./zshrc from ./bashrc, this is to be especially careful when configuring environment variable. Can refer to Mac configurations are basically the same: http://www.cnblogs.com/EasonJim/p/6283190.html
First, the installation:
1, install zsh
sudo apt-get install zsh
2, Shell changed the default zsh
chsh -s /bin/zsh
Note: Do not use sudo.
3, configure the password file, solve chsh: PAM authentication failure problem
sudo vim /etc/passwd
The first line / bin / bash into / bin / zsh, this is the root user.
The last line of the / bin / bash into / bin / zsh, this should be every computer login user name + the computer name composed.
4, install Git
sudo apt-get install git
5, mounted oh-my-zsh
Why do you want to install, easy configuration zsh.
Official website: http://ohmyz.sh/
Offline version :( link: https://pan.baidu.com/s/1i5iqYhB Password: v5c2), if you use an offline version need to be modified executable permissions: sudo chmod + x * .sh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
6, restart the computer to see the effect
7, install plug-ins automatically jump autojump
Official website: https://github.com/wting/autojump
installation:
sudo apt-get install autojump
Configuration Tutorial: cat /usr/share/doc/autojump/README.Debian
Configuration:
vim .zshrc # In the last line, note that after the dot is a space . /usr/share/autojump/autojump.sh
Entry into force:
source ~/.zshrc
8, mounting zsh-syntax-highlighting syntax highlighting widget
Official website: https://github.com/zsh-users/zsh-syntax-highlighting
installation:
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
Entry into force:
source ~/.zshrc
9, install zsh-autosuggestions grammar history plugin
官网:https://github.com/zsh-users/zsh-autosuggestions
安装:
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
plugins=(zsh-autosuggestions)
然后会发现上面这句话是不会生效的。这里科普一下:在~/.oh-my-zsh/plugins下有很多插件,直接使用plugins=(ant mvn svn git)这样的命令是可以直接加载插件的。
经过研究发现,如果使用plugins去执行插件的,首先要在本机已经安装了这个软件之后才可以使用。且这种方式在Ubuntu下不支持命令去执行,只能放在.zshrc文件下使用,然后再通过source ~/.zshrc使其生效。这个是对于Ubuntu比较吭的地方。
所以上面的plugins要放在~/.zshrc,具体修改如下:
vim ~/.zshrc
增加插件:
然后增加zsh的执行文件在最后一行:
source $ZSH_CUSTOM/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
生效:
source ~/.zshrc
10、配置主题
官方主题参考:https://github.com/robbyrussell/oh-my-zsh/wiki/External-themes
sudo vim ~/.zshrc
找到ZSH_THEME="robbyrussell",修改为:ZSH_THEME="ys";
生效:
source ~/.zshrc
二、卸载:
执行:
sudo sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/uninstall.sh)"
把/etc/passwd改回bash:
第一行的/bin/bash
最后一行的/bin/bash
其实看样子是很简单的卸载,但是最后你会发现还有很多没有干掉的,在使用上你会慢慢的发现。
参考:
http://www.jianshu.com/p/9a5c4cb0452d
http://blog.csdn.net/shengzhu1/article/details/54590158
https://segmentfault.com/q/1010000000448027
https://wiki.archlinux.org/index.php/Zsh_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)
https://ehlxr.me/2016/09/24/Oh-My-Zsh-%E6%9B%BF%E6%8D%A2%E4%BD%A0%E7%9A%84-Bash-Shell/
http://wdxtub.com/2016/02/18/oh-my-zsh/
http://wulfric.me/2015/08/zsh/
https://www.zhihu.com/question/21418449
http://yijiebuyi.com/blog/b9b5e1ebb719f22475c38c4819ab8151.html
https://segmentfault.com/a/1190000002658335
http://www.linuxidc.com/Linux/2015-07/119879.htm
https://segmentfault.com/a/1190000004695131
http://www.cnblogs.com/memory4young/p/about-oh-my-zsh-plugin-sublime.html