I use notepad++ from Wine.

I want to set Notepad++ as one of the default editors. I tried to set it by right-clicking on a file, then Open With. But I did not see Notepad++ in the resulting list (even after clicking on Choose Other Programs).

  • 1
    There are plenty editors for *nix systems, much better than Notepad++ and other win stuff. Try Geany, and forgot about crappy win apps. – Jakub Rakus Jun 4 '16 at 18:17
  • As @lustful-rat said, a good alternative would be Gedit. – user423626 Jun 4 '16 at 18:20
  • People suggesting gedit or geany have never used Notepad++ heavily. Notepad++ is packed with features that those editors don't have. – Trevor Jun 18 '20 at 5:46

You can use the mimeopen command

Using a terminal go to a folder containing some extension you want to open with notpadd++(here i'm testing for txt files)

mimeopen -d file.txt

You will get a popup menu, where you can see some options, if you don't find notepad++ with them choose other and indicate your notepad++ .

Also you may interested in reading Change all associations from gedit to another application


I guess the best advanced option gives you Ubuntu Tweak tool.

enter image description here

Here you can set your default (desired) app to any format/extension.

More detailed described here


Instead of using Notepad++ through Wine, you can directly install Notepadqq in Ubuntu. You can consider it as Ubuntu version of Notepad++. Notepadqq can be installed as follows:

sudo add-apt-repository ppa:notepadqq-team/notepadqq
sudo apt-get update
sudo apt-get install notepadqq
sudo apt-get install notepadqq-gtk
  • @Aadishri Thanks for going in-depth of my answer but your link is giving a 404 error. There is an extra angular bracket '>' at the end. – Dhaval Simaria Jan 20 '17 at 7:37
  • 1
    Notepadqq has an annoying bug github.com/notepadqq/notepadqq/issues/336 – Aadishri Jan 20 '17 at 7:52
  • 2
    Notepadqq lacks features, not least of which the Plugin Manager. – Cees Timmerman Jul 13 '17 at 18:57
  • 2
    This does not answer the question – Stack Underflow Dec 1 '17 at 19:26

I have followed the below steps and that exactly made me to fix this issue and made Notepad++ as the default editor in Ubuntu.

  1. Once after installing Notepad++ using WINE, copy the file "Notepad++.desktop" under, "/.local/share/applications/wine/programs/Notepad++"

  2. We need to paste the copied file "Notepad++.desktop" in the below path "/usr/share/applications"

NOTE: The applications folder is write protected by default. So open the terminal and navigate to "/usr/share" path and execute the following command.

sudo chmod -R 777 applications

Once after copying the "Notepad++.Desktop" file, revert back this permission change made by the following command.

sudo chmod -R 555 applications

  1. Now, we need to make changes in the configuration file that exists in the gnome folder [which is a subfolder inside "etc" folder]

Note: Again here, the gnome folder is write protected by default so, open the terminal and navigate to "/usr/share" path and execute the following command.

sudo chmod -R 777 gnome

  1. Now open the "defaults.list" file inside gnome folder and replace gedit by Notepad++. You can also individually set Notepad++ as default application for certain type of file.

For example, if you want to edit only plain text files in Notepad++, n the "defaults.list" file find for "text/plain" and you will get a line as follows,


Now replace the gedit bu Notepad++ so that, it would set the Notepad++ as default application for the plain text. The modified line should look like,


Now, SAVE the file once this change is done and close the file.

[You can find a new file name defaults.list.xxxx has been created, which is nothing but the backup of old settings and you can very well delete it. Please make sure you are not deleting the other two files namely : "defaults.list.dpkg-old" and "menus.blacklist" ]

Once doing the required changes, revert back the permission change made earlier for the gnome folder by the following command.

sudo chmod -R 555 gnome

  1. That's it... You have made Notepad++ as the default editor in Ubuntu. It worked for me and I hope this post helps.

Right click filetype in question (e.g. txt), and do Open With > Other Application...

Click in the Enter a custom command field below the usual list of applications. Enter:

wine C:\\windows\\command\\start.exe /Unix /home/linuxusername/.wine/dosdevices/c:/users/Public/Desktop/Notepad++.lnk

...Now click button Set as default.

Alternatively instead of Open With etc. you can use mimeopen -d yourfile.txt in Terminal, and you will get similar Use command: prompt into which you can past the above command.

You should now be able to double-click the filetype in question to open it - yay!


  • This assumes you installed Notepad++ in wine with desktop shortcut, otherwise adapt your path.

  • linuxusername is of course to be replaced with your user name.

  • Public appears to be the default Windows user name created by the Wine install.

  • This works under pure Debian also.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.