1. Post #1
    Get your own DarkRP Server!
    FPtje's Avatar
    January 2006
    5,645 Posts
    VERSION FOR GMOD 13 IS OUT
    It might only work on Sublime Text 2!

    Download:


    Github repository:
    https://github.com/FPtje/Sublime-GLua-Highlight


    Thread on sublime:
    http://www.facepunch.com/threads/102...me-Text-Editor

    More info about sublime:
    http://www.sublimetext.com/

    This evening I made a quick plugin for GMod syntax highlighting. It has the GMod Functions (as of 17-12-2010). The C style commenting and some other stuff. I didn't manage to get the && and || operators to work, but fuck those.


    Thanks to:
    Sublime: Great shit man
    Kyle Fleming: Making the NPP syntax highlight script and putting it in the NPP highlight package. I used his script to get all the functions and enumerations on a vanilla gmod.

    Picture of sublime:


    Gmod Lua in sublime:


    How to install
    Extract the folder and place the "Gmod Lua" folder in %APPDATA%\Sublime Text\Packages

    OR
    Run 1installer.bat if you're on Windows.

    Open a Lua script and select View > Apply Syntax Highlighting > Gmod Lua
    Reply With Quote Edit / Delete Reply Netherlands Show Events Useful x 20Winner x 7Friendly x 5Zing x 2Lua Helper x 2Artistic x 1Lua King x 1Agree x 1Dumb x 1 (list)

  2. Post #2
    MoronYard
    _nonSENSE's Avatar
    May 2010
    1,265 Posts
    Amazing! Will give it a try for a few days and see if I'll switch. Thank you!
    Reply With Quote Edit / Delete Reply Germany Show Events Lua Helper Lua Helper x 1 (list)

  3. Post #3
    Dragon Dildoes
    Dennab
    April 2009
    4,432 Posts
    Splendid.
    Reply With Quote Edit / Delete Reply Germany Show Events Winner Winner x 2Useful Useful x 1 (list)

  4. Post #4
    c-unit's Avatar
    March 2010
    1,685 Posts
    You sir are god himself!!
    Reply With Quote Edit / Delete Reply United States Show Events Disagree Disagree x 10Dumb Dumb x 9Funny Funny x 1 (list)

  5. Post #5
    Gold Member
    Loures's Avatar
    February 2009
    2,153 Posts
    Can you add custom highlights?

  6. Post #6
    Gold Member
    Lexic's Avatar
    March 2009
    6,123 Posts
    None of the non-global functions highlight D:

  7. Post #7
    Get your own DarkRP Server!
    FPtje's Avatar
    January 2006
    5,645 Posts
    None of the non-global functions highlight D:
    Things like LocalPlayer() and AddCSLuaFile() work fine for me.
    Are you sure you've selected View > Apply Syntax Highlighting > Gmod Lua?
    Reply With Quote Edit / Delete Reply Netherlands Show Events Dumb Dumb x 1 (list)

  8. Post #8
    c-unit's Avatar
    March 2010
    1,685 Posts
    rate me dumb. where do I install it to >.<
    Reply With Quote Edit / Delete Reply United States Show Events Dumb Dumb x 18Funny Funny x 2Optimistic Optimistic x 1 (list)

  9. Post #9
    Gold Member
    Lexic's Avatar
    March 2009
    6,123 Posts
    Things like LocalPlayer() and AddCSLuaFile() work fine for me.
    Are you sure you've selected View > Apply Syntax Highlighting > Gmod Lua?
    Do you know what global means?
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Agree Agree x 1Winner Winner x 1 (list)

  10. Post #10
    Get your own DarkRP Server!
    FPtje's Avatar
    January 2006
    5,645 Posts
    Do you know what global means?
    I swear I read that as "None of the global functions work".

    I'll look at it.

    Edited:

    rate me dumb. where do I install it to >.<
    Extract the folder and place the "Gmod Lua" folder in %APPDATA%\Sublime Text\Packages
    Reply With Quote Edit / Delete Reply Netherlands Show Events Agree Agree x 1Dumb Dumb x 1 (list)

  11. Post #11
    Gold Member
    Lexic's Avatar
    March 2009
    6,123 Posts
    rate me dumb. where do I install it to >.<
    C:\Users\Xx\AppData\Roaming\Sublime Text\Packages\GLua
    Edit:
    Oh buttz, I didn't notice you'd said that.
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Dumb Dumb x 2Late Late x 1 (list)

  12. Post #12
    c-unit's Avatar
    March 2010
    1,685 Posts
    Yeah, I got it installed.They are right though, certain methods/functions don't highlight D:>
    Reply With Quote Edit / Delete Reply United States Show Events Dumb Dumb x 1 (list)

  13. Post #13
    Get your own DarkRP Server!
    FPtje's Avatar
    January 2006
    5,645 Posts
    Yeah, I got it installed.They are right though, certain methods/functions don't highlight D:>
    Fixed in V2
    Download V2 here:
    Solidfiles download:



    Dropbox download

    It was a bitch to figure out.
    Reply With Quote Edit / Delete Reply Netherlands Show Events Dumb Dumb x 1 (list)

  14. Post #14
    c-unit's Avatar
    March 2010
    1,685 Posts
    Fixed in V2
    Download V2 here:
    Solidfiles download:


    Dropbox download

    It was a bitch to figure out.
    what was wrong?

    Edited:



    :colbert:
    Reply With Quote Edit / Delete Reply United States Show Events Dumb Dumb x 4 (list)

  15. Post #15
    Gold Member
    Loures's Avatar
    February 2009
    2,153 Posts
    It works well for me, but I think it needs more colors, for metamethods, library functions, enums ecc...

  16. Post #16
    CJF
    PieClock's Avatar
    August 2006
    16,272 Posts
    I was looking for just this a few days ago.

  17. Post #17
    yakahughes's Avatar
    April 2008
    1,318 Posts
    Sweet.

    Also a shortcut to get to %APPDATA%/Sublime Text/Packages is to open Sublime and click Preferences > Browse Packages.
    Reply With Quote Edit / Delete Reply United States Show Events Useful Useful x 1 (list)

  18. Post #18
    Dennab
    June 2010
    1,870 Posts
    I dunno why it said I rated agree, even after you told me in Steam. Changed it. Nice work.

  19. Post #19
    One of the million useless Gold Members
    Kittai's Avatar
    December 2010
    707 Posts
    http://i54.tinypic.com/2m2ao8l.png

    :frog:

    But thanks for the plugin, Falco.
    Reply With Quote Edit / Delete Reply United States Show Events Funny Funny x 7Dumb Dumb x 1 (list)

  20. Post #20
    Gold Member
    Lexic's Avatar
    March 2009
    6,123 Posts
    Fixed in V2
    Download V2 here:
    Solidfiles download:



    Dropbox download

    It was a bitch to figure out.
    Excelent. I may start to use this, it looks rather nice.

  21. Post #21
    Get your own DarkRP Server!
    FPtje's Avatar
    January 2006
    5,645 Posts
    http://i54.tinypic.com/2m2ao8l.png

    :frog:

    But thanks for the plugin, Falco.
    That's a script that used gm_cvar2 to bypass SE. I doubt it still works. I now use it to use cheat convars on non-scriptenforced servers.
    Reply With Quote Edit / Delete Reply Netherlands Show Events Dumb Dumb x 1 (list)

  22. Post #22
    c-unit's Avatar
    March 2010
    1,685 Posts
    That's a script that used gm_cvar2 to bypass SE. I doubt it still works. I now use it to use cheat convars on non-scriptenforced servers.
    but you said you dunno if it still works

    :frog:
    Reply With Quote Edit / Delete Reply United States Show Events Funny Funny x 3Agree Agree x 1 (list)

  23. Post #23
    Get your own DarkRP Server!
    FPtje's Avatar
    January 2006
    5,645 Posts
    V3, probably final:

    http://dl.dropbox.com/u/6766710/Gmod...lugin%20V3.zip

    Changelog:
    Made loading Lua scripts a lot faster. It was damn slow.

  24. Post #24
    moo
    CowThing's Avatar
    November 2006
    4,812 Posts
    Thanks! I think I'll start using Sublime over NP++ from now on, it's got a nice clean interface.
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 1 (list)

  25. Post #25
    Jvs
    PENISCorp's First Employee
    Jvs's Avatar
    June 2009
    1,597 Posts
    Thanks! I think I'll start using Sublime over NP++ from now on, it's got a nice clean interface.
    You traitor :arghfist:
    Reply With Quote Edit / Delete Reply Italy Show Events Funny Funny x 3Friendly Friendly x 1Dumb Dumb x 1 (list)

  26. Post #26
    Get your own DarkRP Server!
    FPtje's Avatar
    January 2006
    5,645 Posts
    You traitor :arghfist:
    This program works better than N++.
    I just found out about snippets. You can easily make snippets. I made one for hook.Add.
    I press hook<tab> and the code for hook.Add is there. The cursor is on the first argument. I fill it in, press tab and the cursor goes to the next argument etc.
    fucking awesome.
    Reply With Quote Edit / Delete Reply Netherlands Show Events Agree Agree x 3Informative Informative x 1Dumb Dumb x 1 (list)

  27. Post #27
    Gold Member
    Lord Ned's Avatar
    April 2006
    3,702 Posts
    FPtje: Can you show what your .sublime-snippet looks like? (I assume you do Tools->New Snippet)

  28. Post #28
    Steins;Gate SUCKS
    Dave_Parker's Avatar
    October 2008
    4,993 Posts
    This program works better than N++.
    I just found out about snippets. You can easily make snippets. I made one for hook.Add.
    I press hook<tab> and the code for hook.Add is there. The cursor is on the first argument. I fill it in, press tab and the cursor goes to the next argument etc.
    fucking awesome.
    Well, that pushed me into switching.

  29. Post #29
    Get your own DarkRP Server!
    FPtje's Avatar
    January 2006
    5,645 Posts
    V4:


    Changelog:
    - && || { and } are now highlighted (I finally figured it out) :buddy:
    - Includes snippets from hook.Add, hook.Remove, local function.., timer.Simple and timer.Create
    How to use the hook.Add snippet:
    1. type hook (you have to actually type it, if you press backspace to correct something or copy paste the word it won't work)
    2. press tab
    3. Enter your Hook ID
    4. Press tab again!
    5. Enter the name of your hook
    6. Tab!
    7. Either type the name of the function or just go on and fill in the function.

    How to make a snippet
    You can go to tools > new snippet and make a snippet from there. But I recommend:
    Preferences > Browse packages > GMod Lua > Create a copy of one of the files with the .sublime-snippet extension > change the name of the copy > edit with sublime text editor.

    You don't have to restart sublime for the snippet to take effect.
    Snippet example of hook.Add:
    Code:
    <snippet>
    	<content><![CDATA[hook.Add("${1:Think}", "${2:Press tab to enter this value}", ${3:function()
    	
    end})]]></content>
    <tabTrigger>hook</tabTrigger>
    	<scope>source.lua</scope>
    	<description>hook.Add()</description>
    </snippet>
    Reply With Quote Edit / Delete Reply Netherlands Show Events Informative Informative x 1 (list)

  30. Post #30
    Gold Member
    Loures's Avatar
    February 2009
    2,153 Posts
    Now definatly switching to Sublime .
    Reply With Quote Edit / Delete Reply Italy Show Events Late Late x 2Agree Agree x 1Disagree Disagree x 1 (list)

  31. Post #31
    TGiFallen's Avatar
    January 2010
    1,440 Posts
    This is awesome, a dream come true! One question though, is there any possibility of autocomplete? Bit that isn't the important question, is it possible to have like a search bar and you can search functions and get a description similar to the current wiki? I only ask this because I don't always have Internet access when coding.
    Reply With Quote Edit / Delete Reply Canada Show Events Disagree Disagree x 1 (list)

  32. Post #32
    Gold Member
    Lexic's Avatar
    March 2009
    6,123 Posts
    - && || { and } are now highlighted (I finally figured it out) :buddy:
    how about &,|,!=, //, /* */ and continue?
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Agree Agree x 2Disagree Disagree x 1 (list)

  33. Post #33
    yakahughes's Avatar
    April 2008
    1,318 Posts
    how about &,|,!=, //, /* */ and continue?
    What is continue in lua?
    Reply With Quote Edit / Delete Reply United States Show Events Disagree Disagree x 1 (list)

  34. Post #34
    Gold Member
    blown25's Avatar
    March 2009
    1,996 Posts
    Version 4 is out!
    Changelog:
    1. Now highlights || && { and }
    2. Snippets!


    The sublime thread has been around for ages now, but I decided to give it a try last time I saw the thread.
    It's absolutely great. The free version is just as great as the paid version, just every week or so a popup comes up and you press no. I swear this shit is better than Notepad++. It just misses the find in files plugin...

    Thread on sublime:
    http://www.facepunch.com/threads/102...me-Text-Editor

    More info about sublime:
    http://www.sublimetext.com/

    This evening I made a quick plugin for GMod syntax highlighting. It has the GMod Functions (as of 17-12-2010). The C style commenting and some other stuff. I didn't manage to get the && and || operators to work, but fuck those.

    Download V4 here:
    Solidfiles download:

    http://dl.dropbox.com/u/6766710/Gmod...lugin%20V4.zip


    Thanks to:
    Sublime: Great shit man
    Kyle Fleming: Making the NPP syntax highlight script and putting it in the NPP highlight package. I used his script to get all the functions and enumerations on a vanilla gmod.

    Picture of sublime:


    Gmod Lua in sublime:


    How to install
    Extract the folder and place the "Gmod Lua" folder in %APPDATA%\Sublime Text\Packages

    Open a Lua script and select View > Apply Syntax Highlighting > Gmod Lua
    fucking damn, nice !
    Reply With Quote Edit / Delete Reply Sweden Show Events Dumb Dumb x 2Friendly Friendly x 1 (list)

  35. Post #35
    Steins;Gate SUCKS
    Dave_Parker's Avatar
    October 2008
    4,993 Posts
    What is continue in lua?
    It's like break but it only stops the current iteration, not the entire loop.

  36. Post #36
    yakahughes's Avatar
    April 2008
    1,318 Posts
    I thought we didn't have that and people were complaining, or was it a recent addition by garry?

  37. Post #37
    I'm Better Than You
    Handsome Matt's Avatar
    August 2008
    5,489 Posts
    it a recent addition by garry
    yes.

  38. Post #38
    Gold Member
    Lord Ned's Avatar
    April 2006
    3,702 Posts
    cam.End3D() doesn't seem to have proper highlighting.

  39. Post #39
    Gold Member
    Loures's Avatar
    February 2009
    2,153 Posts
    You can easily add those if you look around the package folder.

  40. Post #40
    Gold Member
    Lord Ned's Avatar
    April 2006
    3,702 Posts
    Versus reporting them for the next version so the actual product becomes better? Not to mention it's still in active development so it's highly likely to get fixed?