ChatGPT解决这个技术问题 Extra ChatGPT

How to change background color in the Notepad++ text editor?

Does anyone know how to change the background color, font size, and other appearance-based settings in Notepad++? The default is white but I am trying to change it into a dark gray or something else.

answer for new version (8) is recent ; has less votes: stackoverflow.com/a/68060428/54506

t
triforceofcourage

Go to Settings -> Style Configurator

Select Theme: Choose whichever you like best (the top two are easiest to read by most people's preference)


Recent versions require themes to be placed in [NPP-INSTALL-FOLDER]\themes or %APPDATA%\Notepad++\themes. If you use the [NPP-INSTALL-FOLDER] location, and NPP is installed by default to %ProgramFiles%, ensure Notepad++ runs with Administrator privileges to make changes to the theme.
There are 4 dark themes near the top of the list in 2nd to 5th place and more below. No installation needed for these. v7.9.5
An update changed the theme folder from the Notepad++ install folder to AppData. See my answer for more info.
S
Steven

You may need admin access to do it on your system.

Create a folder 'themes' in the Notepad++ installation folder i.e. C:\Program Files (x86)\Notepad++ Search or visit pages like http://timtrott.co.uk/notepad-colour-schemes/ to download the favourite theme. It will be an XML file. Note: I prefer Neon any day. Download the themes from the site and drag them to the themes folder. Note: I was unable to copy-paste or create new files in 'themes' folder so I used drag and that worked. Follow the steps provided by @triforceofcourage to select the new theme in Notepad++ preferences.


why does no theme support JSON? damn I just want to invert the normal one or something to keep syntax highlighting for ALL languages...
M
Martin

There seems to have been an update some time in the past 3 years which changes the location of where to place themes in order to get them working.

Previosuly, themes were located in the Notepad++ installation folder. Now they are located in AppData:

C:\Users\YOUR_USER\AppData\Roaming\Notepad++\themes

My answer is an update to @Amit-IO's answer about manually copying the themes.

In Explorer, browse to: %AppData%\Notepad++. If a folder called themes does not exist, create it. Download your favourite theme from wherever (see Amit-IO's answer for a good list) and save it to %AppData%\Notepad++\themes. Restart Notepad++ and then use Settings -> Style Configurator. The new theme(s) will appear in the list.


plus 1 to your answer for making others life easier
Not quite right. In the latest version (7.8.4, early 2020), you can place themes in either [NPP-INSTALL-FOLDER]\themes or %APPDATA%\Notepad++\themes. Not sure which is "better"...
@AlainD %AppData% folder for local user only, Install folder for all users. Not everyone has access to the install folder, therefor you can always use the %Appdata% folder
K
Karol Zlot

From version v8 released 2021-06-07 Notepad++ has additional Dark Mode option.

To enable it go to Settings -> Preferences -> Enable dark mode

https://i.stack.imgur.com/Pzq7i.png

Effect:

https://i.stack.imgur.com/3TJlq.png

Next step: Go to Settings -> Style Configurator

Select Theme: Choose whichever you like best (over half of styles here are dark, but each is different).

Hint: click on theme list and use keyboard arrows 🔼 and 🔽 to switch between themes and test all of them.

https://i.stack.imgur.com/q7aQg.png

Effect after all steps (Obsydian theme here):

https://i.stack.imgur.com/DrhL1.png


Now (with release of v8) this is the correct answer. ... but Stack Overflow does not handle questions that have answers that vary over time, so this answer will languish at the bottom :(
M
Mahi

If anyone wants to enable dark mode, you may follow the below steps

Open your Notepad++, and select “Settings” on the menu bar, and choose “Style configurator”.

Select theme “Obsidian” (you can choose other dark themes)

Click on Save&Colse

https://i.stack.imgur.com/9KeL3.png


how can i add Obsidian if it's not there??
c
ckrugo

Notepad++ changed in the past couple of years, and it requires a few extra steps to set up a dark theme.

The answer by Amit-IO is good, but the example theme that is needed has stopped being maintained. The DraculaTheme is active. Just download the XML and put it in a themes folder. You may need Admin access in Windows.

C:\Users\YOUR_USER\AppData\Roaming\Notepad++\themes

https://draculatheme.com/notepad-plus-plus


R
Rida Shamasneh

I have just installed the latest version Notepad++ website (currently it is v8.1) which provides an explicit dark mode setting. Go to "Setting" -> "Preferences..." -> "Dark Mode" -> check the "Enable dark mode" tick box. The editor might need to be restarted to take effect completely. https://notepad-plus-plus.org/downloads/


Y
Yodawgz0

If you are not able to add the theme , a workaround is that go to

USER/Appdata/LocalRoaming/Notepad++

make sure you save whatever the data is there in stylers.xml as back up before

There you will find a stylers.xml you can edit that only , with any xml format you need. ( https://raw.githubusercontent.com/dracula/notepad-plus-plus/master/Dracula.xml )

Sometimes even after adding the file , notepadd++ doesn't pick up the theme To revert back just edit back stylers.xml with the backup file.

After restarting it , you can see notepad ++ has taken that style as default