这很烦人,我似乎无法弄清楚为什么。

如果您仍然对上述建议的解决方案有疑问(使用 anaconda lint):
通过文件菜单在用户定义的 Anaconda 设置文件 Anaconda.sublime-settings 中完全禁用 linting:Sublime > Preferences > Package Settings > Anaconda > Settings – User:打开文件时,只需键入以下内容并保存即可; -)
{“anaconda_linting”:假}
至少,它解决了我的问题。祝福(债务人)<><
看起来你已经安装了SublimeLinter。它突出显示错误和警告。
在 sublimetext 3 中为当前文件禁用 Annaconda linting:
Anaconda: Disable linting on this file并按回车Anaconda: Enable linting on this file禁用 linting 在会话之间仍然存在。
您可能可以更改"anaconda_linter_mark_style"为"none"并保留"anaconda_linter_underlines"为true. 这样,它只会在错误下添加下划线,但不会突出显示整行。
如果你不想完全禁用 SublimeLinter,你可以设置 Syntax Specific Preferences。
Preferences -> Package Settings -> Sublime Linter -> Settings Syntax Specific User
首选项的评估类似于 CSS,它是级联的。考虑最后评估的最特定于用户、特定于语法的规则。
例如:我也不喜欢白色矩形,所以我选择了填充。
{
/*
Selects the way the lines with errors or warnings are marked; "outline"
(default) draws outline boxes around the lines, "fill" fills the lines
with the outline color, and "none" disables all outline styles
(useful if "sublimelinter_gutter_marks" is set).
*/
"sublimelinter_mark_style" : "fill",
/*
If true, lines with errors or warnings will be filled in with the
outline color.
This setting is DEPRECATED and will be ignored in future
versions. Use "sublimelinter_mark_style" instead. For backwards
compatibility reasons, this setting overrides "sublimelinter_mark_style"
if that one is set to "outline", but has no effect if it's set to "none".
*/
"sublimelinter_fill_outlines": false,
// If true, lines with errors or warnings will have a gutter mark.
"sublimelinter_gutter_marks": false,
// If true, the find next/previous error commands will wrap.
"sublimelinter_wrap_find": false,
}
对于 Anaconda/Sublime 用户
我有 Anaconda,lint 功能很有用,但开箱即用,它对风格非常苛刻。当您将鼠标悬停在矩形上时,它会告诉您它正在执行的规则的编号。您可以禁用您认为不需要的那些或妨碍您编写代码的方式。
在 Mac 上:
我在我的列表中列出了以下规则,这些规则删除了一些减慢我速度但保留“无制表符”规则的空白规则。
"E201",
"E202",
"E203",
"E302",
"E309",
"W291",
"W293",
"W391"
如果您使用此列表,您将需要在您的用户设置中设置 "translate_tabs_to_spaces": true 。
或者,您可以将“pep8”设置为 false 以完全停止它。
如果您使用Anaconda插件(用于 Python 开发),这就是它的 linting 功能 - 它突出显示 Python 语法错误和PEP8违规。
您可以完全禁用此功能或 通过向当前的 SublimeText 主题添加一些自定义规则来更改此轮廓的颜色:
Preferences > Browser Packages...Preferences > Color Scheme > ...)Tomorrow-my.tmThemefrom Tomorrow.tmTheme)将以下代码粘贴到这个新创建的主题文件中,就在 </array>标签之前:
<dict>
<key>name</key>
<string>anaconda Error Outline</string>
<key>scope</key>
<string>anaconda.outline.illegal</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#FF4A52</string>
<key>foreground</key>
<string>#FFFFFF</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>anaconda Error Underline</string>
<key>scope</key>
<string>anaconda.underline.illegal</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#FF0000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>anaconda Warning Outline</string>
<key>scope</key>
<string>anaconda.outline.warning</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#DF9400</string>
<key>foreground</key>
<string>#FFFFFF</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>anaconda Warning Underline</string>
<key>scope</key>
<string>anaconda.underline.warning</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#FF0000</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>anaconda Violation Outline</string>
<key>scope</key>
<string>anaconda.outline.violation</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#ffffff33</string>
<key>foreground</key>
<string>#FFFFFF</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>anaconda Violation Underline</string>
<key>scope</key>
<string>anaconda.underline.violation</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#FF0000</string>
</dict>
</dict>
Preferences > Color Scheme >并观察变化。在我的情况下需要第 3 点,因为在保存主题并重新启动 Sublime/切换主题(sublime 使用某种缓冲区?...)之后,颜色没有立即更新。所以,当你想玩一点颜色时,也许你必须重复步骤 3-6。
资料来源:Anaconda 的文档
在第 300 行“anaconda_linter_mark_style”:“none”,在 Preferences -> Package Settings -> Anaconda -> Settings - Default 中。这消除了“烦人”的突出显示,但仍检查 pep8 错误
如果以前的解决方案都不适合您,请尝试以下操作:
在文件中,只需添加/修改以下行:
"run_on_save": false,
"disable_outline": true
它对我有用,在我的情况下,我只将 anaconda 作为一个文件夹,将 Sublime 的 python 编译器与 anaconda 文件夹中的 python 编译器(python.exe)相关联。
我刚刚发现这也可能随机发生在您搜索的最后一个单词上。因此,例如,如果您搜索“整数”。然后“整数”的所有实例将在它们周围有那个白色方块。
In Anaconda with Sublime Text, if you don't want to make any changes to the settings:
In the case highlighting occurs, you can use a keyboard shortcut (in my case it's CTRL-ALT-R) to autoformat the code! The highlighting will be gone immediately.
You just have to repeat that every once in a while, after having added new code (which is not formatted according to the PEP8 rules).
The command is "anaconda_auto_format".
如果你有 anaconda linting
像这样进入目录 C:\Users\giova\AppData\Roaming\Sublime Text 3\Packages\Anaconda 并更改 anaconda.sublime-settings (找到 anaconda linter 键并将它们设置为 false)。看看你是否安装了其他 linter 东西,并将它们的设置更改为 false,它似乎依赖 linting,直到一切都适合你。我安装了不同的 linter,所以我必须全部更换。
您可以通过文件菜单禁用 anaconda.sublime-settings 中的警告:
Sublime > Preferences > Package Settings > Anaconda > Settings – 用户:
在打开的文件中输入以下代码,然后按Ctrl + S保存文件
{"pep8": false}
你也可以输入这个:
{"anaconda_linting": false}
但它禁用警告和错误,这不好
For me, on sublime 3 this was the PyLinter Package. While the linting feature's useful i also wanted to get rid of the annoying highlight. Found this on their docs if it's helpful! :)
https://packagecontrol.io/packages/Pylinter
I was able to remove the highlight with Command + option + x
The plugin can be invoked by a keyboard shortcut:
OS X: Command+option+z
Linux, Windows: Control+Alt+z
**Toggle Marking**
The marking of the errors in the file can be toggled off and on:
OS X: Command+option+x
Linux, Windows: Control+Alt+x