Jump to content
mossarelli

Notepad++ SQF Syntax Highlighting (Dark Theme)

Recommended Posts

https://dl.dropboxusercontent.com/u/28058839/Preview.jpg (259 kB)

Notepad++ SQF Syntax Highlighting

by

Nicolas & GossamerSolid & Sanjo & GossamerSolid

(here go the links to required addons)

Description:

Notepad++ SQF Syntax Highlighting with all known ArmA 3 functions (including the BIS_fnc functions & CBA). Code block folding is also supported.

This is an edit of Nicolas & GossamerSolid & Sanjo's old Syntax Highlightning that I later on updated with GossamerSolid's functions from BIS and then added CBA functions to it.

The large difference on this syntax is that it's most compatible with dark notepad++ themes like Mono Industrial and has a complete rainbow colored highlight.

You will most likely think it's an awful syntax highlight at first, but my syntax high lightning has helped me decode scripts from Xeno and ACRE team with ease. It's strength being the image imprint it creates in your memory so that you can quickly skim through lines of code and know exactly where you want to edit.

Some what inspired from the Mass Effect 2 minigame "Hacking".

Features:

Common styles:

Global Variables and Functions: Green.

Local Variables and Functions (_x and _forEachIndex): Dark Blue with Black Highlight (Prefix: _)

Syntax Structure: Red on Black.

Arma commands: Purple on Black.

BIS and CBA Functions: Yellow on Black.

Call, Compile, Format, Spawn, ExecVM, Exec, ExecFSM, PreprocessFiles, private: Red on Black.

Custom Keyword: Light Blue on Black.

Variable Types:

Strings: Light Purple on dark Grey.

Single Quote Strings: Orange and black.

Numbers: Orange and Bold.

Operators: Yellow on Black.

Installation:

Syntax Highlighting:

Open Notepad++. Click in the menu on: "Language -> Define your own Language -> Import" and import the file "syntaxhighlighting/ArmAScript.xml".

How to modify styles:

You can modify the styles via "Language -> Define your own Language". Select "sqf5" (under "User language").

BIS_fnc_ is not defined as a keyword?

For future compatibility and to not have to update the script highlighting, any prefix that starts with BIS_fnc_ and CBA_fnc_ will automatically highlight. Make sure you spell the functions right because you can't tell.

Make your own keyword group for personalized functions/variables:

7th keyword group is predefined with a user style already. Just put your name_variable_ that you will use as global variables there or your name_fnc_ for functions and they will automatically highlight your personalized variables and functions.

Known issues:

Sometimes in nested code inside quote marks, symbols stop being highlighted as intended. (In order to fix, go to the User Defined Language dialog, to the tab "Operators & Delimiters" and remove the checkboxes under nesting for all styles. (Depending on how advanced your scripts are (call compile format :D), you might want to activate this on a later date.))

Numbers, operators or symbols sometimes get the same style as delimiters. (Remove Curly brackets from Folding and add the symbols to Operators 1 if you don't care about folding. Otherwise, put a space before delimiter and after.

Change log:

Added BIS_fnc and CBA_fnc as prefix keywords.

Download:

https://dl.dropboxusercontent.com/u/28058839/ArmAScript.rar

Share this post


Link to post
Share on other sites
39 minutes ago, Isaac-Neo said:

Link is broken

 

Link is eight years old.

 

34ZQ5LJ.jpg

 

The current relevant topic for this syntax highlighter is (now) just below this topic.

 

 

  • Like 1
  • Thanks 1
  • Haha 1

Share this post


Link to post
Share on other sites

Please update the link, I want to download. Or can you tell me where you can download...

Share this post


Link to post
Share on other sites
1 hour ago, Freakgds said:

Or can you tell me where you can download...

 

Look at the reply above yours.

Share this post


Link to post
Share on other sites

Hi,

 

a bit pissed about being forced to write SQF code on a white background in my notepad++ (in the basic theme everything worked, but for example in Dark/PlasticCodeWrap ... you know what it looked like 🙂 ) - I decided to clean it up - and write my own UDL with SQF version for dark themes. And here it is - the first (a bit test, but fully functional) version :


SQFdark.xml

The SQF code syntax highlighting looks like on the screen below (with my favourite PlasticCodeWrap theme)

2023-04-15_21_32_02-first_glance_sqf_dar

Have a fun 🙂 !

Share this post


Link to post
Share on other sites

Yep but neither download link seem to be working...

Thank You anyway 🙂

 

Share this post


Link to post
Share on other sites
33 minutes ago, markooff said:

Yep but neither download link seem to be working...

Thank You anyway 🙂

 

 

Yes, which is made clear in the discussion above. I have linked to the current version twice in my previous replies, here it is again:

 

Arma Syntax Highlighter

 

Share this post


Link to post
Share on other sites

THX, but I will check if it really works first.

(on basic as well as and dark theme)

🙂

Share this post


Link to post
Share on other sites

OK, after installing it (and few littletests) it looks like working properly 🙂 but ,
1) coloristic scheme (on dark theme is a bit ... less readable then in my version - the C-like style I find more consequent and clear for editing, but, of course it depends on your preferences ) See the basic differences between Your style and mine :

Your's:

2023-04-16_10_19_14-E__PGM_GUE_boat_cont

 

vs My:
2023-04-16_10_34_25-my_style_of_sqf_high



and here' You 've got the original C/C++ highlights style - for comparison :
 

2023-04-16_10_21_05-E__config.cpp_-_Note


 

 

2) in white theme - I find it highly illegible - due to the paleness of the colors on a white background

2023-04-16_10_18_09-E__PGM_GUE_boat_cont

I think - if fonts was a bit thicker (maybe 1 type) or colors with extended contrast  - the results would be much more comfortable for long term use...

 

But thank you, for Your work - of course 🙂

Share this post


Link to post
Share on other sites

OK, since this topic keeps getting dug up, let's clear some things. First,

THIS LINK IS TO THREAD CREATED BY ORIGINAL AUTHOR(S) AND YOU CAN ALWAYS FIND THE MOST UP TO DATE VERSION ON THE LAST PAGE OF THAT THREAD!

 

Next,

@markooff, great that you made use of Notepad++' customization, that is the whole point of it, however couple of things here also.

 

A) File you shared is based on something very old, I'm not sure that was even part of the original pipeline. Exert from ReadMe.txt on how to customize styles:

Quote

How to modify styles?
=====================

You can modify the styles via "Language >> User Defined Language >> Define your language...". Under "User language", select "SQF".
By default, styles under "Folding & Default >> Default style and Folding in code 1" and "Operators & Delimiters >> Operators 1 and Delimiter 1" adopt global style.
This can also be achieved for any category by right clicking on either foreground or background color (diagonal lines will appear over color selection window).
Global style is defined in "Settings >> Style Configurator >> Global Styles >> Default Style".

NOTE: if you use custom style for SQF and do not want to edit the Notepad++ menus after every update, you can just copy <Styles>...</Styles> block of code from "Language and Theme\SQF.xml" into updated files and then import.
Default path for User Defined Languages imported through Notepad++ menu: "%AppData%\Notepad++\userDefineLang.xml".
If you use portable version of Notepad++, then these are located in its root directory.

As NOTEd, for distribution purposes, you should share only <Styles> block, in your case:

<Styles>
<WordsStyle name="DEFAULT" fgColor="FFFFFF" bgColor="000000" colorStyle="1" fontName="" fontStyle="0" nesting="0"/>
<WordsStyle name="COMMENTS" fgColor="219EEB" bgColor="000000" colorStyle="1" fontName="" fontStyle="2" nesting="0"/>
<WordsStyle name="LINE COMMENTS" fgColor="219EEB" bgColor="000000" colorStyle="1" fontName="" fontStyle="2" nesting="0"/>
<WordsStyle name="NUMBERS" fgColor="F96400" bgColor="000000" colorStyle="1" fontName="" fontStyle="0" nesting="0"/>
<WordsStyle name="KEYWORDS1" fgColor="FFFFCC" bgColor="000000" colorStyle="1" fontName="" fontStyle="1" nesting="0"/>
<WordsStyle name="KEYWORDS2" fgColor="CCFFFF" bgColor="000000" colorStyle="1" fontName="" fontStyle="0" nesting="0"/>
<WordsStyle name="KEYWORDS3" fgColor="FAE600" bgColor="000000" colorStyle="1" fontName="" fontStyle="0" nesting="0"/>
<WordsStyle name="KEYWORDS4" fgColor="BD0097" bgColor="000000" colorStyle="1" fontName="" fontStyle="1" nesting="0"/>
<WordsStyle name="KEYWORDS5" fgColor="B2BF00" bgColor="000000" colorStyle="1" fontName="" fontStyle="0" nesting="0"/>
<WordsStyle name="KEYWORDS6" fgColor="65BDBD" bgColor="000000" colorStyle="1" fontName="" fontStyle="0" nesting="0"/>
<WordsStyle name="KEYWORDS7" fgColor="FA9200" bgColor="000000" colorStyle="1" fontName="" fontStyle="0" nesting="0"/>
<WordsStyle name="KEYWORDS8" fgColor="CCFFFF" bgColor="000000" colorStyle="1" fontName="" fontStyle="0" nesting="0"/>
<WordsStyle name="OPERATORS" fgColor="FFAE00" bgColor="000000" colorStyle="1" fontName="" fontStyle="0" nesting="0"/>
<WordsStyle name="FOLDER IN CODE1" fgColor="FFAE00" bgColor="000000" colorStyle="1" fontName="" fontStyle="0" nesting="0"/>
<WordsStyle name="FOLDER IN CODE2" fgColor="FFAE00" bgColor="000000" colorStyle="1" fontName="" fontStyle="0" nesting="0"/>
<WordsStyle name="FOLDER IN COMMENT" fgColor="EEEEEE" bgColor="000000" colorStyle="1" fontName="" fontStyle="0" nesting="0"/>
<WordsStyle name="DELIMITERS1" fgColor="5FDB00" bgColor="000000" colorStyle="1" fontName="" fontStyle="0" nesting="0"/>
<WordsStyle name="DELIMITERS2" fgColor="000000" bgColor="000000" colorStyle="1" fontName="" fontStyle="0" nesting="0"/>
<WordsStyle name="DELIMITERS3" fgColor="000000" bgColor="000000" colorStyle="1" fontName="" fontStyle="0" nesting="0"/>
<WordsStyle name="DELIMITERS4" fgColor="000000" bgColor="000000" colorStyle="1" fontName="" fontStyle="0" nesting="0"/>
<WordsStyle name="DELIMITERS5" fgColor="000000" bgColor="000000" colorStyle="1" fontName="" fontStyle="0" nesting="0"/>
<WordsStyle name="DELIMITERS6" fgColor="000000" bgColor="000000" colorStyle="1" fontName="" fontStyle="0" nesting="0"/>
<WordsStyle name="DELIMITERS7" fgColor="000000" bgColor="000000" colorStyle="1" fontName="" fontStyle="0" nesting="0"/>
<WordsStyle name="DELIMITERS8" fgColor="000000" bgColor="000000" colorStyle="1" fontName="" fontStyle="0" nesting="0"/>
</Styles>

This makes it easier to update with new versions. Therefore I would kindly ask you to adjust what you shared in order to avoid even further confusion.

 

 

B) As of version 8.4 or so, Notepad++ supports Dark Mode which makes it's toolbar, menus and whatnot, well... dark. Therefore, update it to the latest version and you can enable it in preferences:

Notepad++ >> Settings >> Preferences >> Dark Mode

 

 

Finally, a note on process for setting default colors, which can also be found in original thread. Since some people like to work in brighter environments that had to be taken into account. Therefore a balance in contrast had to be found for both dark and light or even white backgrounds. Comments are also rather de-saturated because they are comments and not meant to be the main attraction.

I'm sure you're glad just to have dark background at this point but talking about long term, I would advise not to use completely black backgrounds, perhaps dark(er) gray with even hint of blue, green or yellow in there. This generally depends on your physical environment of course, such as amount and direction of sunlight in your room/office.

Some addition tools for web browsing and even system wide solutions can be found in this thread:

Some of that is a bit outdated by now, Firefox for example has a lot more native support as well as it's plugins but it can still be useful.

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

To make it clear - @Janez - I don't want to make another shitstorm with nobody, BUT,
I'm just a programmer who DON'T LIKE to burn his eyes with hundreds of hours working in SQF !!

(so I;ve made and small port of the SQF version I used before , and THAT'S ALL )

But because You probably don't read my previous post with care - I repeat it here :
the color version of that NEWEST version of original UDL for SQF  ISN'T GOOD FOR ME (!) , so I've just created another one , and THAT'S ALL .
You can, but you don't have to use it ... that's no problem for me at all 🙂 ,

 

BUT 
generall purpose of the "DISCUSSION FORUM" is to DISCUSS 
a range of interesting things, and that's what we do here

 

So, please, STOP USING OVERSIZED FONTS - because it makes the discussion and your statement much less understandable

 

 

Regards

 

markooff

Post Scriptum : For me, this makes the EoD for this thread ..

Share this post


Link to post
Share on other sites
6 hours ago, markooff said:

I'm just a programmer who DON'T LIKE to burn his eyes with hundreds of hours working in SQF !!

 

6 hours ago, markooff said:

the color version of that NEWEST version of original UDL for SQF  ISN'T GOOD FOR ME (!) , so I've just created another one , and THAT'S ALL .

Of course, that is perfectly understandable, no one is saying otherwise or trying to prevent you from doing so. It's great that you created you own color scheme and shared it. There is no issue here whatsoever, I was merely pointing out how to share your color scheme for other people to use so it does not conflict with latest versions in terms of functionality. Hence I asked you to share only the part relevant to your color scheme instead of entire file, so less adapt users merge it instead of replacing the file. In my previous post you can find out how to do that and I even provided you with an example which would simply needed to be copy-pasted in your existing file that you shared.

 

6 hours ago, markooff said:

So, please, STOP USING OVERSIZED FONTS - because it makes the discussion and your statement much less understandable

Oversized font is only there to make it easy for people to find original thread since this outdated thread keeps getting resurrected with requests for download links. You may also notice that oversized font is before you were mentioned in any capacity. That said, you doing what you thought I did, hardly makes it better now, does it?

 

6 hours ago, markooff said:

generall purpose of the "DISCUSSION FORUM" is to DISCUSS  a range of interesting things, and that's what we do here

By all means, have at it.

 

Btw, if you want to tag someone in a post, then you have to type @<Person's_Username> and select it from the list. If you do not select it from drop down list, then it is displayed as plain text.

  • Like 2

Share this post


Link to post
Share on other sites

Original post updated, to remove outdated Armaholic link.

  • Like 2

Share this post


Link to post
Share on other sites
27 minutes ago, R0adki11 said:

Original post updated, to remove outdated Armaholic link.

 

Could it just be locked, since it's a dead topic? The first reply was an 8-year necro.

Share this post


Link to post
Share on other sites
On 4/18/2023 at 2:24 PM, Harzach said:

 

Could it just be locked, since it's a dead topic? The first reply was an 8-year necro.

That is could be so, but I have updated the first post to point to where the addon is still been maintained. So I feel that the thread is still relevant. 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×