简体   繁体   中英

How to remove some specific autocomplete in Sublime Text 2?

I have Sublime Text 2 installed with the Emmet package (Windows 7 64bits).

When I type " wid ", I want the auto-complete first suggestion to be " width ". Problem is, right now it suggests " widows " which is very rarely used.

How can I modify the order of suggestions, or maybe even better, remove the "widows" auto-complete suggestion altogether?

Referencing: https://github.com/emmetio/emmet/blob/master/lib/snippets.json

ST3: Emmet: Settings - User

{
    "disable_completions": false,

    // This solution works to override annoying autocompletions from emmet.
    // I could do without seeing "widows" ever again, but just in case I added it back so that "widows" won't autocorrect to "width"

    "snippets": {
        "css": {
            "filters": "css",
            "profile": "css",
            "snippets": {
                "wid": "width:|;",
                "widows": "widows:|;"
            }
        }
    }
}

EDIT: The solution of deleting files did not work for me. Hitting tab after typing in "width" still autocompleted to "widows: ;" on my machine.

  • sublime will slowly 'learn' what you want most

http://www.sublimetext.com/docs/2/auto_complete.html

"By default, the selected item in the completion popup will be committed when enter is pressed. This can create ambiguity between committing the completion, and inserting a newline. By setting the auto_complete_commit_on_tab setting to true, enter will insert a newline, and tab will commit the current completion. There are other benefits, too: because Sublime Text knows there is no ambiguity, it will show a more curated list of completions, with the one you want more likely to be in first place.

Enabling Commit on Tab is recommended, but it will take a short time to get used to."

  • if you want to delete a specific snippet:

go to 'preferneces->browse packages'
there should be a 'emmet css snippets' folder there.
inside that folders are all of the snippets available, as invividual files named:
'shortcut'.sublime-snippet (wid.sublime-snippet stands for 'width')

An alternative is just type "w" and TAB. This is the abreviattion for "width: ;" according to Emmet Cheat Sheet

I've had the same problem,

try to open Preferences > Browse For Package

on window open CSS folder and edit css_completions.py file, drag file to sublime and find widows , remove code on the line, I already try and it's work on mu sublime.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM