Text Editors


Command Description
ESC:q! The Most Important Vim Command™
i Exit normal mode, enter insertion mode
ESC Exit insertion mode, enter normal mode
Arrow keys Move around
0 Go to beginning of line
$ Go to end of line
:w Save (write) a file
:q Quit a file (must be saved)
:wq Write and quit a file
:q! Force-quit a file, discarding any changes
u Undo
x Delete the character under the cursor
dd Delete a line
p Put (paste) deleted text
Ctrl-F Go forward one screen
Ctrl-B Go backward one screen
G Go to last line
1G Go to first line
/<string> Search for <string>



Command Description
⌘← Move to beginning of line (stops on whitespace)
⌘→ Move to end of line
⌘↑ Move to beginning of file
⌘↓ Move to end of file
⇧-move Select text
⌘D Select current word
⌘A Select All (entire document)
⌘X/⌘C/⌘V Cut/Copy/Paste
⌘Z Undo
⇧⌘Z or ⌘Y Redo
⌘S Save
⌘F Find
⌘G Find next
Command Description
Select + ⌘/ Toggle commenting out
Select + ⇥ Indent
Select + ⇧⇥ Dedent
⌃G Goto line number
⌘W Close a tab
$ echo $PATH Show the current path
$ chmod +x <filename> Make filename executable
$ unzip <filename>.zip Unzip a ZIP archive
⌘P Fuzzy opening
⌘1 Switch focus to tab #1
⇧⌘F Global find and replace