AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

improved syntax + color scheme for VIM

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Utilities & Resources
View previous topic :: View next topic  
Author Message
urlwolf



Joined: 16 Mar 2006
Posts: 100

PostPosted: Wed Jan 02, 2008 6:34 pm    Post subject: improved syntax + color scheme for VIM Reply with quote

I have put together my own syntax highlighting for ahk in vim.

It solves some problems with previous schemes:
Weibull: didn't get labels
Savage: would highlight what you were currently typing, then change the highlighting when moving out.

Features
Examples:
Isense
activeGoto

In a Nutshell:
Built-in finctions are blue
User defined functions are green
Autohotkey variables are orange
Labels are red (return too; makes it easy to find subs scopes)
GUI commands, others, are brown

If you are used to PSPad, you'll find at home.

The syntax file contains a very detailed list of ahk symbol types; each one could be colored differently if anyone wanted to. Here's the list:
Code:
hi def link ahkKeyword Special
hi def link ahkEscape Special
hi def link ahkComment Comment
hi def link ahkStatement Conditional
hi def link ahkFunction Keyword
hi def link ahkDirective PreProc "sent keys
hi def link ahkLabel Label
hi def link ahkKey Special
hi def link ahkVariable Constant "this is anything enclosed in %%
hi def link ahkNewFunction Function
hi def link ahkBuiltinVariable Macro
hi def link ahkString String
hi def link ahkScope Type
hi def link ahkOtherCommands          Typedef
hi def link ahkRelative             ahkOtherCommands
hi def link ahkContinuation          ahkOtherCommands
hi def link ahkPriority             ahkOtherCommands
hi def link ahkWinTitle             ahkOtherCommands
hi def link ahkSetFormatFamily       ahkOtherCommands
hi def link ahkLogicOperators       ahkOtherCommands
hi def link ahkWingetFamily          ahkOtherCommands
hi def link ahkScopes                ahkOtherCommands
hi def link ahkTimeUnits             ahkOtherCommands
hi def link ahkLoop                   ahkOtherCommands
hi def link ahkExitReasons          ahkOtherCommands
hi def link ahkMenuCommand          ahkOtherCommands
hi def link ahkGUIcontrol             ahkOtherCommands
hi def link ahkListView             ahkOtherCommands
hi def link ahkGeneralGUI             ahkOtherCommands
hi def link ahkHotkeyCommand          ahkOtherCommands
hi def link ahkThread                ahkOtherCommands
hi def link ahkTransformCommand       ahkOtherCommands
hi def link ahkButtons                ahkOtherCommands
hi def link ahkOn                   ahkOtherCommands
hi def link ahkRegistry             ahkOtherCommands
|


It's not perfect; sometimes it misses code inside parentheses, for example. Also, when you call a built-in function thisWay(), it will highlight it as an user defined function.

All in All, this might be the most detailed highlighting scheme for any editor (at least of those I have tried).

Everything can be edited of course.

Here are some sample highlightings:
Sample 1: lots of functions. ISense code, majkinetor
Sample 2: active Goto by toralf

Credits
Credit goes to savage and Weibull, who created the versions I used.

Also, I used a function list from the PSPad installer by Toralf.

Last, the colors are inspired by Rajat's PSPad colors in that same installer.

How to install

Download syntax and colors from the vim website, and follow instructions there.
Back to top
View user's profile Send private message
fmate14



Joined: 28 Oct 2007
Posts: 41
Location: Hungary, Érd

PostPosted: Tue Jan 22, 2008 9:09 am    Post subject: Re: improved syntax + color scheme for VIM Reply with quote

urlwolf wrote:
I have put together my own syntax highlighting for ahk in vim.

Thank you very much! How can I highlight the "strings"?
Back to top
View user's profile Send private message Visit poster's website
urlwolf



Joined: 16 Mar 2006
Posts: 100

PostPosted: Fri Jan 25, 2008 12:30 pm    Post subject: Reply with quote

just add a mapping at the bottom of the file for string to one of the vim 'highlighting types'. Copy/paste from the exisiting ones.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Utilities & Resources All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group