View Full Version : Getting the Most Out of Notepad++
SpudmanWP
January 21st, 2011, 01:52
Here are some things that I have found out about Notepad++ (NPP) that I will be using to make it a better FG2 editor.
First up to bat, full FG2 and Lua keyword spellcheck functionality. This method also supports the right-click "add to dictionary" method.
To enable the check-as-you-go (red-squiggly line) spell check method and have FG2 & Lua keyword support:
1. Disable any spellcheck you already have in NPP.
2. Install the SquigglySpellCheck.dll from https://squiggly.sourceforge.net/ . Then turn on Auto Spell Check in the SquigglySpellChecker menu.
3. Install the Windows version of Aspell https://aspell.net/win32/
4. Install at least one Aspell language pack (check your install directory\dict folder to see if one cam pre-installed). If the 'Aspell\dict' folder is not there, create it.
5. Make sure that aspell-15.dll location must be listed in the system PATH variable. Mine was "C:\Program Files\Aspell\bin". Your PC has to be rebooted for the change to take effect.
6. Download FG2.rws (inside the the attached FG2.zip file) and put it in the Aspell\dict folder.
7. Download the attached Lua.rws when it is ready.. give me a few days :) and put it in the Aspell\dict folder.
8. In the Aspell\dict folder you sill see a file that ends in 'multi' that is for your chosen language. Mine was called "en_US.multi". Open it in notepad. Add a line at that says "add FG2.rws" to the bottom. Mine looked like this:
# Generated with Aspell Dicts "proc" script version 0.50.1
strip-accents true
add en-only.rws
add en_US-only.rws
add FG2.rws
9. Open NPP and all should be fine.
10. You can make your own RWS files by:
a. Put a txt file in the Aspell\bin folder containing a list (one per line) of words. All of the words must contain only letters; no numbers, symbols, or spaces.
b. Run the following command from the Aspell\bin folder:
aspell --lang=en create master ./custom.rws < custom.txt you can name the txt and rws files however you like.
c. Change your ".multi" file and add the new name (as in #8 above).
Here is a sample. Notice that the FG2 keywords are recognized as spelled correctly. The "elseif" will be recognized as soon as I have the Lua.rws finished.
https://i619.photobucket.com/albums/tt271/SpudmanWP/FG2/4f8d028f.jpg
Another thing you can do now is enable the "Function List" ability of NPP. Just make sure that the Lua language is selected and the list will be populated with all the functions.
https://i619.photobucket.com/albums/tt271/SpudmanWP/FG2/5db568dc.jpg
-----------The following feature has not been completed yet-----------
Next up, full auto-completion for Lua and FG2 keywords and functions. Look at this YouTube vid for a sample of how this will work. https://www.youtube.com/watch?v=muJvM-Hz6w4
https://i619.photobucket.com/albums/tt271/SpudmanWP/FG2/c27a8446.jpg
-----------The following feature has not been completed yet-----------
Last up, at least for now, is linking the keywords to my helpfile. In other words you will be able to put your cursor over a keyword and press ctrl-F1 and the helpfile will open up to the appropriate page.
Zeus
January 21st, 2011, 07:21
Neat stuff. I have been using Notepad++ for a while now and use my own custom plugins for FGII/4EParser, however I struggled with getting auto-complete to work so gave up.
Thanks a lot, this should come in really handy.
DrZ.
Zeus
January 21st, 2011, 07:39
I get to step 6 but cannot find the dict folder in the Aspel program directory, all I have is bin, data and doc, 2 text files and a couple of uninstall files. Where did I go wrong?
SpudmanWP
January 21st, 2011, 07:58
If the 'dict' folder is not there, create it.
Zeus
January 21st, 2011, 10:10
Thanks, its installed. I have disabled the NPP SpellChecker plugin, opened a LUA script file, set language to LUA (NPP does this by default for .lua files) but cannot genuinely see any difference.
Keywords are highlighted blue (but then they were before) as a result of LUA language being set. I don't see the Functions in Functions List and commands keywords don't auto-complete. Am I right in thinking I need to wait for your lua.rws file?
Zeus
January 21st, 2011, 10:10
Thanks, its installed. I have disabled the NPP SpellChecker plugin, opened a LUA script file, set language to LUA (NPP does this by default for .lua files) but cannot genuinely see any difference.
Keywords are highlighted blue (but then they were before) as a result of LUA language being set. I don't see the Functions in Functions List and commands keywords don't auto-complete. Am I right in thinking I need to wait for your lua.rws file?
EDIT: I have uninstalled the Function List plugin, it kept crashing NPP on start-up and its noted as being rather unstable. Shame.
EDIT 2: OK, figured out the problem. I had a conflicting plugin. Now that its working I can see the value of Function List, very useful having a quick bookmark of every function in the script. Makes working on single large .lua files much easier. Thanks.
EDIT 3: Yay :) Got auto-completion working - sort of. I enabled 'Enable auto-completion on each input' and 'Function parameters hint on input' and ticked the 'Word Completion' option as opposed to the default 'Function completion'. Now when I type I get a drop down context list with a list of similar spelled words. It seems to also pick up all the functions in the script. Nice.
phantomwhale
January 21st, 2011, 11:29
Loving what your saying here.
I followed the above, and also
* Went into the SquigglySpellChecker settings -> Aspell settings and changed to use the language of choice (en_GB for this brit).
* Turned on Auto Spell Check in the SquigglySpellChecker menu
But I'm a little puzzled if I've done this right, as I'm seeing a LOT of red lines (more than would make this useful to me). I'm hoping the answer is I need to wait for the lua.rws file, but I suspect I'm hoping for more than is being suggested !
Anyway, what I am seeing, for instance is :
https://i847.photobucket.com/albums/ab36/phantomwhale/screengrab.jpg
Ideally, I'd like to see no red lines here, of course ! As...
onHotKey is a function name, and unlikely to be a word in the English language.
nextActor() and nextRound() are functions that exist
draginfo is an already defined function parameter
etc...
You seem to have far fewer red lines on your example, so maybe I need to wait for the final instructions here. But I think there is something else missing.
Anyway, look forward to seeing where this thread is going ! Help linking will be cool too.
Ben
Zeus
January 21st, 2011, 12:50
This is a great find. Well done SpudmanWP - you get some nice rep for this one :D
phantomwhale - If you right click a word thats coming up as misspelt (i.e. with a squiggly red line), right click it and add to dictionary. This allows you to build your own custom FGII/LUA/XML dictionary as you work, it even adds the words to the auto-completion context lists :)
Zeus
January 21st, 2011, 12:59
Ooh just had a thought. We could add a custom dictionary for the 4EParser tags. :D
phantomwhale
January 21st, 2011, 13:01
This is a great find. Well done SpudmanWP - you get some nice rep for this one :D
phantomwhale - If you right click a word thats coming up as misspelt (i.e. with a squiggly red line), right click it and add to dictionary. This allows you to build your own custom FGII/LUA/XML dictionary as you work, it even adds the words to the auto-completion context lists :)
Ah, that's what I thought - not sure adding local variable names and string definitions to a global dictionary is going to create a more solid programming tool for me - suspect I might get as many false positives as much as it would prevent typo bugs - but haven't fully tried it yet I'll admit.
Zeus
January 21st, 2011, 13:31
For those interested I have compiled a custom dictionary for all Z tags/keywords that the 4E Parser tool by Tenian uses. It should speed up manual tagging of content.
phantomwhale - Yes its probably best to wait for the final dictionaries and plugins from SpudmanWP but as an interim its working for me :)
SpudmanWP
January 21st, 2011, 16:24
But I'm a little puzzled if I've done this right, as I'm seeing a LOT of red lines (more than would make this useful to me). I'm hoping the answer is I need to wait for the lua.rws file, but I suspect I'm hoping for more than is being suggested !
I built my FG2 keyword list from the help documentation so many of the keywords from the code samples may not be in there. I am working on a better solution and will publish a new FG2.rws file when it's ready.
I wish there were an easy way for members of the community to add to a growing list of keywords (with the associated parameters and results).
Thanks for your feedback.
SpudmanWP
January 22nd, 2011, 01:19
I will be spending time this weekend with some of the basic rulesets imputing the names of all the functions & keywords that were not included in the first batch.
Expect the new RWS file Mon or Tues.
Zeus
January 22nd, 2011, 23:42
SpudmanWP's initiative prompted me to re-look at Scintilla, the lexical component Notepad++ is built around. I didn't realise that Notepad++'s syntax highlighting and code folding capabilities were extensible in that 3rd parties can develop new language lexers as plugins and integrate them with the inbuilt Notepad++ style framework. The result, you can add any language you like to NPP and enjoy the benefits of syntax highlighting and code folding :)
So I got myself some coffee and smokes and set about digging into the open source code and libs for Notepad++ and Scintilla. Now given this is my first foray into plugin development for Notepad++ I thought I'd make it easier on myself by using an open source lexer plugin as a base template. Given FGII's script API is a subset/customised version of LUA I chose the Gmod LUA plugin. Why the Gmod plugin and not the built in LUA lexer I hear you say? Simple, the Gmod Lua lexer is more advanced and offers greater scope for highlighting in different styles e.g differentiating the highlight of a Global Package vs a Ruleset Package vs a User Package.
Anyhow, with a bit of tweaking, hacking and reverse engineering of the Gmod Lua lexer I managed to compile a customised version which just handles FGII Lua specific syntax. The current development version of the plugin is preloaded with styles for the stock FGII global packages and methods, ruleset packages and methods (4E only at the moment), variables, operators, strings, numbers, lua instructors and constants. In addition, using NPP's inbuilt Style Configurator users can add their own keywords to a separate user packages and methods group allowing for easy visual differentiation between stock and home brew code.
Here's a screenie of how it looks at the moment. I have included a view of the Style Configurator so you can see how much extra flexibility the custom lexer has over the standard Lua language lexer.
https://farm6.static.flickr.com/5250/5378667043_828b22628d.jpg (https://farm6.static.flickr.com/5250/5378667043_43fe08bb90_o.jpg)
Sadly, the base plugin code seems not to work with the current and beta versions of the FunctionList plugin, so my custom FGIIlua lexer consequently doesn't either. However the good news is, is that the author of FunctionList is aware of the problem and is working on a fix. :) The FGIIlua lexer does work with autocompletion still though, so not all bad news.
On another note, has anyone noticed that with the SquigglySpellChecker and AutoSpellCheck on, there is considerable lag/delay between keystrokes and the screen updating when editing large Lua documents. As most of the files I work on are large-huge I've had to disable it. Is it just my system, or have any of you also noticed it.
phantomwhale
January 23rd, 2011, 01:02
I've had a couple of NPP crashes whilst working on large (13,000) XML documents since installing SquigglySpellChecker, but I think I had it disabled, plus I wasn't working on the large files much before so it might one big coincidence.
So... where's the download for the custom LUA lexer then ? :D
SpudmanWP
January 23rd, 2011, 04:58
I was noticing some lag too with Squiggly. For large files I just leave it off and enable it before I finalize the file (as a check).
DrZeuss, that ROCKS.
Does it work in both XML and Lua files (as FG2 uses both)?
Zeus
January 23rd, 2011, 10:23
Howdy All,
OK v1.0 has been uploaded to my resource site and is available for download. See my sig for the link to the site. The lexer is in the Tools section. Enjoy!
Installation & Usage
Unzip the ZIP archive to the Plugins subfolder in NPP Programs Folder
Plugins\FGIILua.dll
Plugins\Config\FGIILua.xml
Open NPP and a FGII Lua script and select FGIILua from the Language menu
The document should now be re-colorized using the standard styles for the lexer.
To change/customise the styles, open the Style Configurator under the Settings menu and browse throught the left list of languages until you see FGIILua (probably near the bottom somewhere).
The Style groups for the lexer are:
DEFAULT - standard text
LUA COMMENT BLOCK - text beginnning with the --[[
LUA COMMENT LINE - text beginning with --
XML COMMENT BLOCK - text beginning with <!-- NOTE: this group is not functional (yet)
XML COMMENT LINE - text beginning with <!-- --- NOTE: this group is not functional (yet)
NUMBERS - real and whole numbers
OPERATORS - standard FGII Lua operators (e.g. + - () & # etc. etc.)
STRINGS - standard FGII Lua strings in quotes
CHARACTERS - reserved for special characters
LITERAL STRINGS - literal text
INSTRUCTION WORDS - standard FGII Lua commands including function, if, then, else, end ...
CONSTANTS - reserved for constants (UPPERCASE)
GLOBAL - resereved for FGII reserved words e.g. window, self, subwindow etc. etc.
GLOBAL PAK FUNCTIONS - FGII built in global package functions (e.g. User, DB, Interface ...)
RULESET PAK FUNCTIONS - FGII ruleset package functions (4E builtin)
VARIABLES - reserved for variables
USER PAK FUNCTIONS - User package functions
METHODS - object methods e.g. getValue setValue
Keyword customisation requirements should in theory be limited to the RULESET PAK and USER
PAK FUNCTION groups as well as possibly METHODS and VARIABLES only.
To add a user defined keyword to a group, select the group, if the scope for adding user defined keywords exists, two lists should appear in the Style Configurator window, the first shows built-in keywords (cannot be changed) whilst the second can hold user defined keywords (seperated by whitespace).
Styles must be saved in order for settings to be re-applied between sessions.
Known Issues
The lexer is only designed at present to operate on a single language document i.e. FGII Lua. It will not work on FGII XML scripts with embedded Lua.
The current builds of the FunctionList plugin for NPP is incompatible with this release of the FGI Lua Lexer plugin.
phantomwhale
January 23rd, 2011, 12:07
Wonderful - thanks for sharing. Doesn't seem to come out as vibrantly for me than on your screenshot - played with colours and fonts for a while but couldn't quite get it right for me. Which font are you using ?
Oh, and a small bug-ette is in the Plugins menu there is an FGII Lua Lexer -> About... option which crashes NPP for me. My workaround is simple though - don't click it ;)
Thanks again,
Ben
Bidmaron
January 23rd, 2011, 12:55
OK, Zeuss, so your lexer means we don't need the add-on that Spud originally started this post with, right? (other than the spell-checker) Just a little confused where both your and Spud's work leave us on this.
Zeus
January 23rd, 2011, 13:24
Bidmaron - Not necessarily.
The lexer plugin colours and folds the code using keywords and pattern matching, whilst SpudmanWP's SquigglySpellChecker plugin checks the spelling of the text against a dictionary of known keywords.
Both offer visual indications of syntax correctness - one uses colours the other uses a squiggly line to denote an unknown/misspelt word. Both maintain their own lists of keywords - the lexer uses NPP's built in XML support and the Style Configurator to define the lists, SquigglySpellChecker leverages the Aspell framework and tool for compiling custom dictionaries.
I guess it will come down to individual preference.
One thing to bare in mind is that at present the custom lexer will not work with the FunctionList plugin SpudmanWP pointed everyone to whereas of course the SquigglySpellChecker/Lua language solution from SpudmanWP does. Automcomplete still works though (if enabled).
If you want to use FunctionList right now, stick with SpudmanWP's Squiggly plugin and dictionaries. If on the other hand you can live without FunctionList until its fixed and prefer more colouring options for the syntax of your Lua scripts, try the lexer.
Zeus
January 23rd, 2011, 13:36
Wonderful - thanks for sharing. Doesn't seem to come out as vibrantly for me than on your screenshot - played with colours and fonts for a while but couldn't quite get it right for me. Which font are you using ?
Oh, and a small bug-ette is in the Plugins menu there is an FGII Lua Lexer -> About... option which crashes NPP for me. My workaround is simple though - don't click it ;)
Thanks again,
Ben
I use Verdana. I may have also bolded some of the Style groups e.g. INSTRUCTION WORDS
Not sure why opening the About dialog is causing it to crash for you. Its just a simple MsgBox with some text, nothing more. Seems odd as it opens fine for me. Which version of NPP are you running. I'm on v5.8.6 (Unicode).
phantomwhale
January 24th, 2011, 12:04
I use Verdana. I may have also bolded some of the Style groups e.g. INSTRUCTION WORDS
Not sure why opening the About dialog is causing it to crash for you. Its just a simple MsgBox with some text, nothing more. Seems odd as it opens fine for me. Which version of NPP are you running. I'm on v5.8.6 (Unicode).
Here's a weird thing - retried the About dialog, and it works now. But when I click it, it also removes the 4-5 lines previous to where the cursor is sitting ?!?! A quick Ctrl-Z undoes the deletion, but that is VERY odd behaviour (NPP 5.8.6 Unicode as well).
Again, the workaround of not pressing it is fine !
[EDIT - solved my own problem here] Sorry, had a problem with comment highlighting, but realised I'd left a space between the -- and [[, and that the highlight colour for single line comments is a darker green that the block comments, a green so dark that my slight colour blindness could not really see it !
Ben
Zeus
January 24th, 2011, 21:35
Here's a weird thing - retried the About dialog, and it works now. But when I click it, it also removes the 4-5 lines previous to where the cursor is sitting ?!?! A quick Ctrl-Z undoes the deletion, but that is VERY odd behaviour (NPP 5.8.6 Unicode as well).
Again, the workaround of not pressing it is fine !
[EDIT - solved my own problem here] Sorry, had a problem with comment highlighting, but realised I'd left a space between the -- and [[, and that the highlight colour for single line comments is a darker green that the block comments, a green so dark that my slight colour blindness could not really see it !
Ben
That is indeed odd behaviour for the About window. I can't seem to reproduce it though, so until someone else rocks on up with the same problem I am going to have to assume its something local to your system. I haven't so far seen anything in the code to explain it, but then again I am quite new to C++ and NPP plugin behaviour, so who knows.
I'm glad the highlighting is corrected now. Happy trails.
Zeus
January 29th, 2011, 09:01
For those of you who are using my custom FGIILua lexer for Notepad++, take note that FunctionList v2.1 has been released and whilst its still a little unstable now and again, its working with Plugin based languages, including the FGIILua language the lexer uses.
What you need to do, to get it to work is as follows:
Close NPP, if open.
Download v2.1 of the FunctionList plugin from Sourceforge here (https://sourceforge.net/projects/npp-plugins/files/Function%20List/FunctionList%20Plugin%20v2.1/FunctionList_2_1_UNI_dll.zip/download)
Copy the v2.1 plugin files to the Plugins subfolder in the NPP Program Folder
Now add the following Language Rule to the FunctionListRules.xml file in your users NPP app data folder (for me it was C:\Users\Zeph\AppData\Roaming\Notepad++\plugins\Co nfig) and save the file
<Language name="FGIILua" imagelistpath="">
<CommList param1='"' param2='"' />
<CommList param1="'" param2="'" />
<CommList param1="--" param2="" />
<CommList param1="--\[\[" param2="\]\]" />
<Group name="FUNCTION" subgroup="" icon="0" child="0" autoexp="0" matchcase="1" fendtobbeg="" bbegtobend="\<do\>|\<if\>|\<function\>" keywords="">
<Rules regexbeg="^[-\s]*function\s+" regexfunc="[\w_:.]+" regexend="\s*\([\w_,.\s]*\)" bodybegin="" bodyend="\<end\>" sep="" />
<Rules regexbeg="^[-\s]*" regexfunc="[\w_:.]+" regexend="\s*=\s*function\s*\([\w_,\s]*\)" bodybegin="" bodyend="\<end\>" sep="" />
<Rules regexbeg="^" regexfunc="[\w_]+" regexend="\s*=" bodybegin="\{" bodyend="\}" sep="" />
</Group>
</Language>
Now restart NPP, open a FGII Lua script, set the Language to FGIILua and open the FunctionList window (if not open already). It should now list all the Functions in the script and operate as per the Lua language.
Note: Attempting to edit FunctionList language rules using the provided gui interface usually results in a NPP crash. The author is aware f the problem and is working on a fix. In the meantime I would suggest making changes to rules (if you need to that is) directyly via editing the FunctionListRules.xml file in your user app data folder.
phantomwhale
January 29th, 2011, 09:22
I followed the steps, but found no FunctionListRules.xml file in the user directory.
So I opened and closed NPP, and then a FunctionList.ini file appeared, but still no rules xml file.
So then I created a brand new FunctionListRules.xml file, copied in the data you provided, and tried loading up an FGII LUA script, setting my language to FGII Lua.
A quick press of ctrl+shift+alt+L bought up the function list sidebar, but it said no rules were defined.
Would play around to work out how to use the plugin, but the ever-crashing GUI makes it tricky. Do you have an example of a complete FunctionListRules.xml file I might copy, as perhaps the entry you've provided needs to sit within a larger block of XML ?
SpudmanWP
January 29th, 2011, 10:19
I use a portable version of NPP, found the "FunctionListRules.xml" file and made the changes.
No dice as it says "No Rule Defined" when I open the sidebar.
I will continue to test.
Thanks.
--edit--
I may have found the problem. The dates on those files are 2/17/2010.
Is it supposed to be newer?
Zeus
January 29th, 2011, 10:41
The should be a default FunctionListRules.xml file in the programs folder/plugins/Config, use that to first create the FunctionListRules.xml file in your user app data folder. You need to then add a copy of the block I defined above into the XML along with the other language definitions.
Aside from that you given you are running a portable version, find the Plugin/Config folder NPP is using to hold the definitions for configuration.
Zeus
January 29th, 2011, 11:13
--edit--
I may have found the problem. The dates on those files are 2/17/2010.
Is it supposed to be newer?
Yes. When NPP closes it should update the config xml files, therefore the modified date should be updated to the present date.
Zeus
January 29th, 2011, 11:17
Here's a screenie of what it should look like (if you edit the correct FunctionListRules.xml file):
https://farm6.static.flickr.com/5295/5397885046_b48e91aeca.jpg (https://farm6.static.flickr.com/5295/5397885046_6d5dc064cc_o.jpg)
You can see the file is set to the FGIILua language as the FGII specific global packages and one of my custom user packages is highlighted on line 17
phantomwhale
January 29th, 2011, 12:48
Ok, I got my default rules file in place, added in FGIILua block as shown, but was still only getting the plugin working with the Lua language, not the FGIILua language (it was still saying "No Rule Defined" on the panel when FGIILua language was loaded, whereas it says "100%" for Lua).
That said, it was "kinda" working; you could change the sort from A->Z to natural ordering, and the functions would appear.
Nonetheless, I googled around and found this forum post (https://www.autohotkey.com/forum/topic16935-30.html) which basically advised me to go into Settings -> Preferences..., into the Language Menu/... tab and deselect "Make Language menu compact".
This fixed it up, and now it works as advertised. A quirk of FunctionList plugin, I'm guessing ?
So, great, another improvement to my FGII coding life ! Thanks Dr Zeuss for the useful tips. Better play with these for a while, and add my global functions into the lexer settings as I go.
Zeus
January 29th, 2011, 12:59
Great to know its working for you and thanks for the heads up on the Make Languages Menu Compact setting.
Bidmaron
January 29th, 2011, 15:19
Moon/dd, can we get this thread stickied?
I have the FG2 lexer working with the new functionlist (yea!!!). I had to do the compressed menu workaround also.
Aside from it being slow, is there any remaining incompatibility with the spellcheck function from Spudman?
Zeuss, do you intend to make a lexer version that handles lua in the xml files or is that a bridge too far? Sounds ungrateful to ask you, I know, but, nevertheless, I am deeply grateful (and thanks Spud, for getting us all started on this).
Bidmaron
January 29th, 2011, 15:54
Below are the composite instructions to get Dr Zeuss' fantastic FGIILua lexer working along with the almost-as-great FunctionList capability, along with the compressed menu fix:
1. Quit NPP if running.
2. Download Dr Zeuss' FGIILua Lexer from here (https://zgp.eugenez.net/Tools/NPP%20FGII%20Lua%20Lexer%20Plugin/NPP%20FGIILua%20Lexer.zip).
3. From the zip folder, drag the file "Plugins\FGIILua.dll" into the Plugins folder of the NPP install directory.
4. Also from the zip folder, drag the file "Plugins\Config\FGIILua.xml" into the "Plugins\Config" folder of the NPP install directory.
5. To confirm everything so far, startup NPP, load any ruleset lua file (look in the "rulesets\SOMERULESET\scripts" folder). Find a SetValue or GetValue. These should be colorized a dark blue if everything has gone okay so far.
6. Quit NPP. If you want to customize Dr Zeuss' configuration, see the readme in his download zip or go here (https://zgp.eugenez.net/Tools/NPP%20FGII%20Lua%20Lexer%20Plugin/readme.txt).
7. Download version 2.1 or beyond from the sourceforge here (https://sourceforge.net/projects/npp-plugins/files/Function%20List/FunctionList%20Plugin%20v2.1/FunctionList_2_1_UNI_dll.zip/download).
8. From the download folder, copy "FunctionList.dll" into the Plugins folder of the NPP install directory.
9. From the download\config folder, copy "Gmod Lua.bmp" and "C++.flb" into
the "plugins/config" folder of the NPP install directory.
10. Also from the download\config folder, copy "FunctionListRules.xml" into the application data folder (something like c:\users\NAME\appdata\roaming\Notepad ++) (and, by the way, Microsuck, in its I-know-better-than-you way has conveniently hidden this folder they want you to use for your application data instead of the Program Files which they don't want you to use but which isn't hidden, and you may have to go into your windows folder view menu and turn on display of hidden folders -- or, you can just go to your start menu to Fantasy Grounds II, find the application folder option, which will open up FG2's application data and then navigate back up the tree to the Notepad ++ folder).
11. Open this file (I guess you could use Notepad++ for this, but remember to close if after you do. I used regular Notepad, because it just seemed perilous to edit a configuration file in the same program it configures) and paste in the below code provided by Dr. Zuess:
<Language name="FGIILua" imagelistpath="">
<CommList param1='"' param2='"' />
<CommList param1="'" param2="'" />
<CommList param1="--" param2="" />
<CommList param1="--\[\[" param2="\]\]" />
<Group name="FUNCTION" subgroup="" icon="0" child="0" autoexp="0" matchcase="1" fendtobbeg="" bbegtobend="\<do\>|\<if\>|\<function\>" keywords="">
<Rules regexbeg="^[-\s]*function\s+" regexfunc="[\w_:.]+" regexend="\s*\([\w_,.\s]*\)" bodybegin="" bodyend="\<end\>" sep="" />
<Rules regexbeg="^[-\s]*" regexfunc="[\w_:.]+" regexend="\s*=\s*function\s*\([\w_,\s]*\)" bodybegin="" bodyend="\<end\>" sep="" />
<Rules regexbeg="^" regexfunc="[\w_]+" regexend="\s*=" bodybegin="\{" bodyend="\}" sep="" />
</Group>
</Language>
Put it after one of the existing "</Language>" tags, and you don't have to worry about whether the tabbed text lines up with what is already there.
12. Startup Notepad++ with one of the lua script files we discussed above. Ensure FGIILua is the language selected in the Languages menu.
13. Select the Settings->Preferences menu option.
14. In the preferences, select the "Language Menu/Tab Settings" tab.
15. Uncheck the "Make languages menu compact" box and close the preferences.
16. Close and restart Notepad++ with the script file you've been using.
17. Select the Plugins->FunctionList->List... menu option, and you should now see the functions defined in the lua file.
18. To get autocompletion, select the Settings->Preferences menu option.
19. Select the "Backup/Auto-Completion" tab.
20. Check the "Enable auto-completion on each input" box and ensure the "Word completion" button is selected. (I have been advised that, while counter-intuitive, this is indeed what you need to get this to work [Thanks, Zeuss]). I checked the "Function parameters hint on input" box as well.
Once I confirm that the spellcheck, while slow, is not conflicting with the lexer and functionlist, I will update these instructions to handle installing that as well, so folks like me who like to have it all laid out in near-idiot-proof fashion can just do it.
Zeus
January 29th, 2011, 16:04
Nice one Bidmaron. That should indeed make it clearer.
One comment, I cannot get Autocompletion to work properly if the setting in preferences is set to 'Function completion'. It worlks only if 'Word completion' is ticked. Strange.
Bidmaron
January 29th, 2011, 16:08
Nice one Bidmaron. That should indeed make it clearer.
One comment, I cannot get Autocompletion to work properly if the setting in preferences is set to 'Function completion'. It worlks only if 'Word completion' is ticked. Strange.
Fixed, thanks, Doctor.
SpudmanWP
January 29th, 2011, 16:13
It was compact menu thing for me... it's now working.
Thanks
btw, I have not found a way to speed up the squiggly spellcheck issue :(
Bidmaron
January 29th, 2011, 16:18
Well, aside from the slowness, there's no harm in doing as you suggest, which is to install it and disable it until you are working on something like module text where you want to spell-check and then turning it on, right? I mean, there is no inherent conflict between your spell-check and the functionlist and lexer, right?
Zeus
January 29th, 2011, 16:27
I find even when I am working on a plain text file, the Auto-Check feature slows down NPP as the display begins to lag behind keystrokes.
Bidmaron
January 29th, 2011, 16:31
Ok, but if you disable it, that problem goes away. At least I haven't noticed it. I'm considering updating my instructions above to put in the spellcheck as an optional. If no one is aware of any problems if you disable it until you need it (to spellcheck a module, e.g.), is there any harm in having it?
By the way, Zeuss, you might have mentioned my question regarding a lexer for xml files with lua embeds. Is that something you might tackle?
Zeus
January 29th, 2011, 16:41
Ok, but if you disable it, that problem goes away. At least I haven't noticed it. I'm considering updating my instructions above to put in the spellcheck as an optional. If no one is aware of any problems if you disable it until you need it (to spellcheck a module, e.g.), is there any harm in having it?
Yes. If its disabled its fine. I would edit documents with it disabled and then when finalising, spellcheck the document. Its a little faster and you don't get the bother of the lag whilst editing.
By the way, Zeuss, you might have mentioned my question regarding a lexer for xml files with lua embeds. Is that something you might tackle?
Yeah I did look at it, I hit a challenge with how to differentiate in the lexer between characters that are shared between the Lua language and XML e.g. < and >.
At present if you set a FG .xml file's language to FGIILua, any embedded script block regions will by highlighted as per the FGIILua syntax highlighting, of course the XML regions of the document lose their syntax highlighting until you switch back.
At the moment, its an all or nothing affair. I will continue to poke around though, maybe I can figure something out.
Bidmaron
January 29th, 2011, 16:46
Good 'nuff, Zeuss.
phantomwhale
April 13th, 2011, 07:24
Moon/dd, can we get this thread stickied?
Just had to re-enable this - awesome guide from Bidmaron made it a piece of cake.
So +1 to the above. Actually, +2 (I get two votes by now, surely ?)
Emrak
September 11th, 2012, 02:18
Below are the composite instructions to get Dr Zeuss' fantastic FGIILua lexer working along with the almost-as-great FunctionList capability, along with the compressed menu fix:
1. Quit NPP if running.
2. Download Dr Zeuss' FGIILua Lexer from here (https://zgp.eugenez.net/Tools/NPP%20FGII%20Lua%20Lexer%20Plugin/NPP%20FGIILua%20Lexer.zip).
This link doesn't work, I'm afraid.
Zeus
September 11th, 2012, 08:27
This link doesn't work, I'm afraid.
You can grab the Lexer from my new site here (https://www.drzeuss.co.uk/fantasy-grounds-ii/utilities-tools/).
Emrak
September 13th, 2012, 17:15
Thank you. It appears BidMaron's old instructions no longer work, however. At least with the Foundation Core lua scripts I'm experimenting with. Ah well.
Belizan
June 1st, 2013, 19:56
Does this still work? Last responses from almost a year ago did not sound promising 8).
BTW, Zeus, you'd extend an XML lexer to special handle <script> tags, and lex the bits inside the tag with your FGIILua lexer. Depending on how you built your FGIILua lexer it should be easy to embed it. I haven't done any Scintilla work since 2004, but iir there are even examples of doing using "sublexers" and open source xml lexer source for Scintilla would should be convertible with minimal effort for NP++ (I haven't ever built plugins for NPP myself, all the work I did with Scintilla I wrappered the Scintilla control directly in my own apps). If you can't find an xml parser, you could also build one using Bison, as there's a bison wrapper for Scintilla as well, iir.
phantomwhale
June 2nd, 2013, 10:32
It still works for me - haven't set it up since my last post (above), but everything still highlights just fine
ImaTarget
May 29th, 2014, 19:32
I just tried to do this and while the keywords are dark blue the function list stays empty. Says: Function List - No Rule Defined
Help anyone?
LordEntrails
July 28th, 2015, 06:15
I was looking to set this up myself. Is it still applicable? Currently I'm using DSpellCheck in NPP for my spell checking, but have yet to see how it works with LUA and FG syntax.
Hector Trelane
June 1st, 2016, 06:32
I just tried to do this and while the keywords are dark blue the function list stays empty. Says: Function List - No Rule Defined
Help anyone?
Edit: after experiencing this problem myself, I fixed it by following Dr. Zeuss' instructions here: https://www.fantasygrounds.com/forums/showthread.php?14024-Getting-the-Most-Out-of-Notepad&p=103137&viewfull=1#post103134
In a nutshell, the configuration needed to take place in my C:\Users\...\AppData\Roaming\Notepad++\plugins\Con fig folder rather than on the different data drive where I have NPP installed.
Mind you, to be able to see this folder you need to follow this part of Bidmaron's instructions on this post: https://www.fantasygrounds.com/forums/showthread.php?14024-Getting-the-Most-Out-of-Notepad&p=103146&viewfull=1#post103146
10. Also from the download\config folder, copy "FunctionListRules.xml" into the application data folder (something like c:\users\NAME\appdata\roaming\Notepad ++) (and, by the way, Microsuck, in its I-know-better-than-you way has conveniently hidden this folder they want you to use for your application data instead of the Program Files which they don't want you to use but which isn't hidden, and you may have to go into your windows folder view menu and turn on display of hidden folders -- or, you can just go to your start menu to Fantasy Grounds II, find the application folder option, which will open up FG2's application data and then navigate back up the tree to the Notepad ++ folder).
Hector Trelane
June 1st, 2016, 09:25
Here are some things that I have found out about Notepad++ (NPP) that I will be using to make it a better FG2 editor.
...
2. Install the SquigglySpellCheck.dll from https://squiggly.sourceforge.net/ . Then turn on Auto Spell Check in the SquigglySpellChecker menu.
Try as I might, I can't get this to work (despite following all other instructions). I have NPP v6.9.2 installed and I'm running Windows 10. I get an error saying "This plugin is not compatible with current version of Notepad++." Here's a screen shot of the error along with my listing of Aspell in the path:
14220
Is there a work-around, or is it simply that the squiggly plug-in is too old?
trembot_89
March 6th, 2017, 06:20
Try as I might, I can't get this to work (despite following all other instructions). I have NPP v6.9.2 installed and I'm running Windows 10. I get an error saying "This plugin is not compatible with current version of Notepad++." Here's a screen shot of the error along with my listing of Aspell in the path:
14220
Is there a work-around, or is it simply that the squiggly plug-in is too old?
I'm having the same issue. Did you ever get it resolved?
Hector Trelane
March 6th, 2017, 15:01
I'm having the same issue. Did you ever get it resolved?
No, unfortunately this one is still unresolved.
Zacchaeus
March 6th, 2017, 21:09
Currently there's no plugin manager for the 64bit version of Notepad++. Until there is no plugins seem to work.
Hector Trelane
March 6th, 2017, 21:29
Currently there's no plugin manager for the 64bit version of Notepad++. Until there is no plugins seem to work.
Aha. Should we install a 32bit version? Presumably N++ is a resource light program so there should be no difference in performance?
Zacchaeus
March 6th, 2017, 21:32
I don't know if that's available or not. All I know is that when I had to reinstall notepad++ on a new computer there's no plugin manager available so I am unable to use the xml and spellcheckers that I used to be able to use.
Talyn
March 6th, 2017, 21:42
Or install the 64-bit version and the first time it detects an update package, it will install the 32-bit version anyway! At least that's what mine keeps doing... LOL
Trenloe
March 6th, 2017, 21:52
There's a 32-bit version of Notepad++. If you want to run the plugins uninstall the 64-bit version and install the 32-bit version. I use the 32-bit version for all of my FG development.
https://notepad-plus-plus.org/download/v7.3.2.html
Hector Trelane
March 7th, 2017, 23:35
There's a 32-bit version of Notepad++. If you want to run the plugins uninstall the 64-bit version and install the 32-bit version. I use the 32-bit version for all of my FG development.
https://notepad-plus-plus.org/download/v7.3.2.html
Bless you. Good to know.
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.