nextcloud / files_texteditor

:page_facing_up: Text editor for plaintext files
72 stars 41 forks source link

Open any file reguardless of extension #114

Open jsProj opened 6 years ago

jsProj commented 6 years ago

Not really an issue per-se, but it would be nice if i would be able to force any file to open, and with forcing a file to open use the text mode, i'm editing editor.js, but i'm not quite sure how to do it.

Psy-Virus commented 6 years ago

Hey there, I read the issues and rather than opening another one, I guess this one is mostly related to my question.

I saw that you are able to add, remove and manipulate Mimetypes in the editor.js file. The question is, will this file be overwritten on updates? Or will it be merged?

If it will be overwritten, all changes you make are obsolete as soon as there's an update. And you would have to update the Mimetypes again.

This also seems to be a repeating issue/question. Other related issues: #15; #24;

lachlan-00 commented 5 years ago

This would be good, I've got plain text files that won't open even though they're text/plain mimetypes

k4tfish commented 5 years ago

Same here and I have a lot of plain text files without extensions. Is it possible to make that working by changing the mime type config of nc?

Psy-Virus commented 5 years ago

Well, I fixed the problems with mimetypes with the following: https://docs.nextcloud.com/server/stable/admin_manual/configuration_mimetypes/index.html?highlight=mimetype

The mimetypemapping.json thingy at the bottom. After I reindexed my files, the files I added as text like ("cfg": ["text/plain"],) are opened with the text editor by default.

Actually I'm not sure if it was for cfg. But it works for all endings I configured this way.

EDIT: I placed the mimetypemapping.json right in the config folder

Psy-Virus commented 5 years ago

In my opinion, there should be a GUI version for the config. With a filter function. Should be quite easy to do. For someone who has time...

greenorca commented 4 years ago

The mime config seems to work well for specific file endings. It would be great if one could view/edit any file with the texteditor using the context menu in the regular file view (the one beside the share button, where delete, move, copy, detail functions are triggered). This would greatly improve usability for files without ending (e.g. Dockerfile).