Keyboard shortcuts

standard used in quite every anythings

  • ctrl + c: copy
  • ctr + v: paste
  • ctr + x: cut
  • ctrl + z: undo
  • ctrl + shift + z: restore undo
  • ctrl + a: select all
  • ctrl + f: find/replace
  • ctrl + w: close active tab

Rstudio specific

  • ctrl + shift + n: new script
  • alt + -: insert assignment operator correctly spaced
  • ctrl + Enter: run block of code
  • ctrl + shift + F10: restart R
  • ctrl + shift + s: source the active file
  • ctrl + shift + i: insert chunk
  • ctrl + shift + m: insert pipe
  • ctrl + l: clean the console
  • ctrl + shift + c: comment selected lines (or active line)
  • F1: help
  • F2: source code of function
  • ctrl + alt + double left click: multiple word selection
  • alt + hold left click: free cursor positioning or rectangular selection
  • alt + ctrl + (multi) single left click: free (multi) positioning cursor
  • [on the console] (some typing +) ctrl + up-arrow: inspect the history (filtered according to start with "some typing")

Last night I remapped the Shift + space to add tabs (or 2 spaces) in editor.

I will be using this a lot.

The tab activates code completion, and from what I've read there's no way to turn that off outside of a custom build of R studio.

The shortcut Ctrl + Alt + E (Run From Line to End) is not working for me. Does anyone have the same problem?

What annoyed me most is that "ctrl + shift + R" on Rstudio server reloads browser page instead of inserting section as in Rstudio desktop.
does anyone know how to make all shortcuts the same for browser Rstudio and Desktop Rstudio?

My favourite, by the way is "ctrl + shift + A" for reformatting code

Any idea why ctrl + alt + I doesn't insert a code chunk in windows. It just created a weird symbol "í" in my computer.

A post was split to a new topic: Create a shortcut to jump to History based on selection

I had the same issue. I decided it was good to be able to keep the shortcuts CtrlAlt$vowel for accented characters, and I just remapped the shortcut for insert chunk to a different combination (I used CtrlAlt' but you could use anything else suitable).

I use CtrlAlt. to insert a %>% pipe... Basically I kept hitting that combination instead of Ctrl-Alt-M (my mind associates the > on the . key with the pipe) so I thought I might as well just go with it :smile: