========================== RStudio keyboard shortcuts ========================== First published at 1/31/2019 on https://defkey.com/rstudio-shortcuts RStudio is an integrated development environment (IDE) for R programming language. R is used for graphics and statistical calculations. Distributed as free and open-source, RStudio was first released on February 2011. RStudio has 145 shortcuts and we have listed all of them below. Console ------- Ctrl + 2 Move cursor to Console Ctrl + L Clear console Home Move cursor to beginning of line End Move cursor to end of line Up arrow / Down arrow Navigate command history Ctrl + Up arrow Popup command history Esc Interrupt currently executing command Ctrl + Shift + H Change working directory Source ------ Ctrl + . Goto File/Function Ctrl + 1 Move cursor to Source Editor Ctrl + Shift + N New document (except on Chrome/Windows) Ctrl + Alt + Shift + N New document (Chrome only) Ctrl + O Open document Ctrl + S Save active document Ctrl + W Close active document (except on Chrome) Ctrl + Alt + W Close active document (Chrome only) Ctrl + Shift + W Close all open documents Ctrl + Shift + K 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 + Alt + I Insert chunk (Sweave and Knitr) Ctrl + Shift + R Insert code section Ctrl + Enter Run current line/selection Alt + Enter Run current line/selection (retain cursor position) Ctrl + Shift + P Re-run previous region Ctrl + Alt + R Run current document Ctrl + Alt + B Run from document beginning to current line Ctrl + Alt + E Run from current line to document end Ctrl + Alt + F Run the current function definition Ctrl + Alt + T Run the current code section Ctrl + Alt + P Run previous Sweave/Rmd code Ctrl + Alt + C Run the current Sweave/Rmd chunk Ctrl + Alt + N Run the next Sweave/Rmd chunk Ctrl + Shift + O Source a file Ctrl + Shift + S Source the current document Ctrl + Shift + Enter Source the current document (with echo) Alt + L Fold Selected Shift + Alt + L Unfold Selected Alt + O Fold All Shift + Alt + O Unfold All Shift + Alt + G Go to line Shift + Alt + J Jump to Ctrl + Shift + . Switch to tab Ctrl + F11 Previous tab Ctrl + F12 Next tab Ctrl + Shift + F11 First tab Ctrl + Shift + F12 Last tab Ctrl + F9 Navigate back Ctrl + F10 Navigate forward Ctrl + Alt + X Extract function from selection Ctrl + Alt + V Extract variable from selection Ctrl + I Reindent lines Ctrl + Shift + C Comment/uncomment current line/selection Ctrl + Shift + / Reflow Comment Ctrl + Shift + A Reformat Selection Ctrl + Shift + Alt + P Show Diagnostics Alt + Up arrow / Down arrow Move Lines Up/Down Shift + Alt + Up arrow / Down arrow Copy Lines Up/Down Ctrl + P Jump to Matching Brace/Paren Ctrl + Shift + E Expand to Matching Brace/Paren Ctrl + Shift + Alt + E Select to Matching Brace/Paren Ctrl + Alt + Up arrow Add Cursor Above Current Cursor Ctrl + Alt + Down arrow Add Cursor Below Current Cursor Ctrl + Alt + Shift + Up arrow Move Active Cursor Up Ctrl + Alt + Shift + Down arrow Move Active Cursor Down Ctrl + F Find and Replace F3 (Windows) Find Next Ctrl + G (Linux) Find Next Shift + F3 (Windows) Find Previous Ctrl + Shift + G (Linux) Find Previous Ctrl + F3 Use Selection for Find Ctrl + Shift + J Replace and Find Ctrl + Shift + F Find in Files F7 Check Spelling Editing (Console and Source) ---------------------------- Ctrl + Z Undo Ctrl + Shift + Z Redo Ctrl + X Cut Ctrl + C Copy Ctrl + V Paste Ctrl + A Select All Ctrl + Left arrow / Right arrow Jump to Word Ctrl + Home Jump to Start/End Ctrl + End Jump to Start/End Ctrl + Up arrow / Down arrow Jump to Start/End Ctrl + D Delete Line Shift + Arrow keys Select Ctrl + Shift + Left arrow / Right arrow Select Word Alt + Shift + Left arrow Select to Line Start Alt + Shift + Right arrow Select to Line End Shift + Page Up / Down Select Page Up/Down Ctrl + Shift + Home Select to Start/End Ctrl + Shift + End Select to Start/End Shift + Alt + Up arrow / Down arrow Select to Start/End Ctrl + Backspace Delete Word Left Tab (at beginning of line) Indent Shift + Tab Outdent Ctrl + U Yank line up to cursor Ctrl + K Yank line after cursor Ctrl + Y Insert currently yanked text Alt + - Insert assignment operator Ctrl + Shift + M Insert pipe operator F1 Show help for function at cursor F2 Show source code for function at cursor Ctrl + Alt + U Find usages for symbol at cursor (C++) Completions (Console and Source) -------------------------------- Tab Attempt completion Ctrl + Space Attempt completion Up arrow / Down arrow Navigate candidates Enter Accept selected candidate Tab Accept selected candidate Right arrow Accept selected candidate Esc Dismiss completion popup Views ----- Ctrl + 1 Move focus to Source Editor Ctrl + 2 Move focus to Console Ctrl + 3 Move focus to Help Ctrl + 4 Show History Ctrl + 5 Show Files Ctrl + 6 Show Plots Ctrl + 7 Show Packages Ctrl + 8 Show Environment Ctrl + 9 Show Git/SVN Ctrl + 0 Show Build Ctrl + F8 Sync Editor & PDF Preview Alt + Shift + K Show Keyboard Shortcut Reference Build ----- Ctrl + Shift + B Build and Reload Ctrl + Shift + L Load All (devtools) Ctrl + Shift + T Test Package (Desktop) Ctrl + Alt + F7 Test Package (Web) Ctrl + Shift + E Check Package Ctrl + Shift + D Document Package Debug ----- Shift + F9 Toggle Breakpoint F10 Execute Next Line Shift + F4 Step Into Function Shift + F6 Finish Function/Loop Shift + F5 Continue Shift + F8 Stop Debugging Plots ----- Ctrl + Alt + F11 Previous plot Ctrl + Alt + F12 Next plot Git / SVN --------- Ctrl + Alt + D Diff active source document Ctrl + Alt + M Commit changes Ctrl + Up arrow/Down arrow Scroll diff view Space Stage/Unstage (Git) Enter Stage/Unstage and move to next (Git) Session ------- Ctrl + Q Quit Session (desktop only) Ctrl + Shift + F10 Restart R Session Last modified on (UTC): Monday, November 11, 2019 Defkey © All rights reserved.