当前位置:网站首页>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
~/.zshrc
The 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
~/.zshrc
The 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
~/.zshrc
file , 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.sh
plugins 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]所创,转载请带上原文链接,感谢
边栏推荐
- RSA asymmetric encryption algorithm
- net.sf.json.JSONObject对时间戳的格式化处理
- One minute comprehensive understanding of forsage smart contract global shared Ethereum matrix plan
- I used Python to find out all the people who deleted my wechat and deleted them automatically
- Countdownlatch explodes instantly! Based on AQS, why can cyclicbarrier be so popular?
- 学会了volatile,你变心了,我看到了
- 习题五
- Function classification big PK! How to use sigmoid and softmax respectively?
- 寻找性能更优秀的动态 Getter 和 Setter 方案
- 精通高并发与多线程,却不会用ThreadLocal?
猜你喜欢
Implementation of warehouse management system with ABP (net core) + easyUI + efcore
进程 线程 协程
Countdownlatch explodes instantly! Based on AQS, why can cyclicbarrier be so popular?
Process thread coroutine
Awk implements SQL like join operation
Not a programmer, code can't be too ugly! The official writing standard of Python: pep8 everyone should know
Opencv solves the problem of ippicv download failure_ 2019_ lnx_ intel64_ general_ 20180723.tgz offline Download
给大家介绍下,这是我的流程图软件 —— draw.io
【Elasticsearch 技术分享】—— 十张图带大家看懂 ES 原理 !明白为什么说:ES 是准实时的!
使用基于GAN的过采样技术提高非平衡COVID-19死亡率预测的模型准确性
随机推荐
Using GaN based oversampling technique to improve the accuracy of model for mortality prediction of unbalanced covid-19
构造回文的最小插入次数
动态规划之子序列问题解题模板
Express框架
Why need to use API management platform
动态规划设计:最大子数组
C / C + + learning diary: original code, inverse code and complement code
When to write disk IO after one byte of write file
PAT_甲级_1056 Mice and Rice
寻找性能更优秀的动态 Getter 和 Setter 方案
Chapter 2 programming exercises
latex入门
第一部分——第2章指针操作
Mongodb add delete modify query operation
在Python中创建文字云或标签云
MongoDB数据库
Deep copy
Case analysis of entitycore framework
解决IE、firefox浏览器下JS的new Date()的值为Invalid Date、NaN-NaN的问题
进程 线程 协程