Trying to find a linefeed within a binary file using vim -b
, but any attempt at entering that byte value (e.g. control-v control-j, control-v 010, control-v u000a) turns into a NUL (^@
) instead.
I've tried using vim 8.2.2029 and neovim v0.5.1 on MacOS Big Sur 11.6 along with vim 8.1.2269 in Ubuntu 20.04, observing the same behavior in each.
:h keycodes
this is apparently by design<NL> linefeed CTRL-J 10 (used for <Nul>)
. Wonder why...:%!xxd
) and search for the hex value. Then undo to reverse. (Do NOT save! :)vim -b
or:edit ++bin
; otherwise you are likely to corrupt the file. My Hex plugin has some conveniences for that, but you still have to remember binary mode<Nul> zero CTRL-@ 0 (stored as 10) *<Nul>*