130 RStudio Keyboard Shortcuts

Learn RStudio Shortcuts for Windows

Console Shortcuts

ActionRStudio Shortcut Keys
Move the cursor to ConsoleCtrl + 2
Clear ConsoleCtrl + L
Move the cursor to the beginning of the lineHome
Move the cursor to the end of the lineEnd
Navigate command historyUp & Down Arrow key
Popup command historyCtrl + Up Arrow key
Interrupt currently executing the commandEsc
Change working directoryCtrl + Shift + H

Source Shortcuts

ActionRStudio Shortcuts
Goto File/FunctionCtrl + .
Move the cursor to Source EditorCtrl + 1
New document (except on Chrome/Windows)Ctrl + Shift + N
New document (Chrome only)Ctrl + Alt + Shift + N
Open DocumentCtrl + O
Save active documentCtrl + S
Close active document (except on Chrome)Ctrl + W
Close active documents (Chrome only)Ctrl + Alt + W
Close all open documentsCtrl + Shift + W
Preview HTML (Markdown and HTML)Ctrl + Shift + K
Knit Document (knitr)Ctrl + Shift + K
Compile NotebookCtrl + Shift + K
Compile PDF (TeX and Sweave)Ctrl + Shift + K
Insert chunk (Sweave and Knitr)Ctrl + Alt + I
Insert code sectionCtrl + Shift + R
Run current line/selectionCtrl + Enter
Run current line/selection (retain cursor position)Alt + Enter
Re-run previous regionCtrl + Shift + P
Run current documentCtrl + Alt + R
Run from document beginning to the current lineCtrl + Alt + B
Run from current line to document endCtrl + Alt + E
Run the current function definitionCtrl + Alt + F
Run the current code sectionCtrl + Alt + T
Run previous Sweave/Rmd codeCtrl + Alt + P
Run the current Sweave/Rmd chunkCtrl + Alt + C
Run the next Sweave/Rmd chunkCtrl + Alt + N
Source a fileCtrl + Shift + O
Source the current documentCtrl + Shift + S
Source the current document (with echo)Ctrl + Shift + Enter
Fold SelectedAlt + L
Unfold SelectedShift + Alt + L
Fold AllAlt + O
Unfold AllShift + Alt + O
Go to lineShift + Alt + G
Jump toShift + Alt + J
Switch to tabCtrl + Shift + .
Previous tabCtrl + F11
Next tabCtrl + F12
First tabCtrl + Shift + F11
Last tabCtrl + Shift + F12
Navigate backCtrl + F9
Navigate forwardCtrl + F10
Extract function from selectionCtrl + Alt + X
Extract variable from the selectionCtrl + Alt + V
Reindent linesCtrl + I
Comment/uncomment current line/selectionCtrl + Shift + C
Reflow CommentCtrl + Shift + /
Reformat SelectionCtrl + Shift + A
Show DiagnosticsCtrl + Shift + Alt + P
Move Lines UpAlt + Up Arrow key
Move Lines DownAlt + Down Arrow key
Copy Lines UpShift + Alt + Up Arrow key
Copy Lines DownShift + Alt + Down Arrow key
Jump to Matching Brace/ParenCtrl + P
Expand to Matching Brace/ParenCtrl + Shift + E
Select Matching Brace/ParenCtrl + Shift + Alt + E
Add Cursor Above the Current CursorCtrl + Alt + Up Arrow key
Add Cursor Below Current CursorCtrl + Alt + Down Arrow key
Move the Active Cursor UpCtrl + Alt + Shift + Up Arrow key
Move the Active Cursor DownCtrl + Alt + Shift + Down Arrow key
Find and ReplaceCtrl + F
(Windows) Find NextF3
(Linux) Find NextCtrl + G
(Windows) Find PreviousShift + F3
(Linux) Find PreviousCtrl + Shift + G
Use Selection for FindCtrl + F3
Replace and FindCtrl + Shift + J
Find in FilesCtrl + Shift + F
Check SpellingF7

Editing Shortcuts

ActionRStudio Shortcuts
UndoCtrl + Z
RedoCtrl + Shift + Z
CutCtrl + X
CopyCtrl + C
PasteCtrl + V
Select AllCtrl + A
Jump to WordCtrl + Left & Right Arrow key
Jump to StartCtrl + Home
Jump to EndCtrl + End
Delete LineCtrl + D
SelectShift + Up Arrow key
Select WordCtrl + Shift + Left & Right Arrow key
Select Line StartAlt + Shift + Left Arrow key
Select Line EndAlt + Shift + Right Arrow key
Select Page UpShift + Page Up key
Select Page DownShift + Page Down key
Select to StartCtrl + Shift + Home
Select to EndCtrl + Shift + End
Delete Word LeftCtrl + Backspace
(at beginning of line) IndentTab
OutdentShift + Tab
Yank line up to the cursorCtrl + U
Yank line after the cursorCtrl + K
Insert currently yanked textCtrl + Y
Insert assignment operatorAlt + –
Insert pipe operatorCtrl + Shift + M
Show help for function at the cursorF1
Show source code for function at the cursorF2
Find usages for symbol at cursor (C++)Ctrl + Alt + U

Views Shortcuts

ActionRStudio Shortcut keys
Move focus to Source EditorCtrl + 1
Move focus to the ConsoleCtrl + 2
Move focus to HelpCtrl + 3
Show HistoryCtrl + 4
Show FilesCtrl + 5
Show PlotsCtrl + 6
Show PackagesCtrl + 7
Show EnvironmentCtrl + 8
Show Git/SVNCtrl + 9
Show BuildCtrl + 0
Sync Editor & PDF PreviewCtrl + F8
Show Keyboard Shortcut ReferenceAlt + Shift + K

Build Shortcuts

ActionRStudio Shortcuts
Build and ReloadCtrl + Shift + B
Load All (dev tools)Ctrl + Shift + L
Test Package (Desktop)Ctrl + Shift + T
Test Package (Web)Ctrl + Alt + F7
Check PackageCtrl + Shift + E
Toggle BreakpointCtrl + Shift + D

Debug Shortcuts

ActionRStudio Shortcuts
Toggle BreakpointShift + F9
Execute Next LineF10
Step Into FunctionShift + F4
Finish Function/LoopShift + F6
ContinueShift + F5
Stop DebuggingShift + F8

READ NEXT:

Back to top button