Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hexr icon

CONTRIBUTORS FORKS STARS

CRATES.IO DOWNLOADS

Minimal terminal hex editor written in Rust

hexr preview

Tip

Русская версия: README-RU.md

✨ Features

  • Interactive hex + ASCII editing in terminal
  • Standard and Vim keymaps
  • Two view styles: pretty and simple
  • Theming support
  • Open from file or from stdin ([command] | hexr)
  • Undo/redo, search, selection, copy/cut/paste

📦 Installation

🦀 Install from crates.io

cargo install hexr

This installs the latest published release from crates.io into your Cargo bin directory

⚙️ Install from source

git clone https://github.com/WhoSowSee/hexr.git hexr
cd hexr
cargo install --path .

The command above builds hexr and places the binary into the Cargo bin directory (usually ~/.cargo/bin)

🛠️ Build

git clone https://github.com/WhoSowSee/hexr.git hexr
cd hexr
cargo build --release

🚀 Usage

# Empty buffer
hexr

# Open file
hexr sample.bin

# Read from stdin
xxd -r -p dump.hex | hexr

🧩 CLI options

-h, --help
-v, --version
-t, --theme <name>

-k, --keymap <standard|vim>

-w, --view <pretty|simple>

Available themes:

terminal, kanagawa, tokyonight, catppuccin, gruvbox, material-ocean, nord, monokai

Example:

hexr --theme nord --keymap vim --view pretty sample.bin

🎹 Keybindings

🧭 Standard & Vim

  • Arrow keys: move cursor
  • Esc: abort selection / reset soft input state
  • Backspace: delete previous byte or selection
  • Delete: delete current byte or selection
  • :: enter command
  • /: search
  • n N: jump to next/previous match
  • [ ]: increase/decrease number of columns
  • Ctrl+G: show file name and current position
  • Ctrl+L: redraw screen

Note

A new empty buffer switches to insert mode on the first typed byte. Existing files open in replace mode; to append at EOF, switch to insert mode first (Ctrl+N in standard, i in vim).

🧰 Standard keymap

  • Tab: switch between hex and ascii input
  • Ctrl+Q: quit
  • Ctrl+W Ctrl+E: jump to start/end of screen/file
  • Ctrl+K Ctrl+J: scroll up/down one page
  • Ctrl+D: delete current byte or selection
  • Ctrl+N: switch between replace and insert modes
  • Ctrl+S: save (prompts filename for unnamed buffer)
  • Ctrl+F: search
  • Ctrl+Z Ctrl+Y: undo/redo
  • Ctrl+C Ctrl+X Ctrl+V: copy/cut/paste
  • Ctrl+P: paste and move cursor
  • Ctrl+T: start/stop selection
  • Ctrl+A: select all
  • Ctrl+O: suspend editor (fg to continue on Unix)
  • + -: increment/decrement current byte

⚡ Vim keymap

  • t: switch between hex and ascii input
  • q: quit
  • h j k l: move cursor
  • i: switch between replace and insert modes
  • u r: undo/redo
  • v: start a selection
  • x: delete current byte or selection
  • s: substitute current byte or selection
  • y: copy current byte or selection to clipboard
  • p: paste
  • P: paste and move cursor
  • Ctrl+W Ctrl+E: scroll up/down one page
  • g G: jump to start/end of screen or file
  • ^ $: jump to start/end of current line
  • Ctrl+Z: suspend editor (fg to continue on Unix)
  • Ctrl+A Ctrl+D: increment/decrement current byte

🧾 Command mode (:)

  • q - quit
  • q! - force quit without save check
  • w [filename] - save
  • wq [filename] - save and quit
  • x [filename] - save and quit
  • colors y/n - toggle colors
  • <offset> - jump to offset (hex, dec, oct formats supported)

🔍 Search mode (/)

  • /x <hex-bytes> - search hex bytes
  • /s <text> - search UTF-8 text
  • /w <text> - search UCS-2 text

catppuccin

© 2026-present WhoSowSee

LICENSE

About

Minimal Rust hex editor for editing binary files in the terminal

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages