Skip to content

slene/Sublime-JavaScript-API-Completions

 
 

Repository files navigation

Sublime API Completions Package

This package aim at provide a simpler way to build own auto-completion.

auto-completion is lightweight, not complex, simpler than snippets.

This package also provide several APIs completions such as JavaScript, jQuery API, Underscore API, HTML5 and Bootstrap Classes collect by me.

Compatible

  • Sublime Text 2 with MAC OS X 10.8.4 tested!

  • Sublime Text 2 with Windows 8 64bit tested!

  • Sublime Text 2 with Windows 7 32bit tested!

  • Sublime Text 3 with Windows 8 64bit tested!

Features

手刻的浪漫

JavaScript and jQuery 1.9

Twitter Bootstrap 2.3.2

HTML / HTML5

Why this package?

  • Compared with *.sublime-snippet files:

    Simpler to build own API completions.

  • Compared with *.sublime-completions files:

    • speak in English:

      It seems like when scope matched would be override completions provide by sublime itself. refer to issue #3.

    • speak in Chinese:

      一但 scope 匹配成功之後,雖然自製的 auto-completion 能更順利工作;但是它會覆蓋掉原本 auto-completion,只有在自製的辭彙完全沒匹配,才會顯示原本的 auto-completion,而不是將它們融合。

Setting

API files is include the setting keyword such as HTML, jQuery, myGlossary as filename API-completions-${filename}.sublime-settings place in /packages/${this-package}/sublime-completions/ or /packages/User/.

{
  // --------------------
  // sublime-API-Completions-Package
  // --------------------
  // API files is include the setting *keyword* such as `HTML`, `jQuery`, `myGlossary` as filename `API-completions-${filename}.sublime-settings` place in `/packages/${this-package}/sublime-completions/` or `/packages/User/`.
  // After you enable, disable or added new your own completions, you might need restart your Sublime Text.
  // 
  // --------------------
  // APIs Collected by github/Pleasurazy
  // --------------------
  // `true` means load file and enable it
  // `false` means load file and disable it
  "completion_active_list": {
    "HTML": false,
    "Underscore": false,
    "jQuery": true,
    "JavaScript": true,
    "twitter-bootstrap": true
  },
  // --------------------
  // Enable your own APIs
  // --------------------
  // `true` means load file and enable it
  // `false` means load file and disable it, but didn't effect `completion_active_list` setting.
  "completion_active_extend_list": {
    // "myGlossary": true,
    // "myAngularJS": true
  }
}

After you enable, disable or added new your own completions, you might need restart your Sublime Text.

API References

Installation

  • Using Package Control to install.

  • Waiting download.

  • Happy programming.

Relevant issues

How to trigger completion hint when every typing?

Open file Packages/User/Preferences.sublime-settings or click Setting - User from menu. In my case, I just setup the auto_complete_triggers property as follow:

{
  "auto_complete_triggers":
  [
    {
      "characters": "qazwsxedcrfvtgbyhnujmikolpQAZWSXEDCRFVTGBYHNUJMIKOLP",
      "selector": "text, source, meta, string, punctuation, constant"
    }
  ]
}

It will active most of scope triggers and most of characters.

About

Support JS, jQuery, bootstrap and custom auto-completion simpler.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%