| View previous topic :: View next topic |
| Author |
Message |
foom
Joined: 19 Apr 2006 Posts: 386
|
Posted: Wed Jul 05, 2006 1:51 pm Post subject: Command completition for ConText |
|
|
So i was fed up with having to look up every command/function/buildinvar in the helpfile just to see what the params are or what the actuall name of the command/var is. Thats why i created a codetemplatefile for ConText wich has all the commands functions and build-in variables in it. The codetemplate feature from context is great. Just type a string or even a single char(you can also highlight them or just put the caret behind it) and hit Ctrl + J or hit Ctrl + J and then type the string. What you get is this:
Click for bigger picture
**Update
05.11.2006
- Fixed a typo which prevented the codetemplate from being installed if it allready existed.
Here is the script
*NOTE:The template file has to have the same name as the displayname for your highlighter. In case you want to use an other highlighter you need to rename the AutoHotkey.ctpl accordingly.
Hope you like it.
Last edited by foom on Sun Nov 05, 2006 6:21 pm; edited 6 times in total |
|
| Back to top |
|
 |
Veovis
Joined: 13 Feb 2006 Posts: 389 Location: Utah
|
Posted: Wed Jul 05, 2006 11:32 pm Post subject: |
|
|
Wow! Nice job!
I saw that cool picture so i decided to try out ConTEXT and now im converted. I like that it launches the help for me when i press F1 and i can configure it to run scripts when i press F9.
I like your work at the highlighting, but i think you might have included to many things. the words "and" and "all" and "count" get highlighted often in things like
| Code: | | msgbox, Now minimizing all apps, and closing %count% IE windows |
Also i think ill change mine to highlight %var% instead of "string" although it is handy to be able to differenciate when you have things like:
| SysInfo v 3.0 by Veovis wrote: | Gui %i%: add, pic, % "vBack" i " h"ref(b "H")" w"ref(b "W") ,% CreateBMPGradient("resource/" i "Back.bmp",barbackcolor2,barbackcolor1,1)
Gui %i%: add, pic, % "xp yp vBar" i " h"ref(b "H")" w"ref(b "W") ,% CreateBMPGradient("resource/" i "bar.bmp",ref(b "color_2"),ref(b "color_1"),1) |
_________________
"Power can be given overnight, but responsibility must be taught. Long years go into its making." |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10716
|
Posted: Thu Jul 06, 2006 2:12 am Post subject: |
|
|
When/if you ever want this distributed with AutoHotkey, please let me know. However, if you want that, it would save me time if you could make a generator script that builds a new syntax file based on the standard syntax lists distributed with AutoHotkey (there are some example scripts in the Extras folder that show how to do it). Even better would be to have a simple installer script that generates the new syntax file on-the-fly, but that would be more work.
Thanks. |
|
| Back to top |
|
 |
foom
Joined: 19 Apr 2006 Posts: 386
|
Posted: Mon Aug 28, 2006 12:41 pm Post subject: |
|
|
Sorry for not replying for such a long time. Right after i postet this, lightning grilled my dsl-modem and router :/ and i had to take a time off from the web.
| Veovis wrote: | | ...I like your work at the highlighting, but i think you might have included to many things. the words "and" and "all" and "count" get highlighted often in things like.. |
Thats because ConTEXT highlighter are very basic. Words are highlighted on a simple match and not on regexp rules. I hope in ConTEXT v.1 i'll be able to define regexp based rules so that this highlighting quirks will be gone.
| Chris wrote: | | When/if you ever want this distributed with AutoHotkey, please let me know. However, if you want that, it would save me time if you could make a generator script that builds a new syntax file based on the standard syntax lists distributed with AutoHotkey (there are some example scripts in the Extras folder that show how to do it). Even better would be to have a simple installer script that generates the new syntax file on-the-fly, but that would be more work. |
I reworked the script which i used to create the templates and added code to create the highlighter and install it too(see first post). Feel free to distribute it with AHK if you like. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10716
|
Posted: Mon Aug 28, 2006 2:10 pm Post subject: |
|
|
| Thanks for the updated script, which be much easier for me to maintain. I'll review it and try to include it in the next release. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10716
|
Posted: Tue Aug 29, 2006 10:06 pm Post subject: |
|
|
I've made some basic improvements and adjustments to the script, which have been tested with the latest version of ConTEXT. Here's the new version: http://www.autohotkey.com/misc/AHK_for_ConTEXT.ahk
Please let me know if the changes are acceptable to you (and of course, feel free to make any other changes, such as crediting yourself if you wish).
If anyone gets a chance to try it, please let me know if you have any problems with it.
Thanks again. |
|
| Back to top |
|
 |
foom
Joined: 19 Apr 2006 Posts: 386
|
Posted: Wed Aug 30, 2006 8:57 pm Post subject: |
|
|
| I added some credits and have nothing to say about the changes beside that the contextdir selection could stay in an could be used if contextpath is not found. I changed the link in my initial post. You can get the file from there. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10716
|
Posted: Thu Aug 31, 2006 2:15 pm Post subject: |
|
|
| foom wrote: | | I added some credits and have nothing to say about the changes beside that the contextdir selection could stay in an could be used if contextpath is not found. |
Thank you. I will distribute your version with the next release of AutoHotkey. |
|
| Back to top |
|
 |
|