Answers:
看起来您已经安装了SublimeLinter。它突出显示错误和警告。
如果您仍然对上述建议的解决方案(anaconda lint)有疑问:
通过文件菜单在用户定义的Anaconda设置文件Anaconda.sublime-settings中完全禁用linting:Sublime>首选项>程序包设置> Anaconda>设置–用户:打开文件时,只需键入以下内容并保存; -)
{“ anaconda_linting”:false}
至少,它解决了我的问题。祝福(债务人)<> <
{"anaconda_linter_mark_style": "none", "anaconda_linter_underlines":false}
您可能可以更改"anaconda_linter_mark_style"
为"none"
并保持"anaconda_linter_underlines"
为true
。这样,它只会在错误下划线,而不会突出显示整行。
如果您不想完全禁用SublimeLinter,则可以设置“语法特定的首选项”。
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.tmTheme
来自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的文件
如果以前的解决方案都不适合您,请尝试以下操作:
在文件中,只需添加/修改以下行:
"run_on_save": false,
"disable_outline": true
它对我有用,在我的情况下,我只有anaconda作为文件夹,将Sublime的python编译器与anaconda文件夹中的python编译器(python.exe)相关联。
您可以通过文件菜单在anaconda.sublime-settings中禁用警告:
Sublime>首选项>程序包设置> Anaconda>设置–用户:
在打开的文件中,输入以下代码,然后按Ctrl + S
保存文件
{"pep8": false}
您也可以输入以下内容:
{"anaconda_linting": false}
但是它同时禁用了警告和错误,这不好
对我来说,在Sublime 3上是PyLinter软件包。虽然棉绒功能很有用,但我也想摆脱烦人的亮点。如果有帮助,请在他们的文档中找到!:)
https://packagecontrol.io/packages/Pylinter
我能够使用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