Hex Editor for binary files
Is your feature request related to a problem? Please describe.
Rust, as a systems language, is often used to read and write binary data. In the process of building these projects, users might need to read a crash log, open a hex dump, or reverse engineer a compiled program. All of these use cases require some kind of hex editor. Further, having a hex editor gives us an easy fallback for any unrecognized or impossible to display files types.
Describe the solution you'd like Something that allows the viewing of both the raw hex, the ASCII characters associated with them, and navigation / selections across both simultaneously. I am unsure about manipulations, I do not have experience with hex editors myself.
Describe alternatives you've considered Use an external program, and simply ignore unrecognized files.
Screenshots Here's what VSCode's hex editor looks like:
As a temp solution, I've been using nushell's hex viewer in the Zed terminal:
Not a fan of VSCode's editor which shows spaces between characters in the decoded text view, but would love to have an hex view in Zed :)
As a temp solution, I've been using nushell's hex viewer in the Zed terminal:
![]()
How do you do that? :) Doesn't seem to work for me:
❯ 〉open foo.png | first 100 Error: nu::shell::only_supports_this_input_type (link)
× Input type not supported. ╭─[entry zed-industries/zed#5381:1:1] 1 │ open foo.png | first 100 · ──┬─ ──┬── · │ ╰── only list, binary or range input data is supported · ╰── input type: raw data ╰────
@warpdesign you can use open foo.png | into binary | first 100 😉
Coming from vscode, the hex editor has some long standing issues which are worth thinking about in advance:
- Lack of support for a diff view - hopefully zed-industries/zed#4523 can be done in an editor agnostic way, comparing binary files is hard because there are no obvious way align them like lines in a text file, there seems to be dozens of niche existing tools which are worth looking at the implementations of (VBinDiff seems to be pretty popular, I tried it on it doesn't seem to support alignment at all and just compares bytes in the same positions, I also tried biodiff which implements multiple algorithms for alignment and is written in rust so it might be a good resource, it also has hexagex which are a regex variant designed for binary data which sounds really cool)
- apparently it also doesn't support inserting and deleting because of limitations of the data model and ui
hexyl running it zed terminal window looks good too.