Skip to content

Instantly share code, notes, and snippets.

@umeshunni
Created June 19, 2013 00:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save umeshunni/5810883 to your computer and use it in GitHub Desktop.
Save umeshunni/5810883 to your computer and use it in GitHub Desktop.
Sublime Text Keybindings for working with R files in SubREPL. Based on tomschenkjr's blog post on the topic. Refer to http://tomschenkjr.net/using-sublime-text-2-for-r/ for context.
[
{ "keys": ["command+shift+r"], "command": "repl_transfer_current", "args": {"scope": "selection"}, "context":
[
{ "operand": "source.r", "operator": "equal", "match_all": true, "key": "selector" }
]},
{ "keys": ["command+shift+r", "r"], "command": "repl_transfer_current", "args": {"scope": "selection", "action":"view_write"}, "context":
[
{ "operand": "source.r", "operator": "equal", "match_all": true, "key": "selector" }
]},
// Executes the entire file (build) in REPL, latter only displays code and does not execute
{ "keys": ["command + f7"], "command": "repl_transfer_current", "args": {"scope": "file"}, "context":
[
{ "operand": "source.r", "operator": "equal", "match_all": true, "key": "selector" }
]},
{ "keys": ["command + f7", "r"], "command": "repl_transfer_current", "args": {"scope": "file", "action":"view_write"}, "context":
[
{ "operand": "source.r", "operator": "equal", "match_all": true, "key": "selector" }
]},
// Executes line(s) of text in REPL terminal, latter only displays code and does not execute
{ "keys": ["command+alt+r"], "command": "repl_transfer_current", "args": {"scope": "lines"}, "context":
[
{ "operand": "source.r", "operator": "equal", "match_all": true, "key": "selector" }
]},
{ "keys": ["command+alt+r", "r"], "command": "repl_transfer_current", "args": {"scope": "lines", "action":"view_write"}, "context":
[
{ "operand": "source.r", "operator": "equal", "match_all": true, "key": "selector" }
]},
// Executes a block (e.g., a custom function) of text in REPL terminal, latter only displays code and does not execute
{ "keys": ["command+shift+alt+r"], "command": "repl_transfer_current", "args": {"scope": "block"}, "context":
[
{ "operand": "source.r", "operator": "equal", "match_all": true, "key": "selector" }
]},
{ "keys": ["command+shift+alt+r", "r"], "command": "repl_transfer_current", "args": {"scope": "block", "action":"view_write"}, "context":
[
{ "operand": "source.r", "operator": "equal", "match_all": true, "key": "selector" }
]}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment