Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 282
pnichols Avatar asked Jan 10 '14 15:01

pnichols


People also ask

How do I turn on suggestions in Sublime Text?

In the Sublime menu go to Preferences > Package Settings > All Autocomplete > Settings – User.

Does Sublime Text have autocomplete?

From the Sublime Text docs: Auto complete shows the completion popup as you type, so you can fill in long words by typing only a few characters. It's enabled by default for source code and HTML (but only after entering a < character).

How do I manage codes in Sublime Text?

You can install any package control in Sublime Text editor using the shortcut key combination Ctrl+Shift+P, and selecting the Package Control: Install Package option. Select the associated package to install in Sublime Text editor. To install Sublime Linter, you need to select the option of SublimeLinter plugin.


2 Answers

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.

like image 74
kevbost Avatar answered Sep 20 '22 13:09

kevbost


  • 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')

like image 36
Nitsan Baleli Avatar answered Sep 21 '22 13:09

Nitsan Baleli