AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Code Snippets/Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=83)
-   -   AMXX Keywords for Syntax Highlighting (https://forums.alliedmods.net/showthread.php?t=86974)

fysiks 03-05-2009 05:12

AMXX Keywords for Syntax Highlighting
 
4 Attachment(s)
Keywords for Highlighting:

With the attached files you can create your own syntax highlighting if your favorite source code editor allows user defined syntax highlighting. Also, I've created specific collections for DOD and CS. With these two I have included my syntax highlighting I use for Notepad++.

Seta00 has created syntax highlighting to be like it is in Pawn Studio if you prefer it's colors and can be found here. Or, if you prefer the [pawn][/pawn] tag colors you can get that here.

Notepad++ Auto-Completion and Hints:

Notepad++ has a feature to autocomplete functions and show the arguments and description for a function. I made the required xml file to make this work for AMX Mod X functions to go with the syntax highlighting. Counter-Srike is the only MOD that I've done so far. If you would like another MOD specifc one I can do it. Also, if you find anything missing let me know.

Installation:
Close Notepad++.
Put the .xml file in PathToProgramFiles\Notepad++\plugins\APIs\
Make sure to name the file exactly as the syntax highlighting is named.
Start Notepad++ and turn on Auto-Complete and/or Hints (it is off by default): Settings > Preferences > Backup/Auto-Completion > Auto-Completion




-

UPDATED: v2, Added xs functions to "AMX". Added macros (Thanks for reminding me stupok).

UPDATE: v3, I didn't realize xs wasn't a "mod" so I updated DOD and CS (including syntax highlighting).

EDIT: If you wanted my php scripts, PM me and I will send them to you.

Tags: notepad plus plus syntax highlight highlighting

XxAvalanchexX 03-05-2009 23:39

Re: AMXX Keywords for Syntax Highlighting
 
Awesome, thanks! I use a text editor which it seems like not very many other people do, so there aren't any AMXX/Pawn definitions for it yet. I've always wanted to put one together, and this should help me out a lot!

Cheers!

BOYSplayCS 03-06-2009 06:58

Re: AMXX Keywords for Syntax Highlighting
 
I like this, good idea! How long did this take?

Avalanche, where the hell have you been?

fysiks 03-06-2009 08:44

Re: AMXX Keywords for Syntax Highlighting
 
It took a few days to write the php code with regex to catch everything that had a "regular" format (constants were the hardest :)). I had to learn regex at that point (lots of testing).

After I got those scripts to work, I had to weed out any duplicates. And then I had to find the few things that were found as constants but were functions. Then I put them in Notepad++ and went through all the includes to make sure everything that needed highlighting had it. I was always missing the kRender constants :). So added them manually.

Anyway, the days that I spent actually working on this probably took me about a week maybe shorter. I did most of the work back in November or December.

xPaw 03-06-2009 12:17

Re: AMXX Keywords for Syntax Highlighting
 
hmm i placed userDefinedLang.xml in Notepad++ (i didnt had userDefinedLang.xml before), and it didnt worked.

iNspiratioN 03-06-2009 14:19

Re: AMXX Keywords for Syntax Highlighting
 
Quote:

Originally Posted by xPaw (Post 775225)
hmm i placed userDefinedLang.xml in Notepad++ (i didnt had userDefinedLang.xml before), and it didnt worked.

Try to place it in
Code:

C:\Documents and Settings\%username%\Application Data\Notepad++\
i think you will see userDefineLang.xml so replace it with current one and RENAME from "userDefinedLang.xml" -> "userDefineLang.xml".

xPaw 03-06-2009 14:32

Re: AMXX Keywords for Syntax Highlighting
 
yeap thanks with name now it worked ;)

fysiks 03-06-2009 19:25

Re: AMXX Keywords for Syntax Highlighting
 
Ok, I fixed the Notepad++ filename and I changed the instructions. On my computer it doesn't work if I put it in Application Data. It only works if I put it in Program Files. The first time I installed it I think it worked that way but not this time. Maybe it's because I installed as UNICODE but replaced the files with the ANSI version (to get the plugins to work :)).

Thanks guys.

danielkza 03-06-2009 21:00

Re: AMXX Keywords for Syntax Highlighting
 
Any change you can release that script? The keywords helped me a lot, but functions do not have their prototypes, and SciTE doesn't recognize them.

fysiks 03-06-2009 23:21

Re: AMXX Keywords for Syntax Highlighting
 
Quote:

Originally Posted by danielkza (Post 775506)
Any change you can release that script? The keywords helped me a lot, but functions do not have their prototypes, and SciTE doesn't recognize them.

prototypes? Do you mean native, public, and stock? (Those three are grouped together.


All times are GMT -4. The time now is 16:24.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.