three.x wrote:
Using Notepad++ v4.7.5 and Function List v2.0 alpha I added the following lines to the file notepad++_install_dir\plugins\Config\FunctionListRules.xml right at the end before the closing </FunctionList> tag.
Code:
<Language name="AHK Autohotkey" imagelistpath="">
<CommList param1="/\*" param2="\*/" />
<Group name="FUNCTION" subgroup="" icon="0" child="0" autoexp="0" matchcase="0" fendtobbeg="" bbegtobend="">
<Rules regexbeg="^" regexfunc="[a-zA-Z0-9@?#\[\]_]+" regexend="\([^(]*\)" bodybegin="{" bodyend="}" sep="$" />
</Group>
<Group name="SUB" subgroup="" icon="0" child="0" autoexp="0" matchcase="0" fendtobbeg="" bbegtobend="">
<Rules regexbeg="^" regexfunc="[a-zA-Z0-9@?#\[\]_'-]+[:]" regexend="[ \t]*$" bodybegin="" bodyend="^[r]eturn[ \t]*$" sep="$" />
<Rules regexbeg="^" regexfunc="[a-zA-Z0-9@?#\[\]_'-]+[:]" regexend="[ \t]*[;].*$" bodybegin="" bodyend="^[r]eturn[ \t]*$" sep="" />
</Group>
<Group name="OTHER" subgroup="" icon="0" child="0" autoexp="0" matchcase="0" fendtobbeg="" bbegtobend="">
<Rules regexbeg="" regexfunc="[#!^+&*~$ -=\[\]\\;',./A-Za-z0-9]+[:][:][ \t]*$" regexend="" bodybegin="" bodyend="" sep="" />
</Group>
</Language>
(Just taking the regexp posted above - thanks for that!)
Beware - it seems that NPP doesn't like someone to edit this file, it will be overwritten when exiting Notepad++. So just save it with another name and rename it afterwords.
Dear three.x,
I have just updated to FunctionList Plugin 2.0 Alpha today. I was reluctant to upgrade since it is "Alpha", however, seeing that it has been stuck in "Alpha" for ages, and your use of it encouraged me to use it as well.
Now, after the upgrade, I used your Rules, made some slight modifcations to suit my own needs, I changed the group name from OTHER to HOTKEYS, since that's what they are used for. I also added a new group INCLUDE, so the directive will show up on the function list as well. Also, for hotkeys, I included comments as part of the list, so when I look up the functonlist, it will also show the comments, which I personally like, it will tell me what that hotkey is for. I am including the modified rules for those who are interested in:
Code:
<Language name="AHK Autohotkey" imagelistpath="">
<CommList param1="/\*" param2="\*/" />
<Group name="FUNCTION" subgroup="" icon="0" child="0" autoexp="0" matchcase="0" fendtobbeg="" bbegtobend="">
<Rules regexbeg="^" regexfunc="[a-zA-Z0-9@?#\[\]_]+" regexend="\([^(]*\)" bodybegin="{" bodyend="}" sep="$" />
</Group>
<Group name="SUB" subgroup="" icon="0" child="0" autoexp="0" matchcase="0" fendtobbeg="" bbegtobend="">
<Rules regexbeg="^" regexfunc="[a-zA-Z0-9@?#\[\]_'-]+[:]" regexend="[ \t]*$" bodybegin="" bodyend="^[r]eturn[ \t]*$" sep="$" />
<Rules regexbeg="^" regexfunc="[a-zA-Z0-9@?#\[\]_'-]+[:]" regexend="[ \t]*[;].*$" bodybegin="" bodyend="^[r]eturn[ \t]*$" sep="" />
</Group>
<Group name="INCLUDE" subgroup="" icon="0" child="0" autoexp="0" matchcase="0" fendtobbeg="" bbegtobend="">
<Rules regexbeg="^" regexfunc="#include[ \t]+[a-zA-Z0-9_.\\]+" regexend="" bodybegin="" bodyend="$" sep="" />
</Group>
<Group name="HOTKEYS" subgroup="" icon="0" child="0" autoexp="0" matchcase="0" fendtobbeg="" bbegtobend="">
<Rules regexbeg="^" regexfunc="[^;][#!^+&*~$ -=\[\]\\;',./A-Za-z0-9]+[:][:][ \t]*[^;]+.*$" regexend="" bodybegin="" bodyend="" sep="" />
<Rules regexbeg="^" regexfunc="[^;][#!^+&*~$ -=\[\]\\;',./A-Za-z0-9]+[:][:][ \t]*[;].*$" regexend="" bodybegin="" bodyend="^[r]eturn[ \t]*$" sep="$" />
</Group>
</Language>
The above works very well for me. I do like the new "Alpha 2.0" version better than the old one.
Cheers,
Mosaic