How to move out of auto-completed quotes or parentheses in RStudio?

Viewed 5241

I find myself wondering how to move the cursor out of a pair of auto-completed double quotes "" or parentheses (). In Eclipse after I finished typing in a pair of brackets, pressing tab brings me out of the brackets. How can I do the same thing in RStudio without using the arrow keys repeatedly?

3 Answers

you can use control+e to go to the end of a line, and control+a to go to the beginning of a line. At least in Mac OS.

Another option could be typing again the same quotation mark used before, while the cursor is at the end of the quote. Let's assume this | is the cursor as in the previous answer:

shift+#: '|'
The same combination of keys will bring the cursor out of the quotation marks
'|' + shift+# -> ''|

Also
shift+2: "|"
And
"|" + shift+2 -> ""|

This works only when the cursor is at the end of the text written in quote:
"Hello world|" + shift+2 -> "Hello world"|
While
"Hello |world" + shift+2 -> "Hello "world".

As for parenthesis, typing the same command will only result in nested parenthesis.
For instance:
shift+8: (|)
and
(|) + shift+8 -> ((|))

I have just tried this on RStudio 1.4 with QWERTZ keyboard.

Related