A comprehensive guide to essential keyboard shortcuts
Created
January 1, 2023
Modified
July 30, 2025
Master your workflow with essential keyboard shortcuts across popular development tools and applications.
VSCode
Pro Tip
VSCode has excellent keyboard shortcut customization. Press Cmd/Ctrl + K Cmd/Ctrl + S to access the Keyboard Shortcuts editor.
General Commands
Action
Mac
Windows
Command Palette
Cmd + Shift + P
Ctrl + Shift + P
Open Settings
Cmd + ,
Ctrl + ,
Keyboard Shortcuts
Cmd + K Cmd + S
Ctrl + K Ctrl + S
Toggle Sidebar
Cmd + B
Ctrl + B
Full Screen
Cmd + Ctrl + F
F11
Open File
Cmd + P
Ctrl + P
New Window
Cmd + Shift + N
Ctrl + Shift + N
Close Window
Cmd + Shift + W
Ctrl + Shift + W
Terminal Management
Terminal Management
Toggle Terminal
Cmd + `
Ctrl + `
Create New Terminal
Cmd + Shift + `
Ctrl + Shift + `
Navigate Between Terminals
Cmd + Shift + [ / ]
Ctrl + PgUp / PgDn
Split Terminal
Cmd + \
Ctrl + \
Navigate Between Split Terminal
Cmd + Option + ← / →
Alt + ↑ / ↓
Editor Management
Editor Management
Close Tab
Cmd + W
Ctrl + W
Split Editor
Cmd + \
Ctrl + \
Navigate Tabs
Cmd + Shift + Tab
Ctrl + Shift + Tab
Navigate Tab Groups
Cmd + 1 / 2 / 3
Ctrl + 1 / 2 / 3
Text Manipulation
Text Manipulation
Add Multiple Cursors
Cmd + Option + ↑ / ↓
Ctrl + Alt + ↑ / ↓
Scroll horizontal
Shift + Mouse wheel
Shift + Mouse wheel
Select Text
Cmd + Shift + ↑ / ↓
Ctrl + Shift + ↑ / ↓
Move Line Up/Down
Option + ↑ / ↓
Alt + ↑ / ↓
Copy Line Up/Down
Shift + Option + ↑ / ↓
Shift + Alt + ↑ / ↓
Select Word
Cmd + D
Ctrl + D
Select Current Line
Cmd + L
Ctrl + L
Select All Occurrences
Cmd + Shift + L
Ctrl + Shift + L
Delete Current Line
Cmd + Shift + K
Ctrl + Shift + K
Delete Word Backward
Option + Backspace
Ctrl + Backspace
Comment/Uncomment Lines
Cmd + /
Ctrl + /
Navigation & Search
Navigation & Search
Go to Line
Cmd + G
Ctrl + G
Go to last cursor position
Ctrl + -
Alt + ←
Go to next cursor position
Ctrl + Shift + -
Alt + →
Go to Word Start/End
Option + ← / →
Ctrl + ← / →
Go to Line Start/End
Cmd + ← / →
Home / End
Go to File Start/End
Cmd + ↑ / ↓
Ctrl + Home / End
Search Files
Cmd + Shift + F
Ctrl + Shift + F
Find Text
Cmd + F
Ctrl + F
Replace Text
Cmd + Option + F
Ctrl + H
Code Formatting
Code Formatting
Code Folding
Cmd + Option + [ / ]
Ctrl + Shift + [ / ]
Indent/Outdent Lines
Cmd + [ / ]
Ctrl + [ / ]
Format Selected Code
Cmd + K Cmd + F
Ctrl + K Ctrl + F
Format Document
Shift + Option + F
Shift + Alt + F
Shell
📖 About Terminal Shortcuts
These shortcuts work in most Unix-like terminals including Terminal.app on macOS, GNOME Terminal, and Windows Terminal with WSL.
Cursor Movement
Action
Shortcut
Move to the beginning of line
Ctrl + A
Move to the end of line
Ctrl + E
Move one word backward
Opt + ←
Move one word forward
Opt + →
Move one character backward
←
Move one character forward
→
Jump to the start of buffer
Alt + <
Jump to the end of buffer
Alt + >
Text Editing
Text Editing
Shortcut
Delete the current line
Ctrl + U
Delete to end of the line
Ctrl + K
Clear the screen
Ctrl + L
Delete one word backward
Ctrl + W
Delete one character forward
Ctrl + D
Delete one character forward
Fn + Backspace
Delete one character backward
Backspace
Delete from cursor to start
Alt + Backspace
Delete from cursor to word end
Alt + D
Process Management
Process Management
Shortcut
Terminate a process
Ctrl + C
Suspend a process
Ctrl + Z
Exit the shell
Ctrl + D
Send process to background
Ctrl + Z then bg
Bring background process to fg
fg
History & Commands
History & Commands
Shortcut
Undo the last change
Ctrl + _
Recall previous command
↑
Recall next command
↓
Search command history
Ctrl + R
Exit history search
Ctrl + G
Show history
history
Run the last command
!!
Run last pw command
!pw
Run command # from history
!<number>
Auto-Completion & Misc
Auto-Completion & Misc
Shortcut
Auto-complete command
TAB
List matching commands
TAB TAB
Cycle through matches
TAB TAB TAB...
Open last edited command
Ctrl + X Ctrl + E
Transpose two characters
Ctrl + T
Capitalize word at cursor
Alt + C
Convert word to lowercase
Alt + L
Convert word to uppercase
Alt + U
Swap position with prev word
Ctrl + WAlt + T
Vim
⚠️ Vim Modal Editor
Vim is a modal editor. Remember to press Esc to return to Normal mode before using most commands.
Modes
Action
Shortcut
Insert mode
i
Insert at beginning of line
I
Insert new line below
o
Insert new line above
O
Append after cursor
a
Append at end of line
A
Command mode (normal)
Esc
Visual mode (select text)
v
Visual line mode
V
Visual block mode
Ctrl + v
File Operations
Action
Shortcut
Save
:w
Quit
:q
Save and quit
:wq
Quit without saving
:q!
Save and quit (shortcut)
ZZ
Quit without saving (shortcut)
ZQ
Navigation
Basic Movement
Shortcut
Move left
h
Move down
j
Move up
k
Move right
l
Advanced Movement
Next word
w
Previous word
b
Beginning of line
0
First non-blank of line
^
End of line
$
First line
gg
Last line
G
Go to line 33
33G
Up half a page
Ctrl + u
Down half a page
Ctrl + d
Search & Replace
Search & Replace
Shortcut
Search text
/text
Next match
n
Previous match
N
Search backward
?text
Search current word
*
Editing
Editing
Shortcut
Delete char
x
Delete line
dd
Delete word
dw
Delete to end of line
d$
Delete to start of line
d0
Copy line
yy
Copy word
yw
Paste after cursor
p
Paste before cursor
P
Undo
u
Redo
Ctrl + r
Change text
c
Replace char
r
Join line with next
J
Window Management
Window Management
Shortcut
Split window horizontally
:split
Split window vertically
:vsplit
Move left split
Ctrl + w, h
Move down split
Ctrl + w, j
Move up split
Ctrl + w, k
Move right split
Ctrl + w, l
Increase window size
:resize +N
Decrease window size
:resize -N
Open new tab
:tabnew
Next tab
:tabnext
Previous tab
:tabprev
Tmux
Tmux Configuration
Consider adding these aliases to your shell configuration for quick tmux access. :::
# Terminal aliases for tmuxalias t="tmux"alias ta="t a -t"alias tls="t ls"alias tn="t new -s"alias tk="t kill-session -t"alias tks="t kill-server"
🔧 Custom Prefix Key
Change the default prefix in .tmux.conf:
set-option-g prefix C-abind-key C-a send-prefix
Session Management
Action
Command/Shortcut
List sessions
tmux list-sessions
Attach to session
tmux attach-session -t target-session
Switch between sessions
Ctrl + A + s
Switch to latest session
Ctrl + A + l
Detach from session
Ctrl + A + d
Window Management
Action
Shortcut
List all windows
Ctrl + A + w
Rename current window
Ctrl + A + ,
Switch to next window
Ctrl + A + →
Switch to previous window
Ctrl + A + ←
Create new window
Ctrl + A + c
Kill current window
Ctrl + A + q
Pane Management
Action
Shortcut
Switch to pane above
Shift + ↑
Switch to pane below
Shift + ↓
Switch to pane left
Shift + ←
Switch to pane right
Shift + →
Kill current pane
Ctrl + A + x
Copy Mode
Action
Shortcut
Enter copy mode
Drag mouse to select text
Paste copied text
Ctrl + A + ]
Screen
💡 Screen Aliases
Add these aliases to your shell configuration for easier screen management.
# Terminal aliases for screenalias s="screen"# start a screen sessionalias ss="s -S"# start a named screen sessionalias sr="s -r"# reattach to a screen sessionalias sls="s -ls"# list current running screen sessions