Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to prevent Sublime Text from previewing binary files inside the text editor?

Tags:

sublimetext2

As the title suggests, I would like to find out if there's a way to prevent ST2 from opening binary files when I click on them. For example when I click on an image, there's no point displaying the hex representation inside the text editor.

One additional note: I'm not interested in hiding binary files from the sidebar.

like image 376
Panos Spiliotis Avatar asked Jun 29 '12 15:06

Panos Spiliotis


People also ask

What happens when you open a binary file in a text editor?

If you open binary data (such as an image file) in a text editor, much of it won't make sense, because it does not fit your chosen interpretation (as text). What you call text is a subset of the possible file contents: Data that in a given character set translates to readable characters.

How do I read a binary file in sublime?

Open a session in Terminal, and use head -1 <path_to_your_file> to open the file. It'll read what it thinks is the first line and display it in the window. Or, instead, use file <path_to_your_file> to analyze the file and it'll tell you whether it thinks it's ASCII text, binary, or some other type.

Is Sublime a text editor or IDE?

Sublime Text editor is used as an Integrated Development Editor (IDE) like Visual Studio code and NetBeans.


1 Answers

Files containing null bytes are opened as hexadecimal by default In your User or Default Settings file:

"enable_hexadecimal_encoding": false 
like image 101
Steven Teo Avatar answered Sep 28 '22 00:09

Steven Teo