Can you recommend a free console hex/ASCII editor with a decent cut function (which would allow to cut blocks e.g. from the middle of a file)? Something which wouldn't be blue all over the place like Norton Commander
Emacs is a text editor with a lot of features and enormous extensibility.
Emacs has a built-in mode to edit binary file called Hexl mode. However, it only supports overwriting, which is the limitation you want to overcome.
There's a package (plugin) called nhexl-mode which solves this problem. You can install it through Emacs's package manager (menu “Options” → “Manage Emacs Packages”). Nhexl-mode starts in overwrite mode by default, but you can switch to insert mode by running
M-x binary-overwrite-mode RET. Even in overwrite mode, deleting works.
You can put the following code snippet in your init file (
~/.emacs) to bind the Insert key to toggling overwrite mode in nhexl-mode. (It's a bit more complex than ordinary key bindings because unlike most other modes, nhexl-mode doesn't have a specific keymap by default.)
(unless (boundp 'nhexl-mode-map) (defvar nhexl-mode-map (make-sparse-keymap) "Keymap used when `nhexl-mode' is active.")) (define-key nhexl-mode-map [insert] 'binary-overwrite-mode)
This may also be of interest if you use nhexl-mode.