In this blog, I will record some useful keyboard shortcuts for RStudio IDE.

Still, complete information is available directly in the RStudio IDE under the Tools menu: Tools -> Keyboard Shortcuts Help.

Console

  • Change working directory: Ctrl+Shift+H

  • Clear console: Ctrl + L

  • Interrupt currently executing command: Esc

  • Move cursor to end of line: Cmd + Left

  • Move cursor to beginning of line: Cmd + Left

  • Popup command history: Cmd + Up

  • Navigate command history: Up/Down

  • Popup command history: Cmd + Up

Source

  • Insert code section: Cmd + Shift + R

  • Navigate forward: Cmd + F10

  • Insert chunk (Sweave and Knitr): Cmd + Option + I

  • Run current line/selection: Cmd + Return

  • Run the current function definition: Cmd + Option + F

  • Run the current code section: Cmd + Option + T

Editing (Console and Source)

  • Insert assignment operator <- :Option + -

  • Insert pipe operator: Cmd + Shift + M

  • Undo: Cmd + Z

  • Redo: Cmd + Shift + Z

  • Select All: Cmd + A

  • Delete Line: Cmd + D

Session

  • Restart R Session: Cmd + Shift + F10

Help

  • Show Keyboard Shortcut Reference: Option + Shift + K