Shortcuts RStudio for Windows

134 shortcuts2,384 views
Open Trainer

Console

WindowsAction
Ctrl+2Move cursor to console
Ctrl+LClean console
HomeMove cursor to beginning of line
EndMove cursor to end of line
Up/DownNavigate command history
Ctrl+UpPopup command history
EscInterrupt currently executing command
Ctrl+Shift+HChange working directory

Source

WindowsAction
Ctrl+.Goto file/function
Ctrl+1Move cursor to source editor
Ctrl+Shift+NNew document (except on chrome/windows)
Ctrl+Alt+Shift+NNew document (Chrome only)
Ctrl+OOpen document
Ctrl+SSave active document
Ctrl+WClose active document (except on Chrome)
Ctrl+Alt+WClose active document (Chrome only)
Ctrl+Shift+WClose all open documents
Ctrl+Shift+KPreview HTML (markdown and HTML)
Ctrl+Shift+KCompile notebook/compile PDF (TeX and Sweave)
Ctrl+Alt+IInsert chunk (Sweave and Knitr)
Ctrl+Shift+RInsert code section
Ctrl+EnterRun current line/selection
Alt+EnterRun current line/selection (retain cursor position)
Ctrl+Shift+PRe-run previous region
Ctrl+Alt+RRun current document
Ctrl+Alt+BRun from document beginning to current line
Ctrl+Alt+ERun from current line to document end
Ctrl+Alt+FRun from current line to document end
Ctrl+Alt+TRun the current code section
Ctrl+Alt+PRun previous sweave/Rmd code
Ctrl+Alt+CRun the current Sweave/Rmd chunk
Ctrl+Alt+NRun the next Sweave/Rmd chunk
Ctrl+Shift+OSource a file
Ctrl+Shift+SSource the current document
Ctrl+Shift+EnterSource the current document (with echo)
Alt+LFold selected
Shift+Alt+LUnfold selected
Alt+OFold all
Shift+Alt+OUnfold all
Shift+Alt+GGo to line
Shift+Alt+JJump to
Ctrl+Shift+.Switch to tab
Ctrl+F11Previous tab
Ctrl+F12Next tab
Ctrl+Shift+F11First tab
Ctrl+Shift+F12Last tab
Ctrl+F9Navigate back
Ctrl+F10Navigate forward
Ctrl+Alt+XExtract function from selection
Ctrl+Alt+VExtract variable from selection
Ctrl+IReindent lines
Ctrl+Shift+CComment/uncomment current line/selection
Ctrl+Shift+/Reflow comment
Ctrl+Shift+AReformat selection
Ctrl+Shift+Shift+PShow diagnostics
Alt+Up/DownMove lines Up/Down
Shift+Alt+Up/DownCopy lines Up/Down
Ctrl+PJump to matching Brace/Paren
Ctrl+Shift+EExpand to matching Brace/Paren
Ctrl+Shift+Alt+ESelect to matching Brace/Paren
Ctrl+Alt+UpAdd cursor above current cursor
Ctrl+Alt+DownAdd cursor beow current cursor
Ctrl+Alt+Shift+UpMove active cursor up
Ctrl+Alt+Shift+DownMove Active Cursor Down
Ctrl+FFind and replace
F3Find next
Shift+F3Find previous
Ctrl+F3Use selection for find
Ctrl+Shift+JReplace and find
Ctrl+Shift+FFind in files
F7Check spelling

Completions (Console and Source)

WindowsAction
Tab/Ctrl+SpaceAttempt completion
Up/DownNavigate candidates
Enter/Tab/RightAccept selected candidate
EscDismiss completion popup

Views

WindowsAction
Ctrl+1Move focus to Source Editor
Ctrl+2Move focus to Console
Ctrl+3Move focus to Help
Ctrl+4Show History
Ctrl+5Show files
Ctrl+6Show plots
Ctrl+7Show packages
Ctrl+8Show environment
Ctrl+9Show git/svn
Ctrl+0Show build
Ctrl+F8Sync editor & pdf preview
Alt+Shift+KReference

Build

WindowsAction
Ctrl+Shift+BBuild and reload
Ctrl+Shift+LLoad all (devtools)
Ctrl+Shift+TTest package (desktop)
Ctrl+Alt+F7Test package (web)
Ctrl+Shift+ECheck package
Ctrl+Shift+DDocument package

Debug

WindowsAction
Shift+F9Toggle breakpoint
F10Execute next line
Shift+F4Step into function
Shift+F6Finish function/loop
Shift+F5Continue
Shift+F8Stop debugging

Plots

WindowsAction
Ctrl+Alt+F11Previous plot
Ctrl+Alt+F12Next plot

Git / SVN

WindowsAction
Ctrl+Alt+DDiff active source document
Ctrl+Alt+MCommit changes
Ctrl+Up/DownScroll diff view
SpacebarStage/unstage(Git)
ENterStage/unstage and move to next (Git)

Session

WindowsAction
Ctrl+QQuit Session (desktop only)
Ctrl+Shift+F10Restart R Session

Editing (Console and Source)

WindowsAction
Ctrl+ZUndo
Ctrl+Shift+ZRedo
Ctrl+XCut
Ctrl+CCopy
Ctrl+VPaste
Ctrl+ASelect all
Ctrl+Left/RightJump to word
Ctrl+Home/End/Ctrl+Up/DownJump to start/end
Ctrl+DDelete line
Shift+ArrowSelect
Ctrl+Shift+Left/RightSelect word
Alt+Shift+LeftSelect to line start
Alt+Shift+RIghtSelect to line end
Shift+Page Up/Shift+Page downSelect page up/down
Ctrl+Shift+Home/EndSelect page start/end
Ctrl+BackspaceDelete word left
TabIndent
Shift+TabOutdent
Ctrl+UYank line up to cursor
Ctrl+KYank line after cursor
Ctrl+YInsert currently yanked text
Alt+-Insert assignment operator
Ctrl+Shift+MInsert pipe operator
F1Show help for function at cursor
F2Show source code for function at cursor
Ctrl+Alt+UFind usages for symbol at cursor (C++)