My first thought too. Then I looked and saw it was nice, and then I noticed it's by sharkdp. He really has a knack for improving on things you thought were fine (fd and bat being other examples).
edit: Added in this commit: https://github.com/sharkdp/hexyl/commit/91a119f4537f746045c8...
I wonder though, whether I can colour code 'blocks' to differentiate them? One of the things I seemed to do a lot in hex editors was to check out the differentiation in, for example, 72 byte blocks of data, so to be able to delineate 72 byte blocks in different colours in the hex editor would make it easier to see where each block starts/ends.
00006980: 0000 0000 0000 0000 0000 0000 0000 0000line number = floor(X/(bytes/line)) + 1
column offset = X % (bytes/line) + 1
Or it could just print byte numbers instead of line numbers.
I've never thought of xxd as being anything but a "Vim thing".
That it had its own history (1990-1998) before being pulled into Vim is a TIL for me.
Here you go:
https://github.com/vim/vim/tree/master/src/xxd
There might still be other versions of this out there, but I suspect most OS distros pick up xxd by way of packaging Vim.
So if you work on some other xxd, you're probably in a dead fork.
The man page is also from Vim:
https://github.com/vim/vim/blob/master/runtime/doc/xxd.1
My first patch to xxd, if I were to work on it, would be to fix the man page to indicate clearly that it's the xxd bundled with Vim.
This also solves the problem of moving the cursor and drawing a screen in general.
If anything, I've found doing this works better then trying to muck around with ncurses, which often gets actively mislead by incorrect terminfo entries.
I get the idea behind your question, but it irks me a bit since it implies a sort of responsibility to contribute to an existing piece of software. This is a net positive of course, but the beauty of open source is the freedom to work on the things you want to work on.
The border lines don't help much either and seem more like decoration; addresses to the left and an indexing header on the top, like the traditional "canonical" hexdump format, would be far more useful.
I did use it religiously for a long, long time; then tried without for a week and never went back.
It's not like telling the difference between string literals and keywords was ever a major issue for me. I guess it could help short term when learning a new language, but I'm pretty sure it slows down overall progress.
Slow compiles have the same effect for me, I get pushed out of flow and into reactive mode.
The only way to write good code is to be proactive, and any features that interfere with that process are worse than whatever "problems" they "solve".
This is nice! I like the colorization a lot -- it's like with source code, you don't realize how much you rely on the colors until you get a new computer and need to download syntax definitions for your editor again. Only feature I really think is missing is line numbers.
Nicely done!