How do I change the color of a text before a specific character?



  • Good, as I do so that when writing a text and at the end have this sign/character | the text looks like a color.



  • Welcome, @Roger-TX , to the Community Forum.

    I am having trouble interpreting your question. I can read it two different ways, which have different answers.

    How do I change the color of a text

    Depending on what you mean, you don’t. Notepad++ is a plain-text editor, and plain-text doesn’t embed color information.

    That said, Notepad++ is a programming-language-“aware” editor: it recognizes which programming language (or other text format) your file is, based on either the filename extension, or by whatever programming language you manually select from the Language menu. So if it recognizes your file as being an XML file or C++ source file (as two examples), it will apply syntax highlighting appropriate to that language.

    when writing a text and at the end have this sign/character | the text looks like a color.

    That sounds like Notepad++ has selected a particular Language, and is applying its syntax highlighting for that language. But some filename extensions apply to more than one Language in real life, and Notepad++ may be set up for the wrong language for your use-case, thus apply what looks like strange formatting to you.

    If you think that’s the case, you can either look at the lower-left corner of the status bar (which, if the status bar is wide enough, will indicate the Language selected), or you can look at the Language menu, for whichever entry has the bullet indicator (which may be in one of the alphabetical sub-menus).

    If the Language selected doesn’t match what language your file really is (or if the real language of your file is not listed in the Language menu), then you can either select the right language, or select Language > N > Normal Text (or on some configs, just Language > Normal Text).

    If you want to automatically apply syntax highlighting specific to your file’s language, and that’s not happening, then please let us know: 1) what file extension you have, 2) what language Notepad++ thinks it is, 3) what language you think your file is, 4) if it’s an obscure language, maybe point us to a resource describing the language, or let us know what common language it is similar to.



  • It is a text that I must correct, it is not something that I must program, it is only that the text that I have to correct is after this character and I want to know if the text that is before said character is of a specific color to have a better visualization…

    PD: Sorry if there is something wrong written, I do not speak English and I am using the translator.



  • It is a text that I must correct, it is not something that I must program,

    Notepad++ uses the concept of Language to refer to the underlying “type” of file – whether it is a programming language (like Perl or Python or C# or shell scripts), or markup (like HTML or XML). or a text-based data file (like JSON), or config file (like INI or XML or YML), or some other text format (like Markdown or normal text)

    Notepad++ will syntax highlight many types of files.

    Do you know what type of file you are trying to edit? Is it in a common format (like XML, JSON, INI, YML, Markdown, or something else), or some proprietary format? If you tell us what format, we might be able to point you to a syntax highlighter (either builtin or a user-defined language UDL) that you can use to properly format it… or if you tell us something about the syntax of the file, and what the typical file extension is for this type of file.

    PD: Sorry if there is something wrong written, I do not speak English and I am using the translator.

    Thank you for posting in English – the majority here speak English, or are good at using translators to get the basics of a discussion that is in English. However, for your convenience, it is also considered reasonable to post both in your native tongue and in English (providing the latter through a translator)… If you include both, if there is someone who is able to understand your native tongue better than the translator service you used, you might get a better answer. (in such a case, people will often answer in English and do you the honor of also translating back to your native language, to keep the discussion readable both for you and for the many users on this site who don’t know your native language)



  • Thank you for answering my questions, I have found an appropriate style that suits what I am looking for. (TeX)

    The file is an INI text, I just wanted to translate its contents easily by finding the correct words … Once again thanks for responding and being aware.


Log in to reply