Terminal terminal beautification for Mac and Linux, command highlighting, auto-completion, and many built-in plug-ins are waiting for you to explore

written in front


If you often deal with Terminal, then this open source project must be very suitable for you


Official website address: https://ohmyz.sh/

Install

Oh My Zsh is the framework of Zsh, so check to see if zsh is installed.

zsh --version

If zsh is not installed, you need to install and configure according to the corresponding system according to the command
Official website installation reference address: https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH

Ubuntu安装
apt install zsh

CentOs安装
yum install zsh

查看版本,是否安装成功的标志
zsh --version

Ubuntu设为默认shell
chsh -s $(which zsh)

CentOs设为默认shell
chsh -s /bin/zsh

After installing zsh, you can install oh my zsh!
Official website installation reference address: https://github.com/ohmyzsh/ohmyzsh/wiki

Install oh-my-zsh:

Way command -github source
curl sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
wget sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
fetch sh -c "$(fetch -o - https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Way command -gitee source
curl sh -c "$(curl -fsSL https://gitee.com/gloriaied/oh-my-zsh/raw/master/tools/install.sh)"
wget sh -c "$(wget https://gitee.com/gloriaied/oh-my-zsh/raw/master/tools/install.sh -O -)"

body - configure themes and plugins

theme

Take a look at what themes are for you
https://github.com/ohmyzsh/ohmyzsh/wiki/Themes

insert image description here

Choose what you like, edit the configuration file

vim ~/.zshrc

turn upZSH_THEME

ZSH_THEME="主题名"

如果实在眼花缭乱,那就使用随机每次打开都得到不一样的终端
ZSH_THEME="random"

Remember to reload the configuration after modifying the configuration file source ~/.zshrc.


plug-in

Built-in plugins
https://github.com/ohmyzsh/ohmyzsh/wiki/Plugins

Comes with plug-ins, just need to modify the configuration, the following are commonly used:

1. z: Built-in plug-in, similar to autojump, z + fuzzy path name will automatically jump to the most frequently visited path. For example, if you recently visited /opt/project/log, you can directly access this directory with z log.

2. extract: x my.zipx + zip package name to decompress directly, no need to use tar -xvzf my.zip.

3. timer: There will be an execution time after each command

insert image description here

There are many more waiting for you to explore.


other plugins

1. zsh-syntax-highlighting: command highlight plugin
insert image description here

install command

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

解释

Download the file to ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/ and name it zsh-syntax-highlighting
insert image description here

1、编辑配置文件
vim ~/.zshrc

2、找到plugins在括号内加上`zsh-syntax-highlighting`

3、重新加载配置
source ~/.zshrc

insert image description here


2. zsh-autosuggestions: Automatically complete
insert image description here
the installation command when entering the command line:

github git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
gitee git clone https://gitee.com/gloriaied/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions
1、编辑配置文件
vim ~/.zshrc

2、找到plugins在括号内加上`zsh-autosuggestions`

3、重新加载配置
source ~/.zshrc

Guess you like

Origin blog.csdn.net/weixin_45549188/article/details/130017141