Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tomschenkjr/2790415 to your computer and use it in GitHub Desktop.
Save tomschenkjr/2790415 to your computer and use it in GitHub Desktop.
R-friendly keybindings
[
// Modified Sublime-REPL keybindings for an "R-friendly" set of shortcuts.
// Copy and paste this text into the Key Bindings - User (under Preferences menu).
// For more information, see http://tomschenkjr.net/2012/05/17/using-sublime-text-2-for-r/
// Executes a selection of text in REPL, latter only displays code and does not execute
{ "keys": ["ctrl+shift+r"], "command": "repl_transfer_current", "args": {"scope": "selection"}},
{ "keys": ["ctrl+shift+r", "r"], "command": "repl_transfer_current", "args": {"scope": "selection", "action":"view_write"}},
// Executes the entire file (build) in REPL, latter only displays code and does not execute
{ "keys": ["ctrl + f7"], "command": "repl_transfer_current", "args": {"scope": "file"}},
{ "keys": ["ctrl + f7", "r"], "command": "repl_transfer_current", "args": {"scope": "file", "action":"view_write"}},
// Executes line(s) of text in REPL terminal, latter only displays code and does not execute
{ "keys": ["ctrl+alt+r"], "command": "repl_transfer_current", "args": {"scope": "lines"}},
{ "keys": ["ctrl+alt+r", "r"], "command": "repl_transfer_current", "args": {"scope": "lines", "action":"view_write"}},
// Executes a block (e.g., a custom function) of text in REPL terminal, latter only displays code and does not execute
{ "keys": ["ctrl+shift+alt+r"], "command": "repl_transfer_current", "args": {"scope": "block"}},
{ "keys": ["ctrl+shift+alt+r", "r"], "command": "repl_transfer_current", "args": {"scope": "block", "action":"view_write"}}
]
@stianlagstad
Copy link

Thanks for these and for your ST+R tutorial. One thing: The spaces in "ctrl + f7" caused problems for me, and I had to remove them to get it working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment