configurable run command in R terminal?
See original GitHub issueIs your feature request related to a problem? Please describe.
The R extension has keybindings for some key R functions like nrow, devtools::test() etc. It would be nice to be able to configure our own keybindings that run code in the active R terminal.
Describe the solution you’d like
A command added to the extension like this:
async function runCommandInRTerm({ text }: { text: string }) {
const callableTerminal = await chooseTerminal();
if (callableTerminal === undefined) {
return;
}
callableTerminal.sendText(text);
}
Allows keybinding config like this to work:
[
{
"description": "run drake::r_make()",
"key": "ctrl+;",
"command": "r.runCommandInRTerm",
"when": "editorTextFocus",
"args": {
"text": "drake::r_make()\n"
}
}
]
Describe alternatives you’ve considered
Adding commands directly to the extension via PRs - seems unlikely to scale well and create unnecessary maintenance overhead for niche use cases.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:8 (1 by maintainers)
Top Results From Across the Web
A Comprehensive Introduction to Command Line for R Users
In this tutorial, you will be introduced to the command line. We have selected a set of commands we think will be useful...
Read more >4 ways to be more productive, using RStudio's terminal
1. Execute resource-heavy R code in the Terminal quickly · Shift + Alt + R Shift + Alt + R to open a...
Read more >How do I configure R so programs developed in RStudio run ...
We want to be able to develop programs in RStudio, and then run them from a command line (i.e., in batch mode in...
Read more >Run R command from command line - Stack Overflow
You can do it with the R command: $ R --slave -e '1+1' [1] 2. From man R : --slave Make R run...
Read more >R Installation and Administration
R will configure and build under most common Unix and Unix-alike platforms ... You can run command-line R and Rscript from a Terminal...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I’ll have a go.
Another idea I had is a variant of this that take the current word or selection and sends it as an arg.
Would enable stuff like:
Thoughts on that one?
Closed by #237.