Notes to Self

Alex Sokolsky's Notes on Computers and Programming

iTerm2 Terminal Emulator

I use iTerm2. Consider this vscode color theme.

Here is a cheat sheet from here.

Keys

Tabs and Panes

Function Shortcut
Next tab ⌘ + →
Previous tab ⌘ + ←
Go to tab ⌘ + number
Go to pane ⌘ + Opt + number
Go to pane by direction ⌘ + Opt + arrow
Go to pane by order ⌘ + ], ⌘ + [
Split pane Horizontally (same profile) ⌘ + D
Split pane Vertically (same profile) ⌘ + d
Split pane Horizontally (new profile) ⌘ + Opt + H
Split pane Vertically (new profile) ⌘ + Opt + V
Set Mark ⌘ + M
Jump to Mark ⌘ + J

Basic Moves

Function Shortcut
Move back one character Ctrl + b
Move forward one character Ctrl + f
Delete current character Ctrl + d
Delete previous character Backspace
Undo Ctrl + -

Moving Faster

Function Shortcut
Move to the start of line Ctrl + a
Move to the end of line Ctrl + e
Move forward a word Opt + f
Move backward a word Opt + b
Clear the screen ⌘ + k

Cut and Paste

Function Shortcut
Cut from cursor to the end of line Ctrl + k
Cut from cursor to the end of word Opt + d
Cut from cursor to the start of word Opt + Backspace
Cut from cursor to previous whitespace Ctrl + w
Paste the last cut text Ctrl + w
Loop through and paste previously cut text Opt + y
Loop through and paste the last argument of previous commands Opt + .

Search the Command History

Function Shortcut
Incremental search Ctrl + r and type, repeat Ctrl + r to loop
Search the last remembered search term Ctrl + r Ctrl + r
End the search at current history entry Ctrl + y
Cancel the search and restore original line Ctrl + g