当前位置:网站首页>Iterm2 installation and use
Iterm2 installation and use
2022-07-20 15:32:00 【Zhan Miao】
1. install iterm2
Download and install directly on the official website iTerm2 - macOS Terminal Replacement
2. Personalization
iterm2->preferences->profiles Click New profile
Transparency can be set below 、 Ambiguity 、 Background image
Set the theme color of the window , Drop down the selection box for setting theme color , choice import You can import the theme yourself
3. Set the shortcut key to open the window
iterm2->preferences->keys->hotkey->create a dedicated…
Set shortcut key
4. Save the user name and password of the server
Every time you log in to the server remotely, you should use ssh Command connection is troublesome , You can ask the user name and password to be saved in iterm2 On , Connect directly through shortcut keys
- Create a new one profile( The above steps are )
- Settings on profile Shortcut keys
- Create a new script file .sh file
#!/usr/bin/expect
set timeout 30
spawn ssh -p [lindex $argv 0] [lindex $argv 1]@[lindex $argv 2]
expect {
"(yes/no)?"
{send "yes\n";exp_continue}
"password:"
{send "[lindex $argv 3]\n"}
}
interact
interact```
In the document 4 Parameters argv 0、argv 1、argv 2、argv 3 Represent the Port number IP Address user name password .
Pay attention to adding execution permission to the script file
chmod u+x .sh
- iterm2 Configure the script file + port +ip+ user name + password
5. Shortcut key
5.1. label
new label :command + t
Turn off the tag :command + w
Toggle label :command + Numbers 、 command + Left right key
lookup :command + f
5.2. Split screen
Vertical split screen :command + d
Horizontal split screen :command + shift + d
Switch screens :command + option + Direction key 、 command + [ or command + ]
Toggle full screen :command + enter
5.3. Query history
View history command ( Automatic display completion ):command + ; iterm2 Automatically list similar commands that have been entered before
Search command history :ctrl + r
View clipboard history :command + shift + h
5.4. Editing area
Clear current line :ctrl + u
To the beginning of the line :ctrl + a
end :ctrl + e
Delete the character of the current cursor :ctrl + d
Delete the character before the cursor :ctrl + h
Delete the word before the cursor :ctrl + w
Delete to end of text :ctrl + k
Exchange text at cursor :ctrl + t
Last order :ctrl + p
Clear the screen 1:command + r Switch to a new screen , Not clear
Clear the screen 2:ctrl + l
5.5. Built in shortcut keys
⌘ + The numbers are in each section tab The label switches directly back and forth
Select and copy + Middle mouse button paste , This is very practical
⌘ + f The search will be automatically copied
⌘ + d Split the screen horizontally / ⌘ + shift + d Vertical split screen
⌘ + r = clear, And it's just a new screen , I don't want to clear Create an empty screen
ctrl + u Clear the current line , No matter where the cursor is
After entering the opening command Press ⌘ + ; It will automatically list the entered commands
⌘ + shift + h It lists the history of the clipboard
Can be in Preferences > keys Set the global shortcut to call up iterm, This can also be used Alfred Realization
5.6. Common shortcut key
⌘ + 1 / 2 about tab Switch back and forth between , This is in front I've already introduced
⌘← / ⌘→ To the far left of a line of command / Far right , This function is the same as C+a / C+e
⌥← / ⌥→ Move forward by word / Move backward , Equivalent to C+f / C+b, In fact, this function Iterm It's pre-defined in ,⌥f / ⌥b, I'm used to it
The setting method is as follows
Of course, in addition to these can be customized can not forget linux Let's make some good combinations
C+a / C+e This can be used almost anywhere
C+p / !! Last order
C+k Delete from the cursor to the end of the command line ( Originally C+u It's at the beginning of the command line , but iterm I'm going to delete the whole line )
C+w A+d Delete from the cursor to the beginning / tail
C+h C+d Delete the words before and after the cursor
C+y Paste after cursor
C+r Search command history , This is more commonly used
Choose your favorite color scheme .
stay Preferences->Profiles->Colors Of load presets You can choose a color scheme . You can download it yourself . On website http://iterm2colorschemes.com/, Almost all available color schemes can be found .
Copy when selected
iterm2 Yes 2 An easy-to-use select and copy mode .
One is using a mouse , stay iterm2 in , Select a path or a word , that ,iterm2 It's copied automatically .
The other is no mouse mode ,command+f, eject iterm2 Search mode for , Enter the first few letters of what you want to find and copy , Make sure you find your own content , Input tab, The search window will automatically change the content , And copy it . If the input is shift+tab, Then the left side of the search content will be selected and copied automatically .
Screen cutting
command+d: Vertical segmentation
command+shift+d: Horizontal segmentation
Done automatically
Enter the first few letters , Then input command+; iterm2 Similar commands that have been entered before will be listed automatically .
Cut history
Input command+shift+h,iterm2 The history of the clipboard is automatically listed . If you need to save the history of the clipboard to disk , stay Preferences > General > Save copy/paste history to disk. Set in .
Full screen switching
command+enter Enter and return to full screen mode
Exposé all Tab
command+option+e, And you can search
reference
边栏推荐
- Rong Tui [jsoi2011] special products
- Flink SQL configures Kafka to chain a topic with multiple partitions, and there is no error. There is no problem with a single partition
- JS学习笔记17:DOM查询练习
- Example | apicloud AVM framework encapsulates the cascade selection bullet frame of provinces and cities
- 电商用户行为数据分析
- 请问想加载torch预训练好的模型用于mindspore模型finetune有什么方法?
- 深度详解多链钱包系统开发功能及多币种钱包系统开发原理分析
- Iterm2安装与使用
- 【刷题日记】最长回文子串
- opencv学习(5)之鼠标操作 归一化 放缩 图像翻转
猜你喜欢
随机推荐
实验二 货物进销管理系统
Graphic explanation redis cluster and expansion
Use of & & operators
Graph theory review usaco2006jan gold separation path
Grid网格布局常考面试题
485电流采集模块DAM-8041
关于链游系统开发(智能合约上链原理分析说明)丨NFT链游系统开发原理分析及案例
Istio 将应用暴露到互联网
Global 1000+ researchers train super large models live on twitter??
Exercice récursif fonctionnel (version Easy)
Inequality learning notes
Mysql on duplicate key update用法及优缺点
使用八叉树结构来管理场景
实例|APICloud AVM框架封装滑动单元格组件
C# 在Word中添加多行多列文字水印
磁盘性能与容量
npm warn config global `--global`, `--local` are deprecated. Use ` --location solution
全球1000+研究员在Twitter直播训练超大模型??
Is CITIC Securities a state-owned enterprise? Is it safe?
力扣121题:买卖股票的最佳时机