I have seen other answers, but after following instructions my default editor is LibreOffice, even for txt files.
I want to have Sublime Text 3 as default editor for all text related files: txt, makefile, cpp, h, md, etc.
My default list is full of sublime-text.desktop, and does not contain any libreoffice-writer.desktop. However, all txt files are opened in LibreOffice Writer. The only extension that is opened in sublime text after double clicking is cpp. I can open sublime-text as usual (and also via subl in command line) and can open files from it, but I want to open text files in Sublime Text by double clicking on them. The version of Sublime Text is 3126. Ubuntu is 16.04.
How can I set sublime text as default editor and why LibreOffice writer opens text files?