How to add .bas and .frm to Notepad++?
-
When I open a .bas or .frm file (vb6), only where the text is, there is a black background, yet under Style Configurator, the VB / VBS have white set as the background color. It is ONLY where text is. I tried adding “bas frm” to the “User ext. :” field for C++, then for PowerShell, but neither had any effect.
-
By default,
.bas
is associated with the Language > F > Freenbasic. If you look in Style Configurator, it should have FreeBASIC between Fortran and GDScript:If you don’t have that entry, then your stylers.xml (or whatever theme you’ve picked) is out of date, and doesn’t have that language; that might explain why the background is not matching (because nothing is defined). If you wanted to use FreeBASIC for
.bas
files, you could openC:\Program Files\Notepad++\stylers.model.xml
, and then copy the FreeBASIC section into your activestylers.xml
(usually in%AppData%\Notepad++\stylers.xml
) or into your theme XML of choice. Restart Notepad++, and FreeBASIC should now be in your Style Configurator. (But you only need to bother with these steps if you want to use FreeBASIC syntax highlighting. If you want to treat.bas
and.frm
as Visual Basic, then see the next paragraph.) Alternately, maybe you’ll see FreeBASIC listed, but it will show background colors that aren’t as you expect – in which case, you could change the colors there, if you wanted.But you said you want
.bas
to apply to Visual Basic; to do that, you would change the VB / VBS language’s User ext.: settings. If you have it set tobas frm
, like in my screenshot below, then .bas and .frm files will default to using the VB/VBS color settings.If you already have a .bas file open, it won’t immediately take effect (because Notepad++ decides on filetype when the file is first opened, so it will have loaded that file with
.bas
associated with FreeBASIC). Thus, if you close the file then immediately open it again (Ctrl+W
,Ctrl+Shift+T
), or open a new .bas that isn’t already open, Notepad++ will know to treat it as Visual Basic code rather than FreeBASIC code. And every one you open from now on will also follow Visual Basic syntax highlighting.