Skip to content

ArcaneSpecs/HexEditor.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

HexEditor.nvim

Lua

Basic hex editor in neovim with byte highlighting.

Shift address lines around, edit and delete bytes, it will all work itself out on :w.

Install

{
    'ArcaneSpecs/HexEditor.nvim'
}

This plugin makes use of the xxd utility by default, make sure it's on $PATH:

  • xxd-standalone from aur
  • compile from source
  • install vim (it comes with it)

Setup

require 'HexEditor'.setup()

Use

require 'HexEditor'.dump()      -- switch to hex view
require 'HexEditor'.assemble()  -- go back to normal view
require 'HexEditor'.toggle()    -- switch back and forth

or their vim cmds

:HexDump
:HexAssemble
:HexToggle

any file opens in hex view if opened with -b:

nvim -b file
nvim -b file1 file2

Config

-- defaults
require 'HexEditor'.setup {

  -- cli command used to dump hex data
  dump_cmd = 'xxd -g 1 -u',

  -- cli command used to assemble from hex data
  assemble_cmd = 'xxd -r',
  
  -- function that runs on BufReadPre to determine if it's binary or not
  is_buf_binary_pre_read = function()
    -- logic that determines if a buffer contains binary data or not
    -- must return a bool
  end,

  -- function that runs on BufReadPost to determine if it's binary or not
  is_buf_binary_post_read = function()
    -- logic that determines if a buffer contains binary data or not
    -- must return a bool
  end,
}

Credit

About

Basic hex editing functionality for neovim.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages