2012-04-27 20 views

回答

49

看起來你已經安裝了SublimeLinter。它突出顯示錯誤和警告。

+0

這樣做。謝謝! – 2012-04-27 17:06:20

+7

control + shift + p或者cmd + shift + p並輸入sublimelinter並點擊禁用 – 2013-04-11 18:41:54

+32

在我的情況下它是anaconda插件 – goFrendiAsgard 2014-03-06 10:35:54

7

如果您不想完全禁用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, 
} 
+0

謝謝,輪廓非常討厭。 – 2017-02-01 17:25:47

105

如果你仍然有以上(含蟒蛇皮棉)提出這些解決方案的一個問題:

禁用用戶定義的蟒蛇設置文件內共掉毛,Anaconda.sublime的設置,通過文件菜單: 崇高>首選項>套餐設置>蟒蛇>設置 - 用戶: 當它打開文件,只需鍵入以下內容並保存它扔掉;-)

{ 「anaconda_linting」:假}

至少,它解決了我的問題。 祝福 (債務人)<> <

+3

我想要具有linting功能,我只是希望它只突出顯示錯誤和/或指示排水溝中的錯誤,而不是使這些煩人的框圍繞一切。 – Elliot 2015-02-14 21:59:53

+17

將「anaconda_linter_mark_style」:「outline」更改爲「none」和「anaconda_linter_underlines」:true,false。 - 仍然會顯示錯誤的陰影線標記,但不會顯示惱人的輪廓線/下劃線線。< – 2015-12-30 12:23:46

+7

@JamesBurke:你的建議結束了運行linter沒有惱人的輪廓/下劃線。這裏是我的** Anaconda.sublime-settings **文件的樣子: '{「anaconda_linter_mark_style」:「none」,「anaconda_linter_underlines」:false}' – 2017-01-12 17:27:20

5

如果您正在使用Anaconda插件(對於Python開發),這是它的掉毛的功能 - 它強調了Python語法錯誤和違規PEP8

可以完全禁用此功能或通過添加一些自定義規則,以你目前的SublimeText主題改變這個輪廓的顏色

  1. 在崇高的文本菜單:Preferences > Browser Packages...
  2. 找到的源文件的當前主題在打開的目錄中(* .tw主題文件的名稱對應於該名稱,在Preferences > Color Scheme > ...中選擇)
  3. 複製此文件,添加其他名稱(例如Tomorrow-my.tmTheme,從Tomorrow.tmTheme
  4. 下面的代碼粘貼到這個新創建的主題文件,右鍵</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> 
    
  5. 調整顏色您的需求。保存存檔。
  6. Preferences > Color Scheme >中選擇您的「新」主題並觀察更改。

第3點是需要在我的情況下,因爲顏色沒有立即更新,保存主題後,重新啓動崇高/切換主題(崇高使用某種緩衝區?..)。所以,也許你將不得不重複步驟3-6,當你想玩一點顏色。

來源:Anaconda's Docs

+0

已更新。感謝您的建議。 – maq 2015-01-13 18:50:50

22

你或許可以改變"anaconda_linter_mark_style""none"並保持"anaconda_linter_underlines"true。這樣它只會在錯誤下放置下劃線,但不會突出顯示整條線。

+1

很好,謝謝!整個Anaconda默認設置文件:https://github.com/DamnWidget/anaconda/blob/master/Anaconda.sublime-settings – Makc 2016-09-21 08:00:35

1

我剛剛發現這也可以隨機發生在您搜索的最後一個單詞上。因此,如果您搜索「整數」例如。然後,所有「整數」的實例都會在它們周圍出現白色方塊。

4

對於蟒蛇/崇高用戶

我有蟒蛇和皮棉功能是有用的,但開箱即用,它是惡法大約風格。當您將鼠標懸停在矩形上時,它會告訴您它正在執行的規則的編號。你可以禁用那些你不需要的東西,或者在你編碼的時候阻止它們。

在Mac上:

  1. 進入參數|瀏覽軟件包| Anaconda | Anaconda.sublime-settings
  2. 搜索「pep8_ignore」
  3. 添加要刪除的規則。

我已經在我的列表中放入了以下規則,這些規則刪除了一些使我放慢速度但保留「無選項卡」規則的空白規則。

"E201", 
    "E202", 
    "E203", 
    "E302", 
    "E309", 
    "W291", 
    "W293", 
    "W391" 

如果您使用此列表,您需要在用戶設置中設置「translate_tabs_to_spaces」:true。

或者,您可以將「pep8」設置爲false以完全停止它。

2

如果沒有以前的解決方案的工作適合你,試試這個:

  1. 進入參數|包裝設置| Pylinter |用戶設置
  2. 在該文件中,只需添加/修改下面幾行:

    "run_on_save": false, 
    "disable_outline": true 
    

它的工作對我來說,在我的情況下,我不得不蟒蛇只是作爲一個文件夾中,蟒蛇編譯器相關聯升級到anaconda文件夾中的python編譯器(python.exe)。

28

禁用Annaconda在sublimetext 3掉毛當前文件:

  1. 通過CNTRL輸入命令面板+ Shift + P或Command + Shift + P爲Mac OS X
  2. Anaconda: Disable linting on this file類型和命中進入
  3. 爲了重新啓用linting Anaconda: Enable linting on this file

在會話之間禁用linting。

Source

+1

Command + shift + P用於Mac OS X中的第1步。 – 2017-02-08 21:45:25