oh my zsh configuration tutorial under Ubuntu

oh my zsh is a very useful zsh-based configuration framework that simplifies many daily operations for Linux terminal users. Moreover, its interface is very good-looking compared to the original bash. This article is used to introduce how to install and configure oh my zsh and its common plugins under Ubuntu.

oh my zsh installation and basic configuration

Before installing oh my zsh, you need to execute the following commands to install the following git, curl, and zsh.

% sudo apt install git curl zsh

After installing the dependent projects, directly execute the following command to install with one click:

% sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Set zsh as the default shell:

% chsh

Follow the prompts step by step and enter /bin/zsh.

Common plug-in installation

Just configuring oh my zsh itself is not enough, you may need the following common plugins to really simplify the operation.

  • z History directory management
  • zsh-autosuggestions command prompt
  • zsh-syntax-highlighting
  • When sudo forgets to add sudo prefix
  • extract One command to extract almost all installation packages

z

No additional installation is required, just fill in the plugins directly.

zsh-autosuggestions

Execute the following command first, and then fill in the plugins.

% git clone git://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

zsh-syntax-highlighting

Execute the following command first, and then fill in the plugins.

% git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

sudo

No additional installation is required, just fill in the plugins directly.

extract

No additional installation is required, just fill in the plugins directly.

set proxy

We can enable switchable proxy functionality by adding the following configuration to .zshrc:

proxy() { export https_proxy=http://127.0.0.1:1234 export http_proxy=http://127.0.0.1:1234 export all_proxy=socks5://127.0.0.1:1234 } unproxy() { unset https_proxy unset http_proxy export all_proxy }

You can change 1234 to whatever port you want.

refresh configuration

Execute the following command to refresh the configuration.

% source ~/.zshrc

 

 

 

 

zh_CNZH-CN