R-Box
R-Box copied to clipboard
Request: Add keyboard shortcuts
Hi,
Thanks for the good work on R-Box. I use devtools::document()
, devtools::build()
, devtools::test()
and devtools::check()
a lot. It would be nice if R-Box had keyboard shorcuts for these operations.
It would be double-nice if these shortcuts were as close as possible to those used in RStudio:
- source current file: ctrl + shift + S
- build & reload: ctrl + shift + B
- load all: ctrl + shift + L
- test: ctrl + shift + T
- check: ctrl + shift + E
- document: ctrl + shift + D
- render report (rmarkdown, sweave, knitr): ctrl + shift + K
Cheers, Florent
PS/ At the moment, users can probably set up custom R-Box keybindings in: Sublime > Preferences > Key bindings
It seems these were implemented. However the shortcuts now clash with native sublime shortcuts and there's no way to overwrite them. For example: Ctrl+Shift+d in Sublime is duplicate selection. However, when R-Extended is selected as the script type, R-Box overwrites that shortcut and sends the Document Package command Similarly with Ctrl+Shift+t, I can no longer open last closed tab when in R-Extended. It sends a repl command instead
They are disabled in the latest release. It should arrive in Package Control soon.
I mentioned initially that my goal was to set the shortcuts as close as possible to those in RStudio. It's great that @mkirzon is giving feedback on the shortcuts that conflict with those in Sublime. But @randy3k, instead of deleting all these shorcuts, could you please just comment them out? Or even better, find alternatives? Sublime > Preferences > Key binding lists all default key mapping; that can be used to check conflicts.
those interested in the r-box
keybindings for package development, insert these in the sublime keybinding file:
{
"keys": ["ctrl+shift+l"],
"command": "r_box_package_send_code",
"args": { "cmd": "devtools::load_all(\"$folder\")" }
},
{
"keys": ["ctrl+shift+b"],
"command": "r_box_package_send_code",
"args": { "cmd": "devtools::install(\"$folder\")" }
},
{
"keys": ["ctrl+shift+e"],
"command": "r_box_package_send_code",
"args": { "cmd": "devtools::check(\"$folder\")" }
},
{
"keys": ["ctrl+shift+d"],
"command": "r_box_package_send_code",
"args": { "cmd": "devtools::document(\"$folder\")" }
}
Hi,
could you be so kind and maybe also provide the code snippet for the .sublime-keymap--User file to define a shortcut for rendering the current rmarkdown document?
Thanks a lot Jana
Use this for rmakrdown:
{"keys": ["ctrl+shift+k"], "command": "send_code", "args": {"cmd": "browseURL(rmarkdown::render(\"$file\",output_format = "html_document"))" },
"context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.markdown.rmarkdown" }
//one key per keys
]
}