M-x all-things-emacs

Quick Tip: Highlighting Java .properties Files

March 1st, 2007 by Rob Christie · 13 Comments

Java .properties files are normally formatted using conf-javaprop-mode. Recently, I was frustrated because a single quote in a property was highlighted such that multiple lines were colored like a string until there was another quote on another line. I decided I was going to fix it… It turns out that I didn’t have to look far. C-h f conf-javaprop-mode led me to read about conf-mode which led to finding the command conf-quote-normal. This command sets the syntax of ‘ and “ to punctuation. This is the joy of using emacs. It’s the little things. My new .emacs snippet follows:

(add-hook 'conf-javaprop-mode-hook 
          '(lambda () (conf-quote-normal nil)))

Before

Before conf-quote-normal

After

After conf-quote-normal

Tags: java · quick · tips

13 responses so far ↓

  • 1 Ryan McGeary // Feb 24, 2007 at 5:13 pm

    By default, conf-quote-normal is also bound to C-c ' in case you only want to enable it once for a current buffer.

    (bound to C-c " and C-c C-q too)

  • 2 Engagement rings // Jul 22, 2015 at 12:32 am

    ... [Trackback]

    [...] Read More: emacsblog.org/2007/03/01/quick-tip-highlighting-java-properties-files/ [...]

  • 3 Personal Trainer Seattle // Jul 22, 2015 at 12:43 am

    ... [Trackback]

    [...] Read More here: emacsblog.org/2007/03/01/quick-tip-highlighting-java-properties-files/ [...]

  • 4 Con-Cret Pre Workout // Jul 23, 2015 at 4:18 pm

    ... [Trackback]

    [...] Find More Informations here: emacsblog.org/2007/03/01/quick-tip-highlighting-java-properties-files/ [...]

  • 5 amazin gas station video // Jul 24, 2015 at 9:02 am

    ... [Trackback]

    [...] Informations on that Topic: emacsblog.org/2007/03/01/quick-tip-highlighting-java-properties-files/ [...]

  • 6 amazin gas station video // Jul 24, 2015 at 10:37 am

    ... [Trackback]

    [...] Find More Informations here: emacsblog.org/2007/03/01/quick-tip-highlighting-java-properties-files/ [...]

  • 7 criminal defense lawyer // Jul 24, 2015 at 9:25 pm

    ... [Trackback]

    [...] Informations on that Topic: emacsblog.org/2007/03/01/quick-tip-highlighting-java-properties-files/ [...]

  • 8 Atlanta // Jul 25, 2015 at 1:53 pm

    ... [Trackback]

    [...] Read More here: emacsblog.org/2007/03/01/quick-tip-highlighting-java-properties-files/ [...]

  • 9 locksmith Sacramento ca // Jul 26, 2015 at 6:23 am

    ... [Trackback]

    [...] Read More: emacsblog.org/2007/03/01/quick-tip-highlighting-java-properties-files/ [...]

  • 10 granite bay Locksmith // Jul 26, 2015 at 6:34 am

    ... [Trackback]

    [...] Read More here: emacsblog.org/2007/03/01/quick-tip-highlighting-java-properties-files/ [...]

  • 11 Buy Propecia Online Ohio Cheap // Jul 27, 2015 at 9:33 am

    ... [Trackback]

    [...] Read More: emacsblog.org/2007/03/01/quick-tip-highlighting-java-properties-files/ [...]

  • 12 marsna.com // Jul 27, 2015 at 2:56 pm

    ... [Trackback]

    [...] There you will find 80982 more Infos: emacsblog.org/2007/03/01/quick-tip-highlighting-java-properties-files/ [...]

  • 13 surf shop online // Jul 28, 2015 at 6:48 am

    ... [Trackback]

    [...] Read More here: emacsblog.org/2007/03/01/quick-tip-highlighting-java-properties-files/ [...]