当前位置:网站首页>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
边栏推荐
- Influencing factors of echo cancellation for smart speakers
- Opencv learning notes-day14 drawing of image geometry (rect class rotatedrect class, rectangle drawing rectangle circle drawing circular function line drawing line function ellipse drawing elliptic fu
- Implementing custom drawer component in quick application
- C#访问SQL Server数据库两种方式的比较(SqlDataReader vs SqlDataAdapter)
- Pit encountered by fastjason
- Opencv learning notes -day3 (mat object and creation related operations mat:: clone(), mat:: copyto(), mat:: zeros(), mat:: ones(), scalar()...)
- Do you want the dialog box that pops up from the click?
- Advanced technology management -- how managers design and build echelons
- 【付费推广】常见问题合集,推荐榜单FAQ
- Flink SQL custom connector
猜你喜欢

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

Rew acoustic test (II): offline test

Handwriting sorter component

Agp7.0|kts makes a reinforced plug-in

Abstract factory pattern

Express file upload

Opencv learning notes -day4 image pixel reading and writing operations (array traversal and pointer traversal implementation, uchar vec3b data type and mat class functions mat:: at(), mat:: ptr())

Bind threads to run on a specific CPU logical kernel

Talk about the job experience of kotlin cooperation process

Flink Sql -- toAppendStream doesn‘t support consuming update and delete changes which
随机推荐
RPC understanding
[wechat applet] realize applet pull-down refresh and pull-up loading
Treatment process record of Union Medical College Hospital (Dongdan hospital area)
C#訪問SQL Server數據庫兩種方式的比較(SqlDataReader vs SqlDataAdapter)
Common query and aggregation of ES
Maxiouassigner of mmdet line by line interpretation
Use of Baidu face recognition API
使用华为性能管理服务,按需配置采样率
Niuke rearrangement rule taking method
C accesses mongodb and performs CRUD operations
Pit encountered by fastjason
Mmdet line by line deltaxywhbboxcoder
Mmdet line by line code interpretation of positive and negative sample sampler
Rew acoustic test (III): generate test signal
Unsupportedclassversionerror is reported when starting jar package. How to repair it
QT downloading files through URL
桂林 稳健医疗收购桂林乳胶100%股权 填补乳胶产品线空白
[protobuf] protobuf generates cc/h file through proto file
Concatapter tutorial
How to format an UTC date to use the Z (Zulu) zone designator in php?