The author found that ZSH comes with his colleague’s MAC, while Linux does not. After searching baidu, he found that ZSH is highly appraised, so he tried it today and found a new continent

Why usezshandOh My Zsh

Linux comes with bash or Dash by default. I insist on using bash and have mastered bash so well that I don’t need to learn it any more when using other systems. This is the time to ask yourself a question, “How often do you switch computers?” In fact, most of the time, we only have one common computer, so we waste too much time trying to learn Bash forcibly. Why make it hard on yourself? Using ZSH can greatly improve work efficiency, and ZSH is also compatible with Bash, so that you can learn shell more comfortable, and work more satisfying.

1 Zsh

Zsh official website: www.zsh.org/ Zsh USA: zsh.sourceforge.net/

Zsh is a shell designed for interactive use, although it is also a powerful scripting language. Many of the useful features of bash, ksh, and tcsh were incorporated into zsh; many original features were added.

“Zsh is a shell designed for interactive use, but it is also a powerful scripting language. Many other shell features, such as bash, KSH, TCSH, have been integrated into Zsh, and many new features have been added.

For other Zsh introductions, please refer to the official documentation (PS: when I have time to translate, the schedule is full).

1.1 Installation in Debian

apt install zsh
Copy the code

1.2 OS X Installation

brew install zsh
Copy the code

brew: brew.sh/

2 Oh My Zsh

Github: github.com/robbyrussel…

Oh My Zsh is a delightful, open source, community-driven framework for managing your Zsh configuration. It comes bundled with a ton of helpful functions, helpers, plugins, themes, and a few things that make you shout…

The official website is clear and interesting: “Oh My Zsh is an enjoyable, open source, community-driven configuration management framework for Zsh. It’s configured with tons of useful functions, help information, themes, and a few things that will make you scream. “

Oh my Zsh is dependent on Zsh. You must install Zsh before installing it. Don’t foolishly install only one Oh my Zsh and go to the forum to scold.

2.1 installation

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# or
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
Copy the code

Install source ~/.zshrc, the effect is obvious

Why Oh My Zsh? Because you can basically see all the effects you want. It’s very simple, and for shallow users like me, it’s basically enough. However, there are a few recommended plug-ins for you to use.

3 the plugin

Recommend a few plug-ins worth trying, if you have better, can also share, together to improve efficiency.

3.1 zsh-autosuggestions

Github address: github.com/zsh-users/z… Installation: github.com/zsh-users/z…

Zsh-autosuggestions is a command prompt tool that suggests the most likely completion after the cursor based on your input frequency and weight. If the command of completion is exactly what you want to input, directly press the arrow key right, you can use it.

3.2 z

Github address: github.com/rupa/z

Z is a tool for quick directory jump, it will record the path you visited, and according to the frequency of your visit, prompt directory.

3.3 zsh-syntax-highlighting

Github address: github.com/zsh-users/z… Installation: github.com/zsh-users/z…

ZSH -syntax-highlighting command line, syntax.

4 the last

If this shell is so good, how do you make it the default shell?

chsh -s /bin/zsh
Copy the code