Jump to content

Photo
- - - - -

SQF Syntax Highlighter for Sublime Text 2


  • Please log in to reply
17 replies to this topic
Thread Starter
jonbons
jonbons

    Private First Class

  • Members
  • 41 posts

  • Joined: 15-August 2011

Posted 17 March 2012 - 02:52 #1

I use Sublime for a lot of my projects and I always wanted to be able to add syntax highlighting for sqf files, here is a package you can install in Sublime Text 2.


Let me know if you have any problems or if there are errors in the syntax highlighting.

Download/Information:
https://github.com/J...me-SQF-Language

Posted Image


Install by running the following command in /Packages
git clone git@github.com:JonBons/Sublime-SQF-Language.git "SQF Language"

Or

Add to the Sublime Package Control repository list. If you have Package Control installed, open Sublime Text and hit CTRL+SHIFT+P and select Package Control: Add Repository and input
https://github.com/JonBons/Sublime-SQF-Language/
You will now be able to install/manage via Package Control.


Link to Sublime Text 2: (Sublime is shareware, you are not forced to pay for it. If you don't pay for it every once in a while a message will pop up asking if you want to buy it, you can just click No.)
http://www.sublimetext.com/2

Edited by JonBons, 17 March 2012 - 17:35.


sickboy
sickboy

    Colonel

  • Members
  • 9947 posts

  • Joined: 11-May 2005

Posted 17 March 2012 - 08:39 #2

Nice one! Thanks!

Btw, forgot quotes at the end, should be:
git clone git@github.com:JonBons/Sublime-SQF-Language.git "SQF Language"

Also when opening a SQF file, it automatically had detected SQF Language, did not need to set it manually.

Edited by Sickboy, 17 March 2012 - 08:57.


Thread Starter
jonbons
jonbons

    Private First Class

  • Members
  • 41 posts

  • Joined: 15-August 2011

Posted 17 March 2012 - 23:15 #3

Nice one! Thanks!

Btw, forgot quotes at the end, should be:

...

Also when opening a SQF file, it automatically had detected SQF Language, did not need to set it manually.


Thanks, I was unsure if it would automatically select the highlighter due to me testing this all on one machine and I had messed with a bunch of settings. I've updated the readme with the proper command.

Muzzleflash
Muzzleflash

    First Sergeant

  • Members
  • 835 posts

  • Joined: 19-February 2010

Posted 22 March 2012 - 15:37 #4

This is awesome. Thanks :)

Sniperwolf572
Sniperwolf572

    Chief Warrant Officer

  • Members
  • 3062 posts

  • Joined: 23-February 2004

Posted 02 May 2012 - 08:30 #5

I've been using ST2 for a while now and I've just randomly typed "SQF.tmLanguage" in Google and found your GitHub repo.

This really made my morning, thanks! :)
Posted Image

sickboy
sickboy

    Colonel

  • Members
  • 9947 posts

  • Joined: 11-May 2005

Posted 02 May 2012 - 09:28 #6

I've been using ST2 for a while now and I've just randomly typed "SQF.tmLanguage" in Google and found your GitHub repo.

This really made my morning, thanks! :)

Im growing fonder by the minute of ST2 myself as well, great editor.
Thanks to Banshee for putting me on it's trail, and JonBons for the SQF plug!

Shizweak
Shizweak

    Lance Corporal

  • Members
  • 51 posts

  • Joined: 26-November 2012

Posted 07 December 2012 - 01:58 #7

Beginner SQF scripter, long time ST user - many thanks for this!

Thread Starter
jonbons
jonbons

    Private First Class

  • Members
  • 41 posts

  • Joined: 15-August 2011

Posted 30 December 2012 - 07:03 #8

I have pushed a commit that adds support for the OA 1.62 and OA 1.63 commands that were listed on the Bohemia Wiki page.

DenVdmj
DenVdmj

    Private First Class

  • Members
  • 14 posts

  • Joined: 14-December 2007

Posted 14 January 2013 - 21:02 #9

Great! Good highlighting for the most fappable editor ))
Doesn't work highlighting for the hex values, like an 0xA0

Thread Starter
jonbons
jonbons

    Private First Class

  • Members
  • 41 posts

  • Joined: 15-August 2011

Posted 24 February 2013 - 07:06 #10

I updated the highlighter with some missing arithmetic and comparison operators.

Also note that I got a pull request approved to add this language into the official package control repository list. This means on a fresh install of the package control plugin you can search for SQF and find it without needing to add the repository.

sickboy
sickboy

    Colonel

  • Members
  • 9947 posts

  • Joined: 11-May 2005

Posted 24 February 2013 - 10:36 #11

Nice one JonBons, thanks, appreciate the effort

Thread Starter
jonbons
jonbons

    Private First Class

  • Members
  • 41 posts

  • Joined: 15-August 2011

Posted 05 March 2013 - 01:29 #12

I just pushed a commit that adds the current commands from the arma 3 scripting commands page.

https://community.bi...g_Commands_List

sickboy
sickboy

    Colonel

  • Members
  • 9947 posts

  • Joined: 11-May 2005

Posted 06 March 2013 - 10:39 #13

Thanks again!

kemo
kemo

    Private First Class

  • Members
  • 15 posts

  • Joined: 28-February 2013

Posted 07 March 2013 - 01:28 #14

this is sweet! Exactly what I was looking for, thanks for sharing! I cant imagine a life without Sublime!

Thread Starter
jonbons
jonbons

    Private First Class

  • Members
  • 41 posts

  • Joined: 15-August 2011

Posted 07 March 2013 - 01:42 #15

I'm currently testing adding sqf to the goto-documentation plugin so if you want to try it out here is the instructions.

How to use with Package Control:
  • Ctrl + Shift + P
  • Type "add repo"
  • Click "Package Control: Add Repository"
  • Paste this link:
    https://github.com/JonBons/sublime-text-2-goto-documentation-sqf
  • Afterwards just do Install Package and type "sqf"
  • Then click the package "sublime-text-2-goto-documentation-sqf"


You then need to add the keybind
  • Preferences -> Key Bindings - User
  • Add keybind:
    { "keys": ["f1"], "command": "goto_documentation" }

Now you can simply select the text you want to search the BIKI for and then press F1 and it will open a browser window to the BIKI.

cuel
cuel

    Sergeant Major

  • Members
  • 1557 posts

  • Joined: 15-October 2011

Posted 05 November 2013 - 18:11 #16

Started using this. It's great.

Suggestion: add BIS_fnc_* to "existing" commands

Can you change anything regarding the auto indent? Currently it does this
original:
[] spawn {
	waitUntil {time > 0};
	player switchMove "amovpercmstpslowwrfldnon";
};

auto-indent:
[] spawn {
waitUntil {time > 0};
player switchMove "amovpercmstpslowwrfldnon";
};


UbiquitousUK
UbiquitousUK

    Corporal

  • Members
  • 76 posts

  • Joined: 24-June 2009

Posted 13 November 2013 - 20:37 #17

Awesome work. I am transitioning from emacs to ST2 for my work and your syntax highlighting gives me a personal reason to enjoy the move.

Thread Starter
jonbons
jonbons

    Private First Class

  • Members
  • 41 posts

  • Joined: 15-August 2011

Posted 20 November 2014 - 21:43 #18

I just got a pull request from a Github staff member to add a license so that they can integrate the highlighter into Github's syntax highlighting so hopefully that will show up soon on GH projects.

I already noted that when searching on Github by language SQF is now an option.

I also did a quick update to add some missing commands that were added before v1.34.