Raised This Month: $12 Target: $400
 3% 

[USEFUL] Syntax Highlighting and More for EditPlus (Updated 4/7/08)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 03-27-2008 , 06:39   [USEFUL] Syntax Highlighting and More for EditPlus (Updated 4/7/08)
Reply With Quote #1

This took a while to create. I used a list someone provided for another text editor a long time ago and converted that over to EditPlus for my liking. Since then lots had been added and I was missing a lot of functions and such that should have been highlighted so I decided to get this stuff up to date.

This tutorial was done using EditPlus Text Editor v2.31 (488). If you're not using that exact version, things might be a bit different from you. Hopefully not too much.

How to:
  1. Download the .zip file and extract the two files inside to your EditPlus folder.
  2. Start up EditPlus and go to Tools - Preferences.
  3. Expand the Files category and choose Settings & syntax.
    • Click Add and give it the name SourcePawn.
    • For the file extensions type in sp;inc.
    • Click the ellipsis (...) next to Syntax File and browse to the .stx file you extracted from the .zip (sp.stx).
    • Check the box next to Trim trailing spaces on save.
    • Click the Tab/Indent button and set how many spaces you want to be for each tab/indent (I use 4/4 as opposed to the default 8/8).
    • This is how it should look so far: http://joe.to/~bl4nk/imgs/editplus-1.png
  4. Click the Syntax colors tab.
  5. Back on the category tree choose Templates (still under Files).
    • Add a new template and call it SourcePawn.
    • Click the ellipsis (...) next to File Path and browse to the .sp file you extracted from the .zip (template.sp).
    • You should have something like this: http://joe.to/~bl4nk/imgs/editplus-3.png
  6. Click Apply and then OK and you should be set. You can now make a SourcePawn file by going to File - New - SourcePawn or by clicking the first icon under File and choosing SourcePawn.
You should be all set, but if you want to take it one step further and make it so you can compile your plugin using EditPlus it's not so hard to do. You have to do a little bit outside of EditPlus and then we can get right into it.
  1. Go and download the newest revision of SourceMod and place the compile tools (compile.exe and spcomp.exe) in a folder.
  2. Inside of that folder make a folder called compiled and a folder called include. Place all of your include files in the include directory. The compiled directory is where your compiled files will go.
Now for the EditPlus part.
  1. Go back to into EditPlus and open up Tools - Preferences.
  2. Expand the Tools category and choose User tools.
    • From the drop down box choose an empty group (will be named "Group #" most likely).
    • Click Group Name and name it SourcePawn.
    • Click Add Tool >> and Choose Program from the list.
    • Name the program Compile.
    • Click the ellipsis (...) next to Command and browse to your compile.exe in the folder we talked about earlier.
    • Under Argument type in "$(FilePath)" (quotes included) and under Initial Directory type in $(DirWin).
    • Check the box next to Close widow on exit.
    • This is how it should look (minus the Command path being different for you): http://joe.to/~bl4nk/imgs/editplus-4.png
  3. Click Apply and then OK and you're all done! Now to compile the file your browsing just save it in the folder where your compile.exe is and hit Ctrl-1. The file will compile and the compile window will come up just as normal.
I hope that wasn't too much. I am really picky with things like this so I thought I'd share with you how I set my stuff up properly. I made a few other modifications to my EditPlus (mainly removing unnecessary toolbars and changing a few colors around), but this was the gist of it.

Any questions, feel free to ask.
Attached Files
File Type: zip EditPlus 2.zip (9.8 KB, 856 views)

Last edited by bl4nk; 07-09-2008 at 15:06.
bl4nk is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 04-07-2008 , 16:49   Re: [USEFUL] Syntax Highlighting and More for EditPlus
Reply With Quote #2

Updated:
  • Added everything up to r2004
  • Added support for the escape (\) character in strings
bl4nk is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 04-17-2008 , 12:15   Re: [USEFUL] Syntax Highlighting and More for EditPlus (Updated 4/7/08)
Reply With Quote #3

Updated:
  • Added everything up to r2079 (svn revision 2356)
bl4nk is offline
Nican
Veteran Member
Join Date: Jan 2006
Location: NY
Old 04-17-2008 , 16:21   Re: [USEFUL] Syntax Highlighting and More for EditPlus (Updated 4/7/08)
Reply With Quote #4

Could you show the text of a highlighted code?
__________________
http://www.nican132.com
I require reputation!
Nican is offline
Send a message via ICQ to Nican Send a message via MSN to Nican
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 04-17-2008 , 18:33   Re: [USEFUL] Syntax Highlighting and More for EditPlus (Updated 4/7/08)
Reply With Quote #5

http://www.bl4nk.com/imgs/editplus-highlighting.png
bl4nk is offline
pilger
Senior Member
Join Date: Sep 2010
Old 05-20-2013 , 16:03   Re: [USEFUL] Syntax Highlighting and More for EditPlus (Updated 4/7/08)
Reply With Quote #6

Great work, bl4nk! Thanks!

Is there a way to make the function list (Ctrl+F11) work on SourcePawn as well!? I'm having great difficulty with it, since it doesn't have the work "function" before the actual functions.

I've tried using:
Code:
^(native[ \t]|public[ \t]|static[ \t]|stock[ \t]|forward[ \t])?[ \t]*(.*)[ \t]\(.*\)[\t]{
Which restricts the "header" of the function to have tabs instead of spaces and force me to put spaces on ifs, elses and other control structures.

Does anyone have an idea on how to improve this!? Make a better regexp to match only function headers!?

Thanks in advance!
pilger is offline
mcpan313
Senior Member
Join Date: Mar 2010
Old 05-20-2013 , 17:49   Re: [USEFUL] Syntax Highlighting and More for EditPlus (Updated 4/7/08)
Reply With Quote #7

Quote:
Originally Posted by pilger View Post
Great work, bl4nk! Thanks!
...
This is a very very very old thread, try Notepad++ or Sublime Text.
__________________
sorry, for my poor english.
mcpan313 is offline
Send a message via MSN to mcpan313
pilger
Senior Member
Join Date: Sep 2010
Old 05-20-2013 , 17:52   Re: [USEFUL] Syntax Highlighting and More for EditPlus (Updated 4/7/08)
Reply With Quote #8

I was aware of the date of the thread when I posted, but it seemed to me that it would be better to post it here than to create a whole different thread just for the simple question.

And switching to a whole different program isn't much what I intent to do. But thanks anyway.

Well, nonetheless my question is a matter of getting a better function prototype detection with regexp. That can be used by any program, really.

Last edited by pilger; 05-20-2013 at 18:34.
pilger is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 05-22-2013 , 22:28   Re: [USEFUL] Syntax Highlighting and More for EditPlus (Updated 4/7/08)
Reply With Quote #9

Sorry, but I've abandoned using EditPlus in favor of Notepad++ and Sublime Text.
bl4nk is offline
pilger
Senior Member
Join Date: Sep 2010
Old 05-22-2013 , 22:36   Re: [USEFUL] Syntax Highlighting and More for EditPlus (Updated 4/7/08)
Reply With Quote #10

Sadly I think it's gonna be hard to implemment a decent Function list pattern in Regular Expression for EditPlus, since it still uses a very rudimentar version of regexp and it's full of restrictions.

Since SourcePawn doesn't have a keyword for the function prototype as we see in pretty much all other languages, it's gonna be really hard. I had to come up with a regexp that would negate all the control statements (if, for, while etc.). That could be done on Sublime Text 2, but I doubt it will ever be possible on EP. It's still a very good code editor. The seamless browser is very usefull for web applications and it's one of the most customizable editors around. It's a shame the developers didn't update it in such a fashion to stay competitive. :\

Last edited by pilger; 05-23-2013 at 17:07.
pilger is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:42.


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