hex.nvim icon indicating copy to clipboard operation
hex.nvim copied to clipboard

refactor: Rewrite core logic and restructure

Open yilisharcs opened this issue 2 months ago • 0 comments

At first I wanted to stop an extra undo entry from being created. But, I didn't have a good night's sleep so upon taking a peek at this repo, I couldn't keep track of the code in my head. So I ended up rewriting it.

Sorry.

I tried to control the undolevels for that but something in my approach was causing nvim to hang, so I rewrote the logic in lua. Ended up also creating persistent undo trees for xxd files, enabled by said rewrite.

Other goodies include:

  • Autocommand to block characters that aren't 0-9a-fA-F (Addresses #17)
  • Autocommand to prevent the cursor from moving off the bytes section
  • Use a vim.g table to store config options (Addresses #29)
  • A prettify function to, well, prettify the xxd output
  • An editorconfig file
  • A (barebones) checkhealth module

By the way, I only realized you were already rewriting this plugin when I was 80% done, but I couldn't leave business half-finished. I do hope the code here may be of help in any way. I like this plugin.

yilisharcs avatar Oct 21 '25 23:10 yilisharcs