Skip to content

Instantly share code, notes, and snippets.

@nobitagit
Last active August 24, 2023 12:16
Show Gist options
  • Save nobitagit/729fc16b8c16edb9a2fe390d6f312c66 to your computer and use it in GitHub Desktop.
Save nobitagit/729fc16b8c16edb9a2fe390d6f312c66 to your computer and use it in GitHub Desktop.
iterm2 cheatsheet

This gist has been moved to its own Github repo, so it's easier to contribute with additions and corrections. Please open a PR there if you see any mistake, I don't track comments on here as there's no notification system for gists AFAIK. Thanks.

Tabs and Windows

Function Shortcut
Previous Tab + Left Arrow
Next Tab + Right Arrow
Go to Tab + Number
Go to Window + Option + Number
Go to Split Pane by Direction + Option + Arrow
Go to Split Pane by Order of Use + ] , + [
Split Window Horizontally (same profile) + D
Split Window Vertically (same profile) + d
Split Window Horizontally (new profile) Option + + H
Split Window Vertically (new profile) Option + + V
Resize current splitted pane Ctrl + + Arrow
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 Option + f
Move backward a word Option + 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 Option + d
Cut from cursor to the start of word Option + Backspace
Cut from cursor to previous whitespace Ctrl + w
Paste the last cut text Ctrl + w
Loop through and paste previously cut text Option + y
Loop through and paste the last argument of previous commands Option + .

Search the Command History

Function Shortcut
Search as you type Ctrl + r and type the search term; Repeat Ctrl + r to loop through result
Search the last remembered search term Ctrl + r twice
End the search at current history entry Ctrl + y
Cancel the search and restore original line Ctrl + g

Bonus tricks

Name the current tab in iTerm. >

# Add this to your .bash_profile and then:
# $ title tabName
function title {
    echo -ne "\033]0;"$*"\007"
}
@mwmcode
Copy link

mwmcode commented Apr 4, 2018

👍

@acharyab15
Copy link

Hey, I saw that you have the shortcut for Paste the last cut text as the same as Cut from cursor to previous whitespace. I think the former is not correct. Was unable to find the correct shortcut but just letting you know.

@gayan415
Copy link

gayan415 commented Sep 22, 2018

Good post.
Split Window Horizontally (same profile) <= should this be + shift + d ?

@mohammedri
Copy link

Nice! Great post

@kennethy
Copy link

Good post.
Split Window Horizontally (same profile) <= should this be + shift + d ?

cmd + shift + d works for me.

@Batkhishig-N
Copy link

Thanks bro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment