【发布时间】:2023-04-08 03:11:01
【问题描述】:
Sublime Text 如何显示不可打印的字符(我对 SPACE 和 TAB 感兴趣)?
【问题讨论】:
Sublime Text 如何显示不可打印的字符(我对 SPACE 和 TAB 感兴趣)?
【问题讨论】:
在所选文本中,Space 显示为 middle dot (·),Tab 显示为长破折号 (—)。
【讨论】:
'"translate_tabs_to_spaces": true' ofcourse
Ctrl + A 选择所有内容,瞧!您神奇地看到了您所描述的所有制表符和空格字符!
【讨论】:
http://sublimetexttips.com/show-whitespace-sublime-text/
Ctrl+Shift+P
首选项:设置 -> 用户
{
"draw_white_space": "all",
"translate_tabs_to_spaces": true
}
【讨论】:
我有几个插件(包括 Unicode Character Highlighter),但唯一能找到今天对我隐藏的字符的插件是 Highlighter。
您可以通过粘贴自述文件中的文本来测试它是否有效。
作为参考,给我带来麻烦的角色是
。
要进行完整性检查,请在包含不可见字符的文本范围内点按右箭头键,然后您需要右箭头键两次才能移过该字符。
我还在使用以下自定义正则表达式字符串(我没有完全理解):
{
// there's an extra range in use [^\\x00-\\x7F]
// also, don't highlight spaces at the end of the line (my settings take care of that)
"highlighter_regex": "(\t+ +)|( +\t+)|[^\\x00-\\x7F]|[\u2026\u2018\u2019\u201c\u201d\u2013\u2014]"
}
【讨论】:
xxd,输入,然后粘贴你的字符串
我知道这是一个旧线程,但我喜欢我自己的插件,它可以通过单个快捷方式cycle through whitespace 模式(无、选择和全部)。它还在 View | 下提供菜单项。空白菜单。
希望人们会发现这很有用 - 很多人都在使用它:)
【讨论】:
:-)。
一种“又快又脏”的方法是使用 find 函数并激活正则表达式。
然后只需搜索: \s 用于突出显示空格 \t 用于制表符 \n 换行 等等
【讨论】:
我使用Unicode Character Highlighter,可以显示空格和其他一些特殊字符。
添加这个,包控制
安装包,unicode ...
【讨论】:
如果您希望能够打开和关闭空格的显示,您可以安装HighlightWhitespaces plugin
【讨论】:
如果你真的只想看到尾随空格,这个 ST2 插件可以解决问题:https://github.com/SublimeText/TrailingSpaces
【讨论】:
要查看空白,设置如下:
// Set to "none" to turn off drawing white space, "selection" to draw only the
// white space within the selection, and "all" to draw all white space
"draw_white_space": "selection",
如果你进入 Preferences->Settings Default 就可以看到它。如果您编辑您的用户设置(Preferences->Settings - User)并按照以下添加行,您应该得到您想要的:
{
"color_scheme": "Packages/Color Scheme - Default/Slush & Poppies.tmTheme",
"font_size": 10,
"draw_white_space": "all"
}
记住设置是 JSON,所以没有尾随逗号。
【讨论】: