Forum Discussion

hastinbe's avatar
hastinbe
Newbie
15 years ago

Notepad++ BrightScript Highlighting

I have created the following styler settings for BrightScript files in Notepad++. You can save the following to brightscript.xml. Open Notepad++ and go to the View menu -> User-Defined Dialogue. Click Import... and select brightscript.xml. The colors might look bad if you use a bright colored background (see note below)

Note: It was created on a darker global background color set in the Style Configurator. You can set your global background color from the Settings menu -> Style Configurator, Select Global Styles | Global override, check Enable global background colour, then pick your background colour; I use RGB(62,62,62) in the screenshot. You can also customize the colors of BrightScript from the User-Defined Dialogue after selecting BrightSript for User language at the top left.

<NotepadPlus>
<UserLang name="BrightScript" ext="brs">
<Settings>
<Global caseIgnored="yes" />
<TreatAsSymbol comment="no" commentLine="yes" />
<Prefix words1="no" words2="no" words3="no" words4="no" />
</Settings>
<KeywordLists>
<Keywords name="Delimiters">&quot;00&quot;00</Keywords>
<Keywords name="Folder+"></Keywords>
<Keywords name="Folder-"></Keywords>
<Keywords name="Operators">- ! # $ % ( ) * , . / ; [ ] ^ { } + &lt; = &gt;</Keywords>
<Keywords name="Comment"> 1 1 2 2 0&apos; 0REM</Keywords>
<Keywords name="Words1">if then else elseif endif for endfor to step exit each in end while endwhile exitwhile sub endsub function endfunction return print goto dim stop not and or next boolean integer float double string object interface invalid dynamic brsub true false ?</Keywords>
<Keywords name="Words2">getlastruncompileerror getlastrunruntimeerror sleep wait createobject getinterface uptime rebootsystem listdir readasciifile writeasciifile copyfile matchfiles deletefile deletedirectory createdirectory formatdrive strtoi ucase lcase asc chr instr left len mid right str string val abs atn cos csng cdbl exp fix int log sgn sin sqr tan cint type tab pos rnd box run eval line_num objfun</Keywords>
<Keywords name="Words3">as</Keywords>
<Keywords name="Words4"></Keywords>
</KeywordLists>
<Styles>
<WordsStyle name="DEFAULT" styleID="11" fgColor="FFFFFF" bgColor="000000" fontName="" fontStyle="0" />
<WordsStyle name="FOLDEROPEN" styleID="12" fgColor="FFFFFF" bgColor="000000" fontName="" fontStyle="0" />
<WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="FFFFFF" bgColor="000000" fontName="" fontStyle="0" />
<WordsStyle name="KEYWORD1" styleID="5" fgColor="FEC150" bgColor="000000" fontName="" fontStyle="0" />
<WordsStyle name="KEYWORD2" styleID="6" fgColor="80FF80" bgColor="000000" fontName="" fontStyle="0" />
<WordsStyle name="KEYWORD3" styleID="7" fgColor="FFFF80" bgColor="000000" fontName="" fontStyle="0" />
<WordsStyle name="KEYWORD4" styleID="8" fgColor="FFFFFF" bgColor="000000" fontName="" fontStyle="0" />
<WordsStyle name="COMMENT" styleID="1" fgColor="FFFFFF" bgColor="000000" fontName="" fontStyle="0" />
<WordsStyle name="COMMENT LINE" styleID="2" fgColor="4EBBEF" bgColor="000000" fontName="" fontStyle="0" />
<WordsStyle name="NUMBER" styleID="4" fgColor="00D96C" bgColor="000000" fontName="" fontStyle="0" />
<WordsStyle name="OPERATOR" styleID="10" fgColor="FFFF80" bgColor="000000" fontName="" fontStyle="0" />
<WordsStyle name="DELIMINER1" styleID="14" fgColor="C0C0C0" bgColor="000000" fontName="" fontStyle="0" />
<WordsStyle name="DELIMINER2" styleID="15" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="DELIMINER3" styleID="16" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
</Styles>
</UserLang>
</NotepadPlus>


And here's what it looks like:

8 Replies

  • renojim's avatar
    renojim
    Community Streaming Expert
    Thanks, I'll have to give it a try. I've just been using the vbs style.

    -JT
  • i just tried using this but every time i select this , notepad++ crashes. any ideas?
  • And, here is the lighter version. Also included is the roku default colors taken from the eclipse highlighting.
    If you are running a version of Notepad++ that does not have import / export on the "User-Defined Dialogue" then just add the lines to your "userDefineLang.xml" file.
    <NotepadPlus>
    <UserLang name="BrightScript" ext="brs">
    <Settings>
    <Global caseIgnored="yes" />
    <TreatAsSymbol comment="no" commentLine="yes" />
    <Prefix words1="no" words2="no" words3="no" words4="no" />
    </Settings>
    <KeywordLists>
    <Keywords name="Delimiters">&quot;00&quot;00</Keywords>
    <Keywords name="Folder+"></Keywords>
    <Keywords name="Folder-"></Keywords>
    <Keywords name="Operators">- ! # $ % ( ) * , . / ; [ ] ^ { } + &lt; = &gt;</Keywords>
    <Keywords name="Comment">1 1 2 2 0&apos; 0REM</Keywords>
    <Keywords name="Words1">if then else elseif endif for endfor to step exit each in end while endwhile exitwhile sub endsub function endfunction return print goto dim stop not and or next boolean integer float double string object interface invalid dynamic brsub true false ?</Keywords>
    <Keywords name="Words2">getlastruncompileerror getlastrunruntimeerror sleep wait createobject getinterface uptime rebootsystem listdir readasciifile writeasciifile copyfile matchfiles deletefile deletedirectory createdirectory formatdrive strtoi ucase lcase asc chr instr left len mid right str string val abs atn cos csng cdbl exp fix int log sgn sin sqr tan cint type tab pos rnd box run eval line_num objfun</Keywords>
    <Keywords name="Words3">as</Keywords>
    <Keywords name="Words4"></Keywords>
    </KeywordLists>
    <Styles>
    <WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
    <WordsStyle name="FOLDEROPEN" styleID="12" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
    <WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
    <WordsStyle name="KEYWORD1" styleID="5" fgColor="2800C8" bgColor="FFFFFF" fontName="" fontStyle="1" />
    <WordsStyle name="KEYWORD2" styleID="6" fgColor="4B00F0" bgColor="FFFFFF" fontName="" fontStyle="1" />
    <WordsStyle name="KEYWORD3" styleID="7" fgColor="004080" bgColor="FFFFFF" fontName="" fontStyle="1" />
    <WordsStyle name="KEYWORD4" styleID="8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
    <WordsStyle name="COMMENT" styleID="1" fgColor="66CDAA" bgColor="FFFFFF" fontName="" fontStyle="2" />
    <WordsStyle name="COMMENT LINE" styleID="2" fgColor="66CDAA" bgColor="FFFFFF" fontName="" fontStyle="2" />
    <WordsStyle name="NUMBER" styleID="4" fgColor="7D1919" bgColor="FFFFFF" fontName="" fontStyle="0" />
    <WordsStyle name="OPERATOR" styleID="10" fgColor="FF1919" bgColor="FFFFFF" fontName="" fontStyle="1" />
    <WordsStyle name="DELIMINER1" styleID="14" fgColor="326464" bgColor="FFFFFF" fontName="" fontStyle="0" />
    <WordsStyle name="DELIMINER2" styleID="15" fgColor="32CD32" bgColor="FFFFFF" fontName="" fontStyle="0" />
    <WordsStyle name="DELIMINER3" styleID="16" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
    </Styles>
    </UserLang>
    </NotepadPlus>

    roku eclipse highlighter default colors:
    task( 127, 159, 191 )
    comments( 102, 205, 170 )
    strings( 50, 100, 100 )
    numbers( 125, 25, 25 )
    reserved( 40, 0, 200 )
    return( 255, 25, 25 )
    entry( 50, 205, 50 )
    events( 40, 0, 150 )
    variables( 75, 0, 240 )
    functiongeneral( 225, 75, 25 )
    functionstrings( 255, 75, 25 )
    functionmath( 255, 75, 25 )
    attribcontent( 255, 140, 0 )
    attribtheme( 255, 140, 0 )
    attribhttp( 255, 140, 0 )
  • That looks very nice. I was able to get a similar result using by going to Settings>Style Configurator ..., selecting Language : VB/VBS, adding brs as a user ext., then adding in a few user-defined keywords (by selecting Style: WORD): endif void invalid.

    I'm going to try using your style for a while and see if I like it better. The only thing I would change so far would be to add "void" as a keyword.