Replacing UniSciTE with Notepad++

Notepad++ is a powerful text editor based on Scintilla (which is where UniSciTE is also based from). It is available only in Windows.

I’ve managed to make use of Notepad++ as a replacement text editor for Unity.

  • it can manage more than ten text files opened simultaneously
  • customizable color scheme

I turned this into a wiki page by the way: http://www.unifycommunity.com/wiki/index.php?title=Using_Notepad_Plus_Plus_as_a_script_editor

Directions:

  1. Notepad++ can be found in http://notepad-plus.sourceforge.net/uk/site.htm

Download and install.

  1. Change your External Script Editor to Notepad++ (In Unity, Edit> Preferences > General)

  2. Unity should now open Notepad++ whenever you double-click a script (or any text file actually).

To add searching of Unity Documentation within Notepad++:

  1. Download the Language Help Plugin via the Plugin Manager: Plugins > Plugin Manager > Show Plugin Manager. Then choose “Language Help” from the list, and click Install.
  2. Go to Plugins > Language Help > Options…
  3. Click Add and put these values
    Name: Unity
    Extension List: js
    Extended help file path: Unity - Scripting API:

Now whenever you press ctrl+f1 while your cursor is on a word, it will search that word in the Unity documentation.

To enable highlighting of unity “keywords”:

  1. Open C:\Program Files\Unity\Editor\Data\Tools\UniSciTE\unitykeywords.properties

This text file contains all the unity keywords.

  1. Open C:\Program Files\Notepad++\stylers.xml (If you’re using a custom theme, open C:\Program Files\Notepad++\themes and open the theme XML file you are using.)

  2. Find “”

  3. Find the

  4. Insert all the unity keywords (found from the unitykeywords.properties you opened earlier) inside that tag

  5. Save it. Close and open Notepad++. It should highlight the Unity keywords now.

How to add Intellisense (called Auto-Completion in Notepad++) for Unityscript:

  1. Turn on Auto-Completion by going to: Settings > Preferences > Backup/Auto-Completion. Check “Function parameters hint on input”

  2. Open C:\Program Files\Notepad++\plugins\APIs\javascript.xml (or cs.xml if you use C#).

  3. Copy paste contents of https://dl.dropbox.com/u/25260770/Unity-Notepad++/UnityApi_to_Npp-3.5.txt to anywhere inside the tags of the xml file.

  4. Close and open Notepad++. A function tooltip should now appear whenever you type in an open parenthesis after a Unity function.

Note: The UnityJS_to_Npp.txt is created from the file found as C:\Program Files\Unity\Editor\Data\Tools\UniSciTE\UnityJS.api, converting it using a program I made (http://dl.dropbox.com/u/25260770/Unity-Notepad++/UnityJSapi_to_Npp.py). If ever the UnityJS.api changes (in case of a Unity update), just edit and run the python script.

How to make Notepad++ jump to the correct line number from the error console

Change the external script editor’s command line arguments in the Unity preferences window. See the part about “External Tools” in Unity - Manual: Preferences

286390--10251--$unity_notepadpp_2_160.jpg

Sweetness.

Adding highlighting and auto completion does not work for me. What version do you have?

5.6.8

Maybe my directions are a bit confusing. Here’s a stylers.xml (zipped) file preedited with Unity keywords, put it on C:\Program Files\Notepad++\ overwrite the old file.

Here’s also a javascript.xml (zipped) put it in C:\Program Files\Notepad++\plugins\APIs, overwrite the old file

289492–10343–$javascriptxml_878.zip (26.2 KB)
289492–10344–$stylersxml_168.zip (18.7 KB)

So very very close. Just the highlighting is not working.

Edit: Fixed it, I went into the toolbar and clicked setting, then Style configurator, language javascript, and style keywords. I added in all the terms on the bottom right box.

Thanks for the help :smile:.

That might not add all keywords as the text box only accepts so much text and the Unity keywords are so many.

Try typing “zero”, it should highlight. If not, edit your stylers.xml file and make sure it includes all keywords.

I will tomorrow. I am just going to bed. Thanks for ze help.:smile:

Well done mate!

I had already replaced the default editor with NPP, but not to this extent. Now if you could include steps for C# you dirty slacker :slight_smile:

Monodevelop is good for C#!

It doesn’t work for me either, and I d/l both of your files and installed them. There was no styler.xml in my folder, just styler model.xml (I have just update Notepad++ to the latest version)

I put styler.xml in the correct folder, but it does not highlight Abs or zero. I am at a loss. I have quit out of Unity and Notepad++, and reloaded Unity, dbl clicked on a script and Notepad++ came up OK, but no highlighting.

Thanks for your help, and the files, it is a great idea, and i will love it when I get it to work.

Have you any ideas?

Go into your notepad++ folder, then in to the themes folder.
Which ever theme you are using, do the instructions.
If you are using the default, then try renaming his stylers.xml to styles.xml.

Oh, you were using a different theme! Ok, I changed the instructions to account for that fact.

I thought you couldn’t get it to work?

Stylers is the correct name, and I don’t use any themes. I think the problem may be a slight change in syntax in the latest version of NP++ with the closing tag.

I’ll mess around some more.

Thanks.

It should be fairly easy to do it, whenever I mention javascript in my instructions, just look for the C# equivalent, for example, instead of looking for , look for .

And the UnityJS.api I checked with UnityCS.api, their md5 hashes are a match, so the files I created should work too for C#. Just open cs.xml instead of javscript.xml

Let me just quote myself:

For me the file name is not stylers.xml. Actually, there wasn’t a file like that at all.

That doesn’t work! Only a fraction of the words appear in that box. I thought you had fixed it some other way.

@ anomalous_underdog

I still can’t get it to work. I am using 5.6.8 which I just updated tonight. I will see if I can find my previous version on my HDD, and see if I can get that to work.

Thank you for your effort in this matter. I never said i was using themes. It is just a bog standard install, and I floowed the instructions. I installed both of your files, and highlghting just wont work.

Ya, so I ended up editing the theme xml file I use instead.

I got it to work by adding the Keywords to the langs.xml file, and deleting the ones that were in there already for JS.

The AutoComplete and the Help both work as well. Super job, I can’t thank you enough for this anomalous_underdog. You are a star!

SmokeymonkeyS made a solution to the error-line-jumping problem.

The only disadvantage has vanished!

http://www.smokymonkeys.com/kyrill/index.asp?direct=254
japanese

http://translate.google.com/translate?hl=nl&sl=ja&tl=en&u=http://www.smokymonkeys.com/kyrill/index.asp%3Fdirect%3D254&twu=1
translated page

Its whole project Kyrill-site is very good btw.

:smile: :idea:

AWESOME! Got it all to work…what I had to do was add the keywords to the lang.xml in the Javascript section after the default keywords (in order to keep them). If I added them to the Style Configurator it wouldn’t highlight about 1/3 of the words, putting them directly in lang.xml highlights all words.

To have Notepad++ jump to the correct line number you must back up the original uniscite.exe, copy THESE TWO FILES INTO THE UNISCITE DIR, and make sure you use the BUILT-IN editor…it will launch Notepad++ and go to the correct line when you double click on an error msg in the Unity error console.

EDIT: This is per the instructions at the page listed above mine…google translate pages aren’t the easiest thing to read when trying to follow directions sometimes lol

EDIT: Updated Wiki with the relevant information to make it jump to the correct line location.