Learn RStudio Shortcuts for Windows
Console Shortcuts
Action |
RStudio Shortcut Keys |
Move the cursor to Console |
Ctrl + 2 |
Clear Console |
Ctrl + L |
Move the cursor to the beginning of the line |
Home |
Move the cursor to the end of the line |
End |
Navigate command history |
Up & Down Arrow key |
Popup command history |
Ctrl + Up Arrow key |
Interrupt currently executing the command |
Esc |
Change working directory |
Ctrl + Shift + H |
Source Shortcuts
Action |
RStudio Shortcuts |
Goto File/Function |
Ctrl + . |
Move the cursor to Source Editor |
Ctrl + 1 |
New document (except on Chrome/Windows) |
Ctrl + Shift + N |
New document (Chrome only) |
Ctrl + Alt + Shift + N |
Open Document |
Ctrl + O |
Save active document |
Ctrl + S |
Close active document (except on Chrome) |
Ctrl + W |
Close active documents (Chrome only) |
Ctrl + Alt + W |
Close all open documents |
Ctrl + Shift + W |
Preview HTML (Markdown and HTML) |
Ctrl + Shift + K |
Knit Document (knitr) |
Ctrl + Shift + K |
Compile Notebook |
Ctrl + Shift + K |
Compile PDF (TeX and Sweave) |
Ctrl + Shift + K |
Insert chunk (Sweave and Knitr) |
Ctrl + Alt + I |
Insert code section |
Ctrl + Shift + R |
Run current line/selection |
Ctrl + Enter |
Run current line/selection (retain cursor position) |
Alt + Enter |
Re-run previous region |
Ctrl + Shift + P |
Run current document |
Ctrl + Alt + R |
Run from document beginning to the current line |
Ctrl + Alt + B |
Run from current line to document end |
Ctrl + Alt + E |
Run the current function definition |
Ctrl + Alt + F |
Run the current code section |
Ctrl + Alt + T |
Run previous Sweave/Rmd code |
Ctrl + Alt + P |
Run the current Sweave/Rmd chunk |
Ctrl + Alt + C |
Run the next Sweave/Rmd chunk |
Ctrl + Alt + N |
Source a file |
Ctrl + Shift + O |
Source the current document |
Ctrl + Shift + S |
Source the current document (with echo) |
Ctrl + Shift + Enter |
Fold Selected |
Alt + L |
Unfold Selected |
Shift + Alt + L |
Fold All |
Alt + O |
Unfold All |
Shift + Alt + O |
Go to line |
Shift + Alt + G |
Jump to |
Shift + Alt + J |
Switch to tab |
Ctrl + Shift + . |
Previous tab |
Ctrl + F11 |
Next tab |
Ctrl + F12 |
First tab |
Ctrl + Shift + F11 |
Last tab |
Ctrl + Shift + F12 |
Navigate back |
Ctrl + F9 |
Navigate forward |
Ctrl + F10 |
Extract function from selection |
Ctrl + Alt + X |
Extract variable from the selection |
Ctrl + Alt + V |
Reindent lines |
Ctrl + I |
Comment/uncomment current line/selection |
Ctrl + Shift + C |
Reflow Comment |
Ctrl + Shift + / |
Reformat Selection |
Ctrl + Shift + A |
Show Diagnostics |
Ctrl + Shift + Alt + P |
Move Lines Up |
Alt + Up Arrow key |
Move Lines Down |
Alt + Down Arrow key |
Copy Lines Up |
Shift + Alt + Up Arrow key |
Copy Lines Down |
Shift + Alt + Down Arrow key |
Jump to Matching Brace/Paren |
Ctrl + P |
Expand to Matching Brace/Paren |
Ctrl + Shift + E |
Select Matching Brace/Paren |
Ctrl + Shift + Alt + E |
Add Cursor Above the Current Cursor |
Ctrl + Alt + Up Arrow key |
Add Cursor Below Current Cursor |
Ctrl + Alt + Down Arrow key |
Move the Active Cursor Up |
Ctrl + Alt + Shift + Up Arrow key |
Move the Active Cursor Down |
Ctrl + Alt + Shift + Down Arrow key |
Find and Replace |
Ctrl + F |
(Windows) Find Next |
F3 |
(Linux) Find Next |
Ctrl + G |
(Windows) Find Previous |
Shift + F3 |
(Linux) Find Previous |
Ctrl + Shift + G |
Use Selection for Find |
Ctrl + F3 |
Replace and Find |
Ctrl + Shift + J |
Find in Files |
Ctrl + Shift + F |
Check Spelling |
F7 |
Editing Shortcuts
Action |
RStudio Shortcuts |
Undo |
Ctrl + Z |
Redo |
Ctrl + Shift + Z |
Cut |
Ctrl + X |
Copy |
Ctrl + C |
Paste |
Ctrl + V |
Select All |
Ctrl + A |
Jump to Word |
Ctrl + Left & Right Arrow key |
Jump to Start |
Ctrl + Home |
Jump to End |
Ctrl + End |
Delete Line |
Ctrl + D |
Select |
Shift + Up Arrow key |
Select Word |
Ctrl + Shift + Left & Right Arrow key |
Select Line Start |
Alt + Shift + Left Arrow key |
Select Line End |
Alt + Shift + Right Arrow key |
Select Page Up |
Shift + Page Up key |
Select Page Down |
Shift + Page Down key |
Select to Start |
Ctrl + Shift + Home |
Select to End |
Ctrl + Shift + End |
Delete Word Left |
Ctrl + Backspace |
(at beginning of line) Indent |
Tab |
Outdent |
Shift + Tab |
Yank line up to the cursor |
Ctrl + U |
Yank line after the cursor |
Ctrl + K |
Insert currently yanked text |
Ctrl + Y |
Insert assignment operator |
Alt + – |
Insert pipe operator |
Ctrl + Shift + M |
Show help for function at the cursor |
F1 |
Show source code for function at the cursor |
F2 |
Find usages for symbol at cursor (C++) |
Ctrl + Alt + U |
Views Shortcuts
Action |
RStudio Shortcut keys |
Move focus to Source Editor |
Ctrl + 1 |
Move focus to the Console |
Ctrl + 2 |
Move focus to Help |
Ctrl + 3 |
Show History |
Ctrl + 4 |
Show Files |
Ctrl + 5 |
Show Plots |
Ctrl + 6 |
Show Packages |
Ctrl + 7 |
Show Environment |
Ctrl + 8 |
Show Git/SVN |
Ctrl + 9 |
Show Build |
Ctrl + 0 |
Sync Editor & PDF Preview |
Ctrl + F8 |
Show Keyboard Shortcut Reference |
Alt + Shift + K |
Build Shortcuts
Action |
RStudio Shortcuts |
Build and Reload |
Ctrl + Shift + B |
Load All (dev tools) |
Ctrl + Shift + L |
Test Package (Desktop) |
Ctrl + Shift + T |
Test Package (Web) |
Ctrl + Alt + F7 |
Check Package |
Ctrl + Shift + E |
Toggle Breakpoint |
Ctrl + Shift + D |
Debug Shortcuts
Action |
RStudio Shortcuts |
Toggle Breakpoint |
Shift + F9 |
Execute Next Line |
F10 |
Step Into Function |
Shift + F4 |
Finish Function/Loop |
Shift + F6 |
Continue |
Shift + F5 |
Stop Debugging |
Shift + F8 |
READ NEXT: