hex + binary files
Binary files bypass text decoding. fedit renders their raw bytes as offsets, hexadecimal pairs, and an ASCII gutter, then writes edited bytes back exactly.
opening and switching views
Files detected as binary open directly in hex view. For any active buffer, run
hex, hex on, hex off, or hex toggle from the
command palette. The toggle-hex-view action can also be assigned in
~/.config/fedit/keybinds. Flipping a hex view to text warns and marks the
buffer modified when the decode is lossy — UTF-16 or BOM transcoding, invalid UTF-8, lone
carriage returns — so a save can never silently rewrite bytes from a buffer that read as
clean.
editing
- Type hexadecimal digits in the byte columns; two nibbles form one byte.
- Tab flips between the byte and ASCII panes — ASCII typing overwrites whole bytes.
- Cursor movement, selections, copy, paste, undo, and redo operate on byte positions.
-
Copy puts the spaced hex form (
74 68 69) on the clipboard; pasting hex types it back in. - Search accepts a hexadecimal byte sequence when it parses as one, otherwise literal bytes.
-
replace <from> <to>replaces every exact match as one undo step, using the same hex-or-literal interpretation. The command works in text buffers too, where both arguments are literal text.
save behavior
A binary buffer never passes through UTF-8 or line-ending conversion. Save serializes the
current byte sequence through the atomic raw-byte write path, so untouched bytes remain
byte-for-byte identical. The first save of a hex view also copies the original file to
<path>.bak — a one-time backup that a later save never overwrites.
limitations
Syntax highlighting, language-server navigation, and structural syntax selection are inert in hex view because they require decoded source text. The text and hex views share the same buffer identity, dirty state, history, and close/quit guards.