In Notepad ++ set background color for file type

When different types of files are opened at the same time, for example .html, .css and regular .txt files in Notepad ++, is it possible to have a different main background color for each file type?

Whenever I change the background color for any theme, the type of language, the default styles and, of course, the global redefinition, everything in the style configurator, each tab and document type reflect a change in the background color.

Each language has its own set of color specifiers in the Style Configurator. The text color and syntax highlighting colors seem to remain intact, but the main background color seems to be global, one size fits the whole thing?

What if the text files are always a white background with black text, but all .html files are a black background with white text - and each of them is open at the same time?

I spent too much time WAAAAY with intellectual trial and error and research. Maybe I'm trying to do the impossible?

+4
source share
2 answers

You cannot do this for every file.

You can do it based on the language, but there is no redefinition at the language level (the “DEFAULT” color record is not taken into account), as well as for redefinition at the application level (the record “Global redefinition”), This means that you must set the same background color manually in all individual color entries for a given language. It also means that if you want to change the background color ... you must change it for all the individual entries for the language.

In addition, since Notepad ++ uses the syntax in the language, this means that if you have an internal stylesheet in the HTML file and you have different background colors for HTML and CSS, you will see two background colors within the same file . It is not possible to specify a different color scheme for CSS or JavaScript embedded in HTML.

+4
source

Open your n ++ installation folder, go to the Themes folder, open the widely used theme file (my is khaki.xml). Locate the LexerType you want to change (i.e. Tcl), add the line as shown below immediately after the <LexerType ...> node:

<WordsStyle name="Default Style" styleID="32" fgColor="5F5F00" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" /> 

Re-run n ++, go to the “Style Configurator”, select your style, and now that you have set the background color to the Default Style , the whole background (from the text) will change.

Greetings.

0
source

All Articles