Friday, January 29, 2010

Re: search for null

On 2010-01-29, Ron Olson wrote:
> Hi all-
>
> Is there a particular way I can use to search for instances of null
> (ascii 0, hex 0x0) in a file? I haven't come up with a way to do so,
> yet there is clearly a null in my file as moving over it shows ascii 0
> and hex 0x0, I just want to find/highlight all the others.

One way is to put the cursor on one of the nulls, type

yl

to yank the null, then type

/^R"

to search for the yanked character, where ^R means Ctrl-R.

Another way is to type

/^Vx00

where ^V means Ctrl-V. That will search for the character whose hex
value is 00.

Regards,
Gary


--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment