Setting a font specific to .txt files
I use Notepad++ to edit .txt files in addition to editing code, and I would like to use a monospaced font for all files except .txt files.
If I had a specific language I wanted to use a different font for, I could use the Style Configurator to set the font for that language. But I can’t find a way to set the font for .txt files. How can I do this?
Style Configurator > Global Styles > Default Style is the style used for normal text (.txt) or any unknown file-types.
@PeterJones I’m familiar with that feature, but I would like to use monospaced font for unknown file types and a specific font only for .txt files if possible.
I would like to use monospaced font for unknown file types and a specific font only for .txt files if possible.
That’s not the way that Notepad++ works. All unknown file extensions are interpreted by Notepad++ as “Normal Text”, and all Normal Text, whether it ends in
.txtor not, get the Default Style applied. That’s the way Notepad++ was designed.
You might be able to get your desired behavior by creating a User Defined Language (UDL) associated with the
.txtextension, and use the UDL dialog to set the font for just
.txt. (This would override
.txtso it’s using the UDL lexer, and is no longer considered “Normal Text”)
- official UDL overview: https://npp-user-manual.org/docs/user-defined-language-system/
- UDL details: https://ivan-radic.github.io/udl-documentation/