Shortcuts RStudio for MacOS

134 shortcuts2,326 views
Open Trainer

Console

macOSAction
Ctrl+2Move cursor to console
Ctrl+LClean console
Command+LeftMove cursor to beginning of line
Command+RightMove cursor to end of line
Up/DownNavigate command history
Command+UpPopup command history
EscInterrupt currently executing command
Ctrl+Shift+HChange working directory

Source

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

Completions (Console and Source)

macOSAction
Tab/Command+SpaceAttempt completion
Up/DownNavigate candidates
Enter/Tab/RightAccept selected candidate
EscDismiss completion popup

Views

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

Build

macOSAction
Command+Shift+BBuild and reload
Command+Shift+LLoad all (devtools)
Command+Shift+TTest package (desktop)
Command+Option+F7Test package (web)
Command+Shift+ECheck package
Command+Shift+DDocument package

Debug

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

Plots

macOSAction
Command+Option+F11Previous plot
Command+Option+F12Next plot

Git / SVN

macOSAction
Ctrl+Option+DDiff active source document
Ctrl+Option+MCommit changes
Ctrl+Up/DownScroll diff view
SpacebarStage/unstage(Git)
EnterStage/unstage and move to next (Git)

Session

macOSAction
Command+QQuit Session (desktop only)
Command+Shift+F10Restart R Session

Editing (Console and Source)

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