QC support for Notepad++
Moderator: InsideQC Admins
6 posts
• Page 1 of 1
QC support for Notepad++
This tutorial will allow Notepad++ to populate the Function List with QC functions.
The functions needs to be in one of the following formats; semicolons are optional:
It won't work for functions in the formats void () example = {}; and void () example {}; yet.
Go to the folder where Notepad++ is installed, and open the file functionList.xml .
Insert this line before the line </associationMap>:
Now, insert this section before the line </parsers>:
And here's a file for syntax highlighting. Right-click on this link and choose the "Save link as..." context menu item: NotepadPlusPlus_QC_highlighting.
Some notes on this syntax highlighting file:
- It includes a hack to highlight preprocessor directives. FrikQcc 2.6 supports these: #include #includelist #define #undef #ifdef #ifndef #else #endif #pragma #warning #error.
- Since builtins can be freely named, standard builtin functions' names are in regular color, but in bold format.
- Constants are in green; this includes variables usually treated as constants, like MOVETYPE_WALK.
- Constant strings have a background color to help tracking them across whitespaces, and vectors are underlined for the same reason.
- Flow control commands (switch case default if else break return do while) use a specific color to make it easier to track instruction flow.
- System globals are in bold dark blue, and system fields are in regular dark blue.
- System global functions and system field functions (.void) are in regular blue.
- Data types are in light blue, to help them stand out.
- Operators and separators are in red. The contrast between red, blue and black makes the separators easier to notice, while being easy on the eyes.
- Line comments have a yellow background, but multi-line comments doesn't, because colored backgrounds on multiline comments is distracting when in header-style text. To compensate for this, multi-line comments are in bold gray.
- Macro sections are in bold with a slightly dark blue color, to differentiate their operators from regular ones.
The functions needs to be in one of the following formats; semicolons are optional:
- Code: Select all
void example () { };
void example () = { };
void example () = [$framemacro, thinkfunction] {};
It won't work for functions in the formats void () example = {}; and void () example {}; yet.
Go to the folder where Notepad++ is installed, and open the file functionList.xml .
Insert this line before the line </associationMap>:
- Code: Select all
<association userDefinedLangName="QuakeC" id="qc_function"/>
</associationMap>
Now, insert this section before the line </parsers>:
- Code: Select all
<parser id="qc_function" displayName="QuakeC" commentExpr="((/\*.*?\*)/|(//.*?$))">
<function
mainExpr="^[\t ]*((static|const|virtual)[\s]+)?[\w:]+([\s]+[\w]+)?([\s]+|\*[\s]+|[\s]+\*|[\s]+\*[\s]+)([\w_]+[\s]*::)?(?!(if|while|for))[\w_]+[\s]*\([^\)\(]*\)([\s]*const[\s]*)?[\n\s]*[=\[\{]"
displayMode="$functionName">
<functionName>
<nameExpr expr="(?!(if|while|for))[\w_~]+[\s]*\("/>
<nameExpr expr="(?!(if|while|for))[\w_~]+"/>
</functionName>
</function>
</parser>
</parsers>
And here's a file for syntax highlighting. Right-click on this link and choose the "Save link as..." context menu item: NotepadPlusPlus_QC_highlighting.
Some notes on this syntax highlighting file:
- It includes a hack to highlight preprocessor directives. FrikQcc 2.6 supports these: #include #includelist #define #undef #ifdef #ifndef #else #endif #pragma #warning #error.
- Since builtins can be freely named, standard builtin functions' names are in regular color, but in bold format.
- Constants are in green; this includes variables usually treated as constants, like MOVETYPE_WALK.
- Constant strings have a background color to help tracking them across whitespaces, and vectors are underlined for the same reason.
- Flow control commands (switch case default if else break return do while) use a specific color to make it easier to track instruction flow.
- System globals are in bold dark blue, and system fields are in regular dark blue.
- System global functions and system field functions (.void) are in regular blue.
- Data types are in light blue, to help them stand out.
- Operators and separators are in red. The contrast between red, blue and black makes the separators easier to notice, while being easy on the eyes.
- Line comments have a yellow background, but multi-line comments doesn't, because colored backgrounds on multiline comments is distracting when in header-style text. To compensate for this, multi-line comments are in bold gray.
- Macro sections are in bold with a slightly dark blue color, to differentiate their operators from regular ones.
-

mankrip - Posts: 915
- Joined: Fri Jul 04, 2008 3:02 am
Re: QC support for Notepad++
nice, i always just used it with the C based settings or just used qcide -.-
-

ceriux - Posts: 2223
- Joined: Sat Sep 06, 2008 3:30 pm
- Location: Indiana, USA
Re: QC support for Notepad++
I think I love you
I was waiting this for a looong time since Notepad++ is my only tool to write qc code. As soon I can get my pc back I'll post my impressions
Thanks for sharing mankrip
Thanks for sharing mankrip
Meadow Fun!! - my first commercial game, made with FTEQW game engine
- toneddu2000
- Posts: 1352
- Joined: Tue Feb 24, 2009 4:39 pm
- Location: Italy
Re: QC support for Notepad++
Very nice, thank you
- c0burn
- Posts: 208
- Joined: Fri Nov 05, 2004 12:48 pm
- Location: Liverpool, England
Re: QC support for Notepad++
Tried it. Very cool the fact notepad++ recognize now .qc files and use directly highlight syntax.
Not so sure I like builtins only in bold black, probably I'd have preferred a blue-ish color but I cannot thank you enough for the great work!
Not so sure I like builtins only in bold black, probably I'd have preferred a blue-ish color but I cannot thank you enough for the great work!
Meadow Fun!! - my first commercial game, made with FTEQW game engine
- toneddu2000
- Posts: 1352
- Joined: Tue Feb 24, 2009 4:39 pm
- Location: Italy
Re: QC support for Notepad++

This is my Notepad++ custom config for QuakeC.
Besides the different color setup, I added support to dpextensions.qc builtins (with a different color from standard QuakeC builtins) plus some constants.
It's not hard to do actually, just a tedious work in progress.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC
(LordHavoc)
-

frag.machine - Posts: 2090
- Joined: Sat Nov 25, 2006 1:49 pm
6 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest