Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime Text 3 disable internal image viewer

Tags:

sublimetext3

If I open an image in Sublime Text 3 it will show the actual image. I want to see the file in plain text so I can switch to the HEX Viewer.

Is there a way to switch to plain text view or disable the internal image viewer in Sublime Text 3?

Btw. I know the workaround is to rename the file extension, then it will open in plain text but I'd like to do it without renaming the extensions.

like image 255
marekb Avatar asked Sep 26 '14 09:09

marekb


2 Answers

Just add to filename ".hex", for example: "image.png" to "image.png.hex" and open by Sublime Text.

like image 80
Razieru Avatar answered Nov 02 '22 06:11

Razieru


Yes, its possible to disable the image viewer, but its kinda weird, and in my opinion its not a good idea.

As you have already said, Sublime Text image viewer works looking at the file extension, so, if you want to disable the image viewer, you just have to change the extensions list that Sublime Text image viewer uses.

But, ¿where are the extensions list stored? (here comes the weird part): the list is stored in the Sublime Text executable. So you can disable the image viewer for an extension (or for all extensions) editing the list with an hexadecimal editor (if you're using linux you could use gHex, but first of all close all opened ST instances and make a backup just in case). In order to find the extensions list in the executable make a search for the text jpeg (don't search for png as it appears in other parts of the executable) and you'll see the list with the extensions supported. Switch a couple of bytes of the extension (e.g: jpeg to pjeg, never remove bytes!), and save. Now, if you open a jpeg file in ST you'll see the editor and not the awesome image viewer.

like image 13
sergioFC Avatar answered Nov 02 '22 06:11

sergioFC