3

I'm unable to completely disable syntax highlighting for Java source code files in Notepad++.

I've commented out the Java sections in langs.model.xml and stylers.model.xml (even tried deleting those files to no avail) but if I create a new file and then save a file with .java extension then, bang! syntax colouring kicks in. Grrrrr. any way to do this?

You might think it's an absurd requirement but I'm preparing a Java certification and it's better to practise programming with no syntax help at all but I still like to use Notepad++ because I'm used to it and for its other features (multi-tabbed interface, reopen last used files... etc) instead of crappy plain old win notepad.

Thanx

1 Answer 1

6

I'm not sure why commenting out the relevant sections did not work - was Notepad++ closed when you did that?

An alternative method is to disable the language from within Notepad++ and then add a user defined language assigned to the java extension.

  1. Go to Settings > Preferences > Language Menu/Tab Settings.

  2. Select Java on the Available items list.

  3. Click the arrow to add it to the Disabled items list.

    Screenshot of settings
    Click for full size

  4. Go to View > User-Defined Dialogue....

  5. Create New..., name it whatever you like. I named it Java_normal.

  6. Add java to the Ext. textbox.

    Screenshot of dialogue
    Click for full size

  7. Close the User Defined Language window.

  8. Restarting Notepad++ may be necessary.

8
  • Already done that, it doesn't help. As I understand it this preference modification just removes it from the interface, that is, Java disappears from the "Language" menu which lists available languages but not from the program "internals". If you create a new file and save it with .java ext it will still colourize it.
    – danirod
    May 10, 2012 at 8:15
  • @b4nd0ler0 Updated, this one should work. The user defined language with no highlighting should override the built in one - and I've actually tested making a new/saving/opening a .java file. There's more details at the official wiki, here.
    – Bob
    May 10, 2012 at 8:47
  • 1
    That definitively works. Thank you so much, you're a star. For the record I have also disabled the built-in brace matching in Prefs.>Misc.>Highlight matching tags
    – danirod
    May 11, 2012 at 5:48
  • What about just setting the current document to normal text mode?
    – Royi
    Oct 10, 2017 at 11:33
  • 1
    @Royi The question asked about Java source in general, so having to change the language every time you open a file is probably not great.
    – Bob
    Oct 10, 2017 at 13:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .