Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keyboard Shortcut Ctrl+B and Ctrl+I in RMarkdown and RStudio

When writing reports in RMarkdown I realized that hitting Ctrl+B for bold or Ctrl+I for italic won't emphasize the text marked. Many other Markdown editors (for example the editor on StackOverflow) do this job.

For the moment I work with Shift+* after marking the text I want to show in bold which returns *text* which would be displayed in italic. However for making something bold I need to do this twice. And returning the action (removing the **) is not possible with this procedure.

Is there a hidden button somewhere in RStudio where I can turn this option on? Or is there some other solution to this problem like a package who does the job?

like image 560
symbolrush Avatar asked Oct 27 '16 11:10

symbolrush


People also ask

What does Ctrl do in R?

Ctrl+R in an Internet browser In all major Internet browsers (e.g., Chrome, Edge, Firefox, Opera), pressing Ctrl + R refreshes (reloads) the current web page.

What is the keyboard shortcut for running code in RStudio?

Shortcuts to run R codeAlt + Enter – Allows running code without moving the cursor to the next line if you want to run one line of code multiple times without selecting it. Ctrl + Alt + R – Runs the entire script.

How do I create a shortcut in RStudio?

The most straightforward way is to return to the Start menu, find the shortcut for RStudio, then click and hold on that shortcut and drag it to the desktop where we release the mouse button. This is shown in Figure 14. Once the shortcut icon is on the desktop we can just double click it to start RStudio.

How do I change keyboard shortcuts in R?

You can modify a command's shortcut by clicking on the cell containing the current shortcut key sequence, and typing the new sequence you'd like to bind the command to.


1 Answers

One way to do it is installing the addin remedy remotes::install_github("ThinkR-open/remedy") and then to map your preferred key combination to the bold formatting offered by the addon.

So, it's a two-step process. First, install remedy, and then modify the keyboard shortcuts (Tools > Modify Keyboard Shortcuts...).

After installing remedy, there should be a 'bold' option for you in the shortcuts' list to make the binding.

like image 81
streamline Avatar answered Sep 21 '22 22:09

streamline