SublimeText 3 and R: Setup and Usage

My favorite text editor for coding — TextWrangler — has been retired. I’m using this as a forced push (avoiding BBEdit) to make a full switch to SublimeText. Here’s the setup that I’m using on a Mac running macOS 10.14.

First, Install R and SublimeText 3. Next, within SublimeText, do the following:

  • Install Package Control
  • Then Install the following packages: R-Box, SendCode, SublimeREPL

Interestingly, it seems like a file has to be actually saved as a .R for SendCode to open up the multiple options for sending code to the R Gui (and other targets). Similarly, SublimeREPL R was not functioning until I saved the source file as a .R. The default key bindings for sending code then worked nicely.

When I tried SublimeText before, I almost exclusively used SublimeREPL with a 2-column layout (i.e., the source code on the left and REPL on the right). What’s frustrating about this is that sending code to REPL moves the cursor, which disrupts my workflow.

I like that SendCode makes it easy to direct my source code to a shell or to the R Gui. The latter best mimics my workflow with TextWrangler.

I’m going to force myself to use SublimeText for a bit–resisting the urge to drift back to the known.