Skip to the main content
Back to RStudio

RStudio keyboard shortcuts

55 shortcuts, from Shortivo Keys last checked on September 14, 2026.

Blocks and structure 2 shortcuts

Action Windows Mac
Toggle the document outline Source editor Ctrl + Shift + O Cmd + Shift + O
Toggle a breakpoint Debugging Shift + F9 Shift + F9

Code editing 6 shortcuts

Action Windows Mac
Insert a code chunk Source editor Ctrl + Alt + I Cmd + Option + I
Insert a code section Source editor Ctrl + Shift + R Cmd + Shift + R
Run the current code section Source editor Ctrl + Alt + T Cmd + Option + T
Fold every section Source editor Alt + O Cmd + Option + O
Unfold every section Source editor Shift + Alt + O Cmd + Shift + Option + O
Rename a symbol in scope Source editor Ctrl + Alt + Shift + M Cmd + Option + Shift + M

Comments and review 2 shortcuts

Action Windows Mac
Knit, preview or compile the document Source editor Ctrl + Shift + K Cmd + Shift + K
Comment or uncomment lines Source editor Ctrl + Shift + C Cmd + Shift + C

Editing 22 shortcuts

Action Windows Mac
Move the cursor to the console Anywhere Ctrl + 2 Ctrl + 2
Clear the console Console Ctrl + L Ctrl + L
Interrupt the running command Console Esc Esc
Change the working directory Anywhere Ctrl + Shift + H Ctrl + Shift + H
Move the cursor to the source editor Anywhere Ctrl + 1 Ctrl + 1
Run the whole document Source editor Ctrl + Alt + R Cmd + Option + R
Run the current chunk Source editor Ctrl + Alt + C Cmd + Option + C
Source the current document Source editor Ctrl + Shift + S Cmd + Shift + S
Delete the line Console or source Ctrl + D Cmd + D
Insert the assignment operator Console or source Alt + - Option + -
Insert the pipe operator Console or source Ctrl + Shift + M Cmd + Shift + M
Show help for the function at the cursor Console or source F1 F1
Show the source of the function at the cursor Console or source F2 F2
Show the keyboard shortcut reference Anywhere Alt + Shift + K Option + Shift + K
Build and reload the package Package project Ctrl + Shift + B Cmd + Shift + B
Check the package Package project Ctrl + Shift + E Cmd + Shift + E
Document the package Package project Ctrl + Shift + D Cmd + Shift + D
Continue running Debugging Shift + F5 Shift + F5
Stop debugging Debugging Shift + F8 Shift + F8
Move focus to the terminal Anywhere Alt + Shift + M Shift + Option + M
Undo the last edit Console or source Ctrl + Z Cmd + Z
Redo the undone edit Console or source Ctrl + Shift + Z Cmd + Shift + Z

Files and printing 5 shortcuts

Action Windows Mac
Open a document Anywhere Ctrl + O Cmd + O
Save the active document Source editor Ctrl + S Cmd + S
Save every document Anywhere Ctrl + Alt + S Cmd + Option + S
Close every open document Anywhere Ctrl + Shift + W Cmd + Shift + W
Open a new terminal Anywhere Alt + Shift + R Shift + Option + R

Navigation 8 shortcuts

Action Windows Mac
Go to a file or function Anywhere Ctrl + . Ctrl + .
Run from the start to the current line Source editor Ctrl + Alt + B Cmd + Option + B
Run from the current line to the end Source editor Ctrl + Alt + E Cmd + Option + E
Go to a line Source editor Shift + Alt + G Cmd + Shift + Option + G
Go to the next section Source editor Ctrl + Page Down Cmd + Page Down
Go to the previous section Source editor Ctrl + Page Up Cmd + Page Up
Run the next line Debugging F10 F10
Restart the R session Anywhere Ctrl + Shift + F10 Cmd + Shift + F10

Paragraphs and lists 1 shortcut

Action Windows Mac
Reindent the lines Source editor Ctrl + I Cmd + I

Search 3 shortcuts

Action Windows Mac
Find and replace Source editor Ctrl + F Cmd + F
Find in files Anywhere Ctrl + Shift + F Cmd + Shift + F
Show the command palette Anywhere Ctrl + Shift + P Cmd + Shift + P

Selection 4 shortcuts

Action Windows Mac
Run the current line or selection Source editor Ctrl + Enter Cmd + Return
Extract a function from the selection Source editor Ctrl + Alt + X Cmd + Option + X
Extract a variable from the selection Source editor Ctrl + Alt + V Cmd + Option + V
Reformat the selection Source editor Ctrl + Shift + A Cmd + Shift + A

View and zoom 2 shortcuts

Action Windows Mac
Show the plots pane Anywhere Ctrl + 6 Ctrl + 6
Show the environment pane Anywhere Ctrl + 8 Ctrl + 8

From Shortivo at https://shortivo.net/platforms/rstudio/. A dot means the maker does not document a key for that system. Nothing on this sheet was converted from one system to another.