显示在vim所有的不可见字符 [英] Showing all invisible characters in vim

查看:2059
本文介绍了显示在vim所有的不可见字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道有一些线程这个在计算器,但是当我写:在编辑器中设置列表,这似乎显示隐藏字符,但它不显示,我们有问题了code中的隐藏人物

I know there are some threads about this on stackoverflow but when i write ":set list" in the editor, it seems to display hidden characters but it doesnt display the hidden characters in the code we are having problems with.

有些时候,现在我们已经在我们的code制作了一些无形的符号,如果环路打破,我不知道这些符号是如何到达那里,除了从一些奇怪的键盘组合多已在被意外键入该code本身看起来正确的,但无形的符号打破它。

Some times now we have had some invisible symbols in our code making if loops break, i dont know how the symbols get there except from that some wierd keyboard combination much have been accidentally typed in. The code itself looks correct but the invisible symbol breaks it.

我在网上搜索关于这一点,但所有我能找到的似乎是:在另外VIM集列表命令必须改变的隐藏字符的颜色,但在这似乎显示一些隐藏字符它不显示有问题的。我们正在它看起来像一个十字架,一个看起来像手枪两个符号。我们也试图加入draw_white_space的崇高文字设定但这只是看起来像它说,但结果显示在谷歌显示隐伏人物,所以我给它一个尝试,显示,好,whitspace。

I have searched online about this but all i can find seems to be the ":set list" command in vim in addition to have to change the color of the hidden characters, but while this seems to display some hidden characters it doesnt display the problematic ones. We are getting two symbols which looks like a cross and one looks like a pistol. We have also tried to add the "draw_white_space" setting in sublime text but this only seems to display, well, whitspace like it says but the result was shown on google for showing hiden characters so i gave it a try.

我们已经能够看到那里的符号的唯一方法是用DiffMerge工具,我们一直没能看到任何其他编辑器这些符号,但我们其实一直能够符号复制到自己的文件,通过所有与工作的-f选项的grep文件的grep,但它会更容易在vim里显示的字符,但使用的是按键绑定。

The only way we have been able to see where the symbols are is with the DiffMerge tool, we have not been able to see these symbols in any other editor but we have actually been able to copy the sign to its own file and grep through all the files with the -f grep option which works, but it would be easier to display the characters in vim but using a keybinding.

人如果有什么建议?这导致我们用更多的时间调试code的问题,是一种无形的象征。

Does someone have any suggestions? This is causing us to use a lot more time debugging the code when the problems is an invisible symbol.

推荐答案

试试下面的搜索命令:

/[^ -~<09>]

(你得到的&LT; 09&GT; 由pressing tab键)。或者,如果你想摆脱那些讨厌的标签,只是:

(you get the <09> by pressing the tab key). Or if you want to get rid of those nasty tabs, just:

/[^ -~]

这会查找并突出显示任何非ASCII或控制ASCII字符。

That will find and highlight any non-ASCII or control-ASCII character.

如果您仍然有隐藏字符在那里,你可以尝试搜索之前此命令:

If you still have hidden characters out there, you can try this command before the search:

:set enc=latin1

将prevent任何奇怪的Uni code字符在code露面。

That will prevent any weird Unicode character to show up in your code.

这篇关于显示在vim所有的不可见字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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