NXC Syntax Highlighting in Notepad++
Once you’re done with Spiller’s post on compiling NXC code in Notepad++, you may wish to improve the look of things a bit.
NOTE: Due to Notepad++ limitations, we’re going to have to sacrifice the C language, and NXC shalt be born from its ashes. (Don’t worry: you can always use C++ as a substitute. :))
Let us begin.
Adding the .nxc
File Extension
- Open up
Settings->Style Configurator...
- Select
C
underLanguage :
- Under
User ext. :
, addnxc
This straightforward, humble action should bring life to your source code.
Adding Keywords
In the same Style Configurator
dialog:
- Under
Style :
, selectINSTRUCTION WORD
- Under
User-defined keywords
, copy and paste the following:__FLTRETVAL__ __RETURN__ __RETURNF__ __RETURNS__ __RETURNU__ __RETVAL__ __STRRETVAL__ __STRBUFFER__ __STRTMPBUFFER__ __TMPBYTE__ __TMPFLOAT__ __TMPLONG__ __TMPULONG__ __TMPWORD__ asm false mutex priority repeat start stop sub true until
- Under
Style :
, selectTYPE WORD
- Under
User-defined keywords
, copy and paste the following:bool byte string inline safecall task
Adding Function Auto-Completion
- Open up
Settings->Preferences...
- Click on the
Backup/Auto-Completion
tab - Under
Auto-Completion
, check theEnable auto-completion on each input
andFunction parameters hint on input
checkboxes - Select
Function completion
- You may also wish to change it to “From 3 th character”, or something like that.
Customizing Function Auto-Completion for NXC
UPDATE: I haven’t tried it yet, but bungeshea has made a new version that uses features introduced in Notepad++ 6.2.
This part is not for the faint-hearted. Venture on if you dare. (Actually, it’s not that complicated.)
- Download the NXC API to Notepad++ XML Converter binaries here. (Or compile them from source, if you wish.)
- Drag the
%ProgramFiles%\BricxCC\Default\nxc_api.txt
toNXC API to Notepad++ XML.exe
. - Rename the newly generated
nxc.xml
file toc.xml
. - Move
c.xml
to%ProgramFiles%\Notepad++\plugins\APIs\
.
That’s it!
Plugins
NppAutoIndent
This gives you a “smart indentation” feature. I find it pretty useful.
- Download the NppAutoIndent plugin:
- Open up
Plugins->Plugin Manager->Show Plugin Manager
- Under the
Available
tab, check theNppAutoIndent
checkbox - Click
Install
- Open up
- Enable
Plugins->NppAutoIndent->Smart Indent