当前位置:网站首页>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 zsh
zsh 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 autojump
for 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-autosuggestions
After 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-highlighting
It'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
边栏推荐
- ES6 learning path (II) let & const
- Design specification for smart speakers v1.0
- Splice and slice functions of JS
- Maxiouassigner of mmdet line by line interpretation
- How can I get the discount for opening a securities account? Is online account opening safe?
- Raspberry pie 4B no screen installation system and networking using VNC wireless projection function
- 快应用中实现自定义抽屉组件
- 5. Messager framework and imessager interface
- Opencv learning notes -day2 (implemented by the color space conversion function cvtcolar(), and imwrite image saving function imwrite())
- C#訪問SQL Server數據庫兩種方式的比較(SqlDataReader vs SqlDataAdapter)
猜你喜欢
Opencv learning notes -day13 pixel value statistics calculation of maximum and minimum values, average values and standard deviations (use of minmaxloc() and meanstddev() functions)
Opencv learning notes -day 12 (ROI region extraction and inrange() function operation)
Flink Sql -- toAppendStream doesn‘t support consuming update and delete changes which
Talk about how the kotlin process started?
Detailed explanation of pipline of mmdetection
[wechat applet] realize applet pull-down refresh and pull-up loading
Rew acoustic test (III): generate test signal
Deeply understand the working principle of kotlin collaboration suspend (beginners can also understand it)
Talk about how the kotlin collaboration process establishes structured concurrency
Summary of Android knowledge points and common interview questions
随机推荐
asdsadadsad
Esp32 things (I): Preface
Flutter theme (skin) changes
5. Messager framework and imessager interface
Esp32 (4): overview of the overall code architecture
Detailed explanation of pipline of mmdetection
Detailed explanation of rect class
快应用中实现自定义抽屉组件
将线程绑定在某个具体的CPU逻辑内核上运行
Explanation on the use of password profiteering cracking tool Hydra
RPC understanding
Talk about how the kotlin collaboration process establishes structured concurrency
I'm late for school
9.JNI_ Necessary optimization design
Tutorial for beginners of small programs day01
Row column (vertical and horizontal table) conversion of SQL
About MySQL Boolean and tinyint (1)
Harmonyos actual combat - ten thousand words long article understanding service card development process
Why must redis exist in distributed systems?
Esp32 things (VIII): music playing function of function development