iTerm2 common settings and shortcut keys

1. Set the window
Navigate to [Preferences - Profiles - Window] and set the style of the new window to [Top of Screen], so that every time you open a new terminal, it will appear at the top of the screen and there will be no window border. If you also use multiple Spaces and dual monitors, it will be more convenient to choose Main Screen and All Space at the same time.
 
2. Set the shortcut key
This step is very simple, navigate to [Preferences - Keys - Hotkey], there are two options, the first is to set the global shortcut key, under the premise of starting iTerm, use this shortcut key to show or hide window. The second one specifies which Profile to use for the new window. Here, it is specified as the one with WIndow set in Step1. Checking this option can obtain the ability to fade in and out when displaying/hiding the window.
 
3.Tips
    3.1 need full screen? Copy the original Profile and then assign shortcut keys, then WIndow - Style select full screen.
    3.2 "CMD+D" splits the window horizontally, in order to keep the interface simple, uncheck [Show per-pane title bar …] in [Preferences - Appearance]
    3.4 If you use the way to start iTerm, uncheck [Preferences - General] [Quit when all windows are closed]
    3.5 Check [Focus follows mouse] in [Preferences - Pointer] to facilitate switching between windows.
 
4. Select and copy
iterm2 has 2 easy-to-use select and copy modes.
 
One is to use the mouse to select a certain path or a certain word in iterm2, then iterm2 will automatically copy it.
 
The other is no mouse mode, command+f, pop up the search mode of iterm2, enter the first few letters of the content to be searched and copied, after confirming that the content is found, enter tab, the search window will automatically change the content, and copy it. If the input is shift+tab, the left side of the search content will be automatically selected and copied.
 
5. Cut history
Enter command+shift+h, iterm2 will automatically list the history of the clipboard
 
6. Full screen switch
command+enter to enter and return to full screen mode
 
Other commands:
Find: Cmd+f
Autocomplete: Cmd+;
Command History : Cmd+Shift+H
Command playback: Cmd+Alt+B
iTerm2 Exposé: Cmd+ Alt+E
Ctrl+a: move the cursor to the beginning of the line
Ctrl+e: move the cursor to the end of the line
Ctrl+f: move forward one character
Ctrl+b: Back one character
Ctrl+l: Clear the screen
Ctrl+p: Display the history command
Ctrl+r: Reverse search
Ctrl+d: Delete the current character
Ctrl+h: Delete the previous character
Ctrl+w: Delete the character before the cursor
Ctrl+k: Delete the entire line after the cursor

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326721956&siteId=291194637