jedit usually makes a good job of editing files with various languages in it, for example jsp files contain some java code, sweave files contain some R code, brew templates contain R code, R code might contain XML code (if you use the R4X package, but we'll get to this one some other time). Unfortunately, because jedit uses the same color styles for all languages, you don't get so much of a visual aid to tell you that you switched languages, enters Nested

Nested is a simple jedit plugin that paints the background of a code chunk differently if this code is not coming from the same mode as the mode of the buffer, and the color is left to the user's choice. Here is an example with some java code within a JSP file, the pink background around the java statement comes from the Nested plugin.

The colours are controlled by a file residing on the plugin directory that looks like this :

html,css,#eeeeee
jaxx,java,#ccff99
jaxx,xml,#ffffff
jsp,java,#fff2ff

but you can also use the Nested dockable window to control things

nesteddock.png

Java code will appear in pink inside a jsp file, java code will appear green inside jaxx files, ... and you can click on the colour if you want to change it to something else

When you open a file that contains sub-languages, an entry will automatically be inserted in the settings if it does not exist yet, in that case, the colour used is the same as the background color of the view, so that by default nothing changes.