当前位置:网站首页>Iterm2 configuration and beautification
Iterm2 configuration and beautification
2020-11-08 20:13:00 【anchovies】
Because of the new computer , Software and environment need to be reconfigured , It's about iTerm2 The configuration and beautification of finishing an article out , It's convenient for your future work , Also for you to provide some reference , You are welcome to point out the mistakes , If you have a good plug-in or good color, you are welcome to share

install iTerm2
First , download iTerm2 To replace the default terminal .
What is? iTerm2?
iTerm2 is a replacement for Terminal and the successor to iTerm. It works on Macs with macOS 10.12 or newer. iTerm2 brings the terminal into the modern age with features you never knew you always wanted.
iTerm2 It's a replacement for the default terminal , Also present Mac The best terminal tool under the system , It's a combination of beauty and efficiency .
The migration configuration ( Optional )
Because I used to be Mac platform , So there are some configurations that you can use in the ITerm From inside out , In fact, reconfiguration is the same , No impact .
On the original computer iterm Export configuration : 
Export configuration

Then import it into your new computer :
Pictured above import JSON Profiles, Then set it to the default configuration .
Import and use
adjustment Status Bar
take iTerm2 Bring their own theme It is amended as follows Minimal ( Preferences-Appearance-General-Theme ) To achieve the immersive effect of the top bar
Can be in Profiles tab ,Session At the bottom of the page, you can see the opening options .Status bar enabled Options , Check to open . Click... On the right Configure Status Bar Button to set the display content .
You can see that there is a lot to show , Drag the content to be displayed above to the bottom Active Components Areas are added .
stay Preference Click in the page Appearance tab , You can set Status bar The location of , modify Status bar location, I'll change it to Bottom Bottom .

Set location Status bar effect : 
The content displayed can also be adjusted by itself :
Status bar Adjust the
Change color matching ( Optional )
I prefer Dracula The color scheme , Include VS Code It's all about this color scheme .
https://draculatheme.com/iterm/
Decompress and replace Preferences-Profiles-Color-Color Presets-Import
Set up zsh The theme
Configure theme :
It just needs to be modified .zshrc In the document ZSH_THEME="xx" Attribute is enough .
The theme I'm using right now is :spaceship
according to github The method configuration in the project description is enough , Or refer to the topic configuration below
Premise :
Installed zsh Installed powerline typeface Installation method reference :https://github.com/powerline/fonts
And then put iTerm The font of is set to powerline, Include Font and Non-ASCII Font
Set the font
Download the theme file :
git clone https://github.com/denysdovhan/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt" --depth=1
Create a soft connection
ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme"
modify zsh To configure
vim ~/.zshrc
modify :
ZSH_THEME="spaceship"
take effect :
source ~/.zshrc
Then there are some configuration of the theme , Refer to this file for configuration instructions :
https://github.com/denysdovhan/spaceship-prompt/blob/master/docs/Options.md
Specific configuration shows what content , According to the document in ./zshrc Just add it in . Here's my configuration :
PS: Color values refer to this https://upload.wikimedia.org/wikipedia/commons/1/15/Xterm_256color_chart.svg
My configuration
Set the display time
SPACESHIP_TIME_SHOW="true"
Set display user name , And change the color of the user name to macho pink
SPACESHIP_USER_SHOW="always"
SPACESHIP_USER_COLOR="212"
The subject corresponds to the address :
https://github.com/denysdovhan/spaceship-prompt
Set up Oh-My-Zsh
What is? Oh-My-Zsh?
Oh My Zsh Is a community driven command line tool , It's based on zsh Command line , Provides theme configuration , Plug-in mechanism , Greatly improved playability ( use ) sex . Improving efficiency can also make people happy hhh
Website :https://ohmyz.sh/
Enter the following command :
curl The way
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Or use wget:
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
To configure Oh-My-Zsh Configuration command auto prompt About the configuration of plug-ins , If you want to see which plug-ins are currently installed , Can be in .zshrc Mid search plugins keyword , Get the following , It's also the configuration content in my old computer :
plugins=(
git
autojump
zsh-autosuggestion
zsh-syntax-highlighting
)
About command prompts
When we type commands , The terminal will automatically prompt you for the following commands that you may enter , Now press → You can output these commands , Very convenient .
The effect can be referred to GitHub Video in project description
Project address :https://github.com/zsh-users/zsh-autosuggestions
-
1、 Clone the project locally $ZSH_CUSTOM/plugins Under the path ` The default is ·~/.oh-my-zsh/custom/plugins
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions -
2、 edit
~/.zshrcThe configuration file , Add to plugins In the listplugins=(zsh-autosuggestion) -
3、 Open a new terminal window to view the effect
Automatic prompt
If you don't see the effect of the prompt in the end, it may be a color configuration problem , Reference resources GitHub The modification method in the project description is used to modify the configuration
Configure syntax highlighting Project address :https://github.com/zsh-users/zsh-syntax-highlighting
Installation method :
Recommended HomeBrew Installation :
- 1、brew install
brew install zsh-syntax-highlighting
brew Project address of https://brew.sh/
-
2、 stay
~/.zshrcThe tail , Insert a row :source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
vim in Use it directly shift+g The last line you can jump to
-
3、 Effective configuration
source ~/.zshrc
To configure autojump
effect : Realize fast directory jump , Which directory do you want to go to directly j + Directory name ( You don't even have to lose everything ), Don't use frequent cd 了 Project address :https://github.com/wting/autojump
Installation method :
-
1、brew install
brew install autojump -
2、 modify
~/.zshrcfile , Add to plugins Configure the list and append the following to the end :[ -f /usr/local/etc/profile.d/autojump.sh ] && . /usr/local/etc/profile.d/autojump.shplugins Don't forget to add autojump:
plugins=( git zsh-autosuggestion autojump )then source Make him effective
PS: stay brew There will be a prompt output after installation , Follow the prompts to configure :
Add the following line to your ~/.bash_profile or ~/.zshrc file (and remember
to source the file to update your current session):
[ -f /usr/local/etc/profile.d/autojump.sh ] && . /usr/local/etc/profile.d/autojump.sh
If you use the Fish shell then add the following line to your ~/.config/fish/config.fish:
[ -f /usr/local/share/autojump/autojump.fish ]; and source /usr/local/share/autojump/autojump.fish
zsh completions have been installed to:
/usr/local/share/zsh/site-functions
summary
This is my favorite color matching and beautification scheme at present , There are also some holes in the configuration process , There are some problems , It is concluded in this article , Of course , Colors and plugins have their own preferences , Welcome to leave a message
版权声明
本文为[anchovies]所创,转载请带上原文链接,感谢
边栏推荐
- I used Python to find out all the people who deleted my wechat and deleted them automatically
- Deep copy
- 200人的程序员面试经验,都在这里了
- Function classification big PK! How to use sigmoid and softmax respectively?
- Regular backup of WordPress website program and database to qiniu cloud
- Looking for better dynamic getter and setter solutions
- 趣文分享:C 语言和 C++、C# 的区别在什么地方?
- Python 列表的11个重要操作
- Problem solving templates for subsequence problems in dynamic programming
- 解决IE、firefox浏览器下JS的new Date()的值为Invalid Date、NaN-NaN的问题
猜你喜欢

Introduction to latex

C / C + + learning diary: original code, inverse code and complement code

Dynamic ReLU:微软推出提点神器,可能是最好的ReLU改进 | ECCV 2020

Using GaN based oversampling technique to improve the accuracy of model for mortality prediction of unbalanced covid-19
![[elastic search technology sharing] - ten pictures to show you the principle of ES! Understand why to say: ES is quasi real time!](/img/4b/176185ba622b275404e2083df4f28a.jpg)
[elastic search technology sharing] - ten pictures to show you the principle of ES! Understand why to say: ES is quasi real time!

Countdownlatch explodes instantly! Based on AQS, why can cyclicbarrier be so popular?

Brief VIM training strategy

实验

不是程序员,代码也不能太丑!python官方书写规范:任何人都该了解的 pep8

微信小程序相关
随机推荐
npm install 无响应解决方案
Dynamic ReLU:微软推出提点神器,可能是最好的ReLU改进 | ECCV 2020
iptables从入门到掌握
200 programmers interview experience, all here
精通高并发与多线程,却不会用ThreadLocal?
使用基于GAN的过采样技术提高非平衡COVID-19死亡率预测的模型准确性
Your random IO hard disk
C / C + + knowledge sharing: function pointer and pointer function, can you understand after reading this article?
接口测试用例思路总结
Brief VIM training strategy
习题五
Js中常见的内存泄漏场景
Common memory leakage scenarios in JS
latex入门
如果把编程语言当武功绝学!C++是九阴真经,那程序员呢?
简明 VIM 练级攻略
都说程序员钱多空少,程序员真的忙到没时间回信息了吗?
An online accident caused by improper use of thread pool
接口测试工具Eolinker进行post请求
abp(net core)+easyui+efcore实现仓储管理系统——出库管理之五(五十四)