Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime Text 2 auto completion popup does not work properly

I got problem with jQuery Snippet that i installed throughout package control. After installation I do not have popup with jQuery code hints and intalisance. Look at this video:
http://code.tutsplus.com/courses/perfect-workflow-in-sublime-text-2/lessons/adding-snippets-through-package-control

On 0:50 after typing . he got popup with code hints - I don't have this one. I have to type . on and then press Tab to display popup with snippet...
And yes, I'm in JavaScript file and I got default settings.

And after . he also got all jQuery functions like add or addClass. I do not have this one even if I press Ctrl+Space.

like image 577
born2fr4g Avatar asked Sep 10 '25 04:09

born2fr4g


2 Answers

If you hit CTRL-SPACE you'll get the dropdown of available completions for what you've just typed.

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

If you want the autocomplete dropdown to appear as you type then add this line to your User Preferences.sublime-settings file:

{
  "auto_complete_selector": "source, text"
}

That should do what you're looking for :-)

like image 127
Richard Jordan Avatar answered Sep 13 '25 06:09

Richard Jordan


Consider changing User Settings to the following:

{
  // By default, auto complete will commit the current completion on enter.
  // This setting can be used to make it complete on tab instead.
  // Completing on tab is generally a superior option, as it removes
  // ambiguity between committing the completion and inserting a newline.
  "auto_complete_commit_on_tab": true,

  // Controls if auto complete is shown when snippet fields are active.
  // Only relevant if auto_complete_commit_on_tab is true.
  "auto_complete_with_fields": true,

  // As Richard Jordan suggested, this item
  // controls what scopes auto complete will be triggered in
  "auto_complete_selector": "source, text"
}

Open your User Settings by pressing Cmd+, on Mac or Ctrl+, on Windows

And if you want to fully grasp Sublime Text 2, I do recommend this course: Perfect Workflow in Sublime Text. It used to be free by the time I first posted this answer. I still recommend it anyways.

like image 29
Flavio Wuensche Avatar answered Sep 13 '25 06:09

Flavio Wuensche