当前位置:网站首页>Terminal -- Zsh of terminal three swordsmen
Terminal -- Zsh of terminal three swordsmen
2022-06-30 09:25:00 【LongtengGensSupreme】
There are three basic tools for using terminals :zsh,vim,tmux. Then I will introduce the three tools one by one .
be familiar with Linux System or Mac Systematic , about 「bash」 No strangers .bash It is the most basic script environment for user and system interaction . and zsh(Z shell) yes bash An alternative to , He is bash There are a lot of optimizations , Whether using commands , appearance , Experience , It can make users more convenient and smooth to use Terminal.
This article mainly introduces zsh,oh-my-zsh Installation , Basic environment configuration , And some practical plug-ins . The configuration of theme style will be introduced separately .
zsh Mainly through oh-my-zsh Development of , It has realized many easy-to-use functions .
github website :ohmyzsh/ohmyzshgithub.com/ohmyzsh/ohmyzsh
install zsh,oh-my-zsh
- Mac System installation zsh Very simple :
$ brew install zshzsh It's installed in /bin/zsh In the path

The system default environment is bash, from bash Get into zsh Just input :zsh that will do , The opposite is true .
- install oh-my-zsh
$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"- After installation, you need to configure each time you open terminal The default is zsh.
$ chsh -s /bin/zsh- zsh Will be generated under the user path .zshrc file , And bashrc similar , Add the default environment variables .

Common plug-in configurations
- Path case ignored
zsh By default, the path on is case insensitive , The advantage is that you often forget that a folder is capitalized when entering a path ,zsh Will automatically change your lower case input to upper case ,「tab」 The prompt function of is the same , Will prompt whether upper or lower case , This greatly reduces the probability of the wrong path .
- Change the theme
zsh The official has brought many different styles of themes , You can customize the settings , stay ~/.zshrc Just change one line inside .

Random themes can be opened every time zsh Use different themes :
ZSH_THEME="random"Change to another topic 、github The theme of needs to be configured separately , I will not introduce .
- autojump
God level plug in !! When there are many nested path levels , We use 「cd」 Level by level input +Tab Efficiency is very low ,「autojump」 It can be used according to the frequency of the path used by the user , According to the key words entered , Jump directly to the path , The keyword is one section of the path .
https://github.com/wting/autojumpgithub.com/wting/autojump
install autojump
$ brew install autojumpfor example , We want to access a folder , If you use the normal command to input
$ cd Absolute path 
But if 「autojump」, Just input
$ j Path keywords 
You can see that you directly jump into the path .
「autojump」 Will make a sort according to the frequency of keyword use , Sometimes some paths have similar keywords , Use 「tab」 You can view the sorting , for example :

Which one do you want to visit , Enter the corresponding number .
- zsh-autosuggestion
Generally, enter the path , To command, you need to click 「tab」 Will prompt you some complete information ,「zsh-autosuggestion」 It will automatically fill in the most likely instruction when entering , And it will be updated with the content entered later , And all possible options will be displayed below , Press... When it meets your needs 「tab」 that will do .
https://github.com/zsh-users/zsh-autosuggestionsgithub.com/zsh-users/zsh-autosuggestions
Installation needs to start from github On clone project :
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestionsAfter the 「~/.zshrc」 Add content to :
plugins=(zsh-autosuggestions)source Restart once terminal You can use .
- zsh-syntax-highlighting
Command highlight , Colors enhance the readability of commands , It doesn't look boring anymore , I also have a very intuitive understanding of the types in the commands .

https://github.com/zsh-users/zsh-syntax-highlightinggithub.com/zsh-users/zsh-syntax-highlighting
The installation method is very simple
$ brew install zsh-syntax-highlightingIt's not just color , For the right command , It will be displayed in green , Incorrect instructions are displayed in red , The correct path will be underlined .

other
- zsh stay Linux The system is also fully supported ,Linux The installation of plug-ins under the system can be viewed GitHub In the project readme, There is no talk here ;
- bash and zsh basic 99% It's universal , But sometimes there are problems , I have only two problems here : install anaconda When oh-my-zsh Need configuration ,snpe Our environment only supports bash Environmental Science .
- The plug-ins and themes are placed in ~/.oh-my-zsh/plugins and ~/.oh-my-zsh/themes In two folders , Easy to manage and use .
Link to the original text : Terminal ——Terminal Three swordsmen zsh - You know
边栏推荐
- 桂林 穩健醫療收購桂林乳膠100%股權 填補乳膠產品線空白
- Express の Hello World
- C#访问MongoDB并执行CRUD操作
- Duplicate entry '2' for key 'primary appears in JPA‘
- Niuke rearrangement rule taking method
- float
- [cmake] make command cannot be executed normally
- Linear-gradient()
- Rew acoustic test (III): generate test signal
- About Lombok's @data annotation
猜你喜欢

C#访问MongoDB并执行CRUD操作

100 lines of code and a voice conversation assistant

Esp32 (4): overview of the overall code architecture

Small program learning path 1 - getting to know small programs

Abstract factory pattern

asdsadadsad

Duplicate entry '2' for key 'primary appears in JPA‘

7. know JNI and NDK

Deeply understand the working principle of kotlin collaboration suspend (beginners can also understand it)

C accesses mongodb and performs CRUD operations
随机推荐
Introduction to the runner of mmcv
Flutter 0001, environment configuration
[paid promotion] collection of frequently asked questions, FAQ of recommended list
Comparaison de deux façons d'accéder à la base de données SQL Server (sqldatareader vs sqldataadapter)
Esp32 things (3): overview of the overall system design
I once met a girl whom I most wanted to take care of all my life. Later... No later
Evaluation standard for audio signal quality of intelligent speakers
C#访问SQL Server数据库两种方式的比较(SqlDataReader vs SqlDataAdapter)
Couldn't load this key (openssh ssh-2 private key (old PEM format))
Maxiouassigner of mmdet line by line interpretation
Esp32 things (II): sharpening the knife without mistaking firewood - make preparations before project development
Treatment process record of Union Medical College Hospital (Dongdan hospital area)
QT downloading files through URL
Deep Learning with Pytorch- A 60 Minute Blitz
ES6 learning path (II) let & const
Esp32 things (I): Preface
Talk about the kotlin cooperation process and the difference between job and supervisorjob
Six implementation methods of singleton mode
Esp32 (7): I2S and I2C drivers for function development
C#访问MongoDB并执行CRUD操作