“快速而肮脏”的方法是使用find函数并激活正则表达式。
然后只搜索: \ s用于突出显示空格 \ t标签 \ n用于换行 等等
在选定的文本中,SPACE显示为点(。),TAB显示为短划线( - )。
我用 Unicode Character Highlighter ,可以显示空格和一些其他特殊字符。
Unicode Character Highlighter
通过Package Control添加它
安装包,unicode ......
如果你真的只想看到尾随空格,这个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",
如果您进入“首选项” - >“设置默认值”,则可以看到它。如果您编辑用户设置(首选项 - >设置 - 用户)并按以下方式添加该行,您应该得到您想要的内容:
{ "color_scheme": "Packages/Color Scheme - Default/Slush & Poppies.tmTheme", "font_size": 10, "draw_white_space": "all" }
请记住,设置是JSON,因此没有逗号。
如果您希望能够打开和关闭空格的显示,可以安装 HighlightWhitespaces插件
http://sublimetexttips.com/show-whitespace-sublime-text/
按Ctrl + 转移 + P
首选项:设置 - >用户
{ "draw_white_space": "all", "translate_tabs_to_spaces": true }
我有几个插件(包括Unicode Character 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]" }
我知道这是一个老线程,但我喜欢我自己的插件 循环通过空白 模式(无,选择和所有)通过单个快捷方式。它还提供View |下的菜单项空白菜单。
希望人们会发现这很有用 - 它被很多人使用:)
的 这是一个关于如何做的官方教程! 强> 的 http://sublimetexttips.com/show-whitespace-sublime-text/ 强>
像这样!
的 希望对您有所帮助! 强>