当前位置:网站首页>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
边栏推荐
- asdsadadsad
- Deeply understand the working principle of kotlin collaboration suspend (beginners can also understand it)
- Code management related issues
- Is it safe to open an account? How can anyone say that it is not reliable.
- Detailed explanation of rect class
- Harmonyos actual combat - ten thousand words long article understanding service card development process
- Esp32 (4): overview of the overall code architecture
- Research on lg1403 divisor
- Coredata acquisition in swift sorting, ascending, descending
- Flink sql -- No factory implements ‘org. apache. flink. table. delegation. ExecutorFactory‘.
猜你喜欢

Acquisition de 100% des actions de Guilin latex par Guilin Robust Medical pour combler le vide de la gamme de produits Latex

Flink Sql -- toAppendStream doesn‘t support consuming update and delete changes which

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

Talk about the kotlin cooperation process and the difference between job and supervisorjob

Baidu map JS browsing terminal

Concatapter tutorial

Talk about how the kotlin collaboration process establishes structured concurrency

Based on svelte3 X desktop UI component library svelte UI

Applet learning path 2 - event binding

Tutorial for beginners of small programs day01
随机推荐
Bind threads to run on a specific CPU logical kernel
Couldn't load this key (openssh ssh-2 private key (old PEM format))
Harmonyos actual combat - ten thousand words long article understanding service card development process
4. use ibinder interface flexibly for short-range communication
Tutorial for beginners of small programs day01
Mmdet line by line code interpretation of positive and negative sample sampler
Summary of Android knowledge points and common interview questions
Deep Learning with Pytorch- A 60 Minute Blitz
Six implementation methods of singleton mode
桂林 穩健醫療收購桂林乳膠100%股權 填補乳膠產品線空白
Flink sql -- No factory implements ‘org. apache. flink. table. delegation. ExecutorFactory‘.
Opencv learning notes -day1 (image reading display imread, imshow, namedwindow)
Express file download
Applet learning path 2 - event binding
127.0.0.1, 0.0.0.0 and localhost
【付费推广】常见问题合集,推荐榜单FAQ
Dart basic notes
[wechat applet] realize applet pull-down refresh and pull-up loading
将线程绑定在某个具体的CPU逻辑内核上运行
Common query and aggregation of ES