Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
I’ve played around a bit with the Eclipse Color Themes plugin by Felix Dahlke and Roger Dudler as they added support for the R editor that ships with plugin StatET late last year.
The outcome is a little color theme called rappster. The nice thing with those color themes is that you can make your syntax highlighting settings portable as you can simply import the theme of your choice in another instance of Eclipse, e.g. when updating to a newer version.
Unfortunately, the StatET editor is not available for previews at Eclipse Color Themes website, so I’ve added a couple of screenshots of how the theme handles the syntax highlighting of R code:
Screenshot 1
Screenshot 2
Instructions for installation
If you don’t have a recent Eclipse installation together with the StatET plugin yet, then
- go to http://www.eclipse.org/downloads/, grab the desired version of the Classic Installer (Eclipse Classic 3.x.x)
- Open up Eclipse, select a working directory.
- Go to [Window > Preferences > Install New Software…], enter the StatET URL that is associated to your Eclipse version (check this at http://www.walware.de/it/statet/installation.mframe), click the [Add] button, assign a name (StatET) and click your way through the further installation process.
- Next you need to set up at least one R run configuration. This is more or less self explanatory once you find [Run > Run Configurations…] and double click on the category [R Console]. If you ran the configuration once, it shows up in the run configurations short cuts list (little black arrow next the the bigger green/white arrow button in Eclipse’s icon bar.
- Create an R project in the Package Explorer/Project Explorer (depends on perspective): right click, then [New > Other > StatET > R project]. Confirm the switch to the StatET perspective.
- Create an R script file in your R project: [New > R script file].
################################
###### Install Eclipse Marketplace ####
################################
- Go to [Help > Install New Software…] and select the entry in the drop-down menu [Work with:] that corresponds to the identifier of the respective Eclipse version
(e.g. Helios, Indigo etc.; for Indigo, this would be: Indigo – http://download.eclipse.org/releases/indigo). - Find category [General Purpose Tools], expand it, find sub-category [Marketplace Client], check its check box, click on the [Next >] button, click on it again in the next screen that appears, accept the terms of license agreement in the next screen that appears, then finally click on the [Finish] button.
- Wait for the installation to complete and restart Eclipse by clicking on button [Restart Now].
######################################
##### Install Eclipse Plugin Color Theme #####
######################################
This plugin enables the use of predefined color themes for text editors. The website of the maintainers can be found at http://www.eclipsecolorthemes.org/
- Go to [Help > Eclipse Marketplace] and enter Color Theme in the text box [Find:] and hit the [ENTER] key
- Find entry [Eclipse Color Theme] and click on the [Install] button, then the [Next] button, accept the terms of the license agreement and click the [Finish] button
- In case of a security warning, accept the further installation by clicking on the [OK] button.
- Wait for the installation to complete and restart Eclipse by clicking on button [Restart Now].
#################################
##### Install Color Theme rappster #####
#################################
- Go to http://www.eclipsecolorthemes.org/?list=all&q=rappster and download the XML file associated to the color theme.
- In Eclipse, go to [Window > Preferences > General > Appearance > Color Theme] and click on button [Import a theme…]
- Select the XML file you just downloaded (theme-6130.xml)
- In the left pane ([Theme:]), select color theme rappster and click the [OK] button.
- Open up an arbitrary R script to see the effects of setting the rappster color theme.
Have fun!
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.