Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reformatting code with R# in a single keyboard shortcut

Using the R# keyboard shortcut for formatting code presents the following window:

enter image description here

which forces me click the Run button every time.

Is there a way to bind a keyboard shortcut directly into the Reformat Code option, rather than just opening this dialog window?

Edit: To make things clear, I don't actually click the Run button with the cursor, I press Enter. (I still find it annoying, and wish for a direct shortcut.)

like image 655
Acidic Avatar asked Jun 16 '12 21:06

Acidic


People also ask

How do I use beautify code in R?

Rstudio can now format code to look neat. Select the lines of interest and then navigate to Code >> Reformat code or use the keyboard shortcut Ctrl + Shift + A . or just run the style directory command to style all the files in the directory. There is a new feature that has been added by R-studio Addins .

What is the format function in R?

format() function in R Programming Language is used to format strings and numbers in a specified style. Parameters: x: is the vector input. digits: is the total number of digits displayed.


1 Answers

Oh sweet.. I just checked Tools -> Options -> Keyboard and found the command "ReSharper_SilentCleanupCode". It seems to execute ReSharper's code formatting function without popping up the dialog. Give it a try but try to not break your fingers... the default is ctrl-alt-shift-f :D That needs a rebind...

like image 122
stmax Avatar answered Sep 28 '22 12:09

stmax