RStudio shortcuts: a selection

editor
shortcut
rstudio
Author

Nicolas Casajus

Published

February 27, 2024

This post lists useful shortcuts that will increase your productivity in using RStudio IDE. This subset is a subjective selection: for more shortcuts, press the combination Alt + Shift + K.

Table 1. A subjective selection of RStudio shortcuts
Category Action Key combination
Navigation

Go to next tab

Go to previous tab

Ctrl + Tab

Ctrl + Shift + Tab

Panels

Move cursor to Editor

Move cursor to Console

Move cursor to Terminal

Expand Editor panel

Expand Console panel

Ctrl + 1

Ctrl + 2

Alt + Shift + M

Ctrl + Shift + 1

Ctrl + Shift + 2

Files

Create a new .R file

Save file

Close file

Ctrl + Shift + N

Ctrl + S

Ctrl + W

Editor

Comment/uncomment current line/selection

Send current line/selection to Console

Send current line/selection to Terminal

Insert assignment operator (<-)

Insert pipe operator (%>% or |>)

Move current line up

Move current line down

Delete current line

Duplicate current line (below)

Yank (cut) line up to cursor

Yank (cut) line after cursor

Add a cursor above current cursor

Add a cursor below current cursor

Add a cursor on the click

Ctrl + Shift + C

Ctrl + Return

Ctrl + Shift + Return

Ctrl + Shift + +

Ctrl + Shift + Return

Alt + Up

Alt + Down

Ctrl + D

Ctrl + Shift + D

Ctrl + U

Ctrl + K

Ctrl + Alt + Up

Ctrl + Alt + Down

Ctrl + Alt + Click

Build

Load project (devtools::load_all())

Check package (devtools::check())

Knit/Render/Preview .(R|q)md files

Insert code chunk in .(R|q)md files

Ctrl + Shift + L

Ctrl + Shift + E

Ctrl + Shift + K

Ctrl + Alt + I

Other Clear console/terminal Ctrl + L