VIM 如何搜索 <XX>单字节表示 [英] VIM How do I search for a <XX> single byte representation

查看:24
本文介绍了VIM 如何搜索 <XX>单字节表示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我从 Word 文档中剪切并粘贴到 VIM 中时,引号会被转换为 a-circumflex 后跟 <99>,其中 <99> 是单字节表示.(我知道这是因为当我移动到它时,输入一个 'l' 会将我移动到所有四个字符上).

When I cut and paste from a Word document into VIM, quotes get translated into a-circumflex followed by <99>, where the <99> is a single byte representation. (Which I know because when I move to it, typing a single 'l' moves me right to the over all four characters).

我想做搜索和替换,我知道使用 control-K a> 可以找到 a-cirumflex 有向图,但我不知道如何搜索 <99>,并搜索文字/<99> 不起作用.

I want to do search and replace, and I know enough to find the a-cirumflex digraph using control-K a>, but I can't figure out how to search for the <99>, and searching for the literal /<99> doesn't work.

所以我真的有两个问题:

So I really have two questions:

我应该在 vim 中咨询什么帮助主题以了解 <99> 是什么类型的野兽(因为它似乎不是一个有向图)(或者它可能是一个有向图并且我遗漏了一些东西)?

What help topic should I consult in vim to learn about what sort of a beast the <99> is (since it doesn't seem to be a digraph) (or maybe it IS a digraph and I'm missing something)?

如何搜索由 <99> 表示的单个字符?

How do I search for a single character represented by <99>?

推荐答案

试试这个:

将光标放在字符上,输入ga,您将看到该字符的十六进制表示,然后您可以将其替换为:

Put your cursor over the character, type ga and you will see the hexadecimal representation of the character, then you can replace it with:

:%s/\%xNN//g

:%s/\%xNN//g

其中 NN 是字符的十六进制代码.

Where NN is the hex code of the character.

这篇关于VIM 如何搜索 &lt;XX&gt;单字节表示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆