ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Better Completion

by Pleasurazy ST2/ST3

Better auto-completion working.

Labels auto-complete

Details

Installs

  • Total 52K
  • Win 32K
  • OS X 13K
  • Linux 7K
Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4 Sep 3 Sep 2 Sep 1 Aug 31 Aug 30 Aug 29 Aug 28 Aug 27 Aug 26 Aug 25 Aug 24 Aug 23 Aug 22 Aug 21 Aug 20 Aug 19 Aug 18 Aug 17 Aug 16 Aug 15 Aug 14 Aug 13 Aug 12 Aug 11 Aug 10 Aug 9 Aug 8 Aug 7 Aug 6 Aug 5
Windows 28 44 22 36 41 39 34 38 39 16 22 29 16 15 22 34 12 16 23 21 24 7 15 8 14 13 26 16 28 22 9 14 17 21 27 30 26 15 14 16 20 30 14 17 22 13
OS X 2 10 7 8 14 5 14 4 1 0 4 10 7 2 5 4 4 4 1 6 6 3 7 1 1 3 6 3 5 10 1 1 9 4 4 5 7 3 1 6 5 4 3 7 3 3
Linux 1 1 1 1 2 3 5 3 4 5 5 0 1 3 5 3 5 6 2 0 4 0 2 0 3 2 0 1 2 1 1 2 1 2 0 6 3 2 3 3 3 2 1 0 2 1

Readme

Source
raw.​githubusercontent.​com

Sublime Better Completion Package

手刻的浪漫

This package aim at provide a simpler way to build own auto-completions and avoid *.sublime-completions override word-completion wrongly in some circumstance (issue#3).

auto-completion is lightweight, easier, simpler than snippets.

This package also provide several APIs completions such as JavaScript, jQuery, Lodash, Underscore, HTML5, CSS3 and Bootstrap Classes, React.js, etc

Compatible

Should be working fine with ST2 and ST3.

2015/02

  • Sublime Text 3 with MAC OS X 10.10.2 using Package Control tested!

2014/08

  • Sublime Text 3 with MAC OS X 10.9.4 manual installed tested!

2013/09

  • Sublime Text 3 with MAC OS X 10.8.4 using Package Control tested!

  • Sublime Text 2 with MAC OS X 10.8.4 using Package Control tested!

2013/07

  • Sublime Text 2 with Windows 8 64bit tested!

  • Sublime Text 2 with Windows 7 32bit tested!

  • Sublime Text 3 with Windows 8 64bit tested!

Why this package?

  • Several API completions ready to enable.

  • More API completions create easier.

  • Compared with *.sublime-snippet files:

    Simpler to build own API completions.

  • Compared with *.sublime-completions files:

    This package will avoid *.sublime-completions override word-completion wrongly:

    • In English:

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

    • In Chinese:

      一但 scope 匹配成功之後,自製的 auto-completion 雖然能夠順利工作;但是它也會覆蓋掉原本 word-completion。因此,只有在自製的辭彙的 scope 完全沒匹配時,才會正常地顯示原本的 word-completion,卻沒有將它們融合在一起顯示。這使得可被選擇的 completions 將會有所遺失。

Preview

Support APIs see Setting section.

JavaScript and jQuery 1.9

Twitter Bootstrap 2 and 3

Setting

Make your own API files that contains keyword such as html, jquery, myglossary as filename sbc-api-${filename}.sublime-settings and place them in /packages/User/.

{
  // --------------------
  // sublime-better-completions-Package (sbc package)
  // --------------------
  // API files is contains the *keyword* such as `html`, `jquery`, `myglossary` with lowercase as filename `sbc-api-${filename}.sublime-settings` place in `/packages/User/` (your own) or `/packages/${this-package}/sublime-completions/` (package build-in).
  // After you enable, disable or added new your own completions, you might need restart your Sublime Text Editor.
  //
  // Your own setting file `sbc-setting.sublime-settings` need to place in `/packages/User/` and contains all your api setting property that you want to enable.
  //
  // --------------------
  // APIs Setup
  // --------------------
  // `true` means enable it.
  // `false` means disable it.
  "completion_active_list": {
    // build-in completions
    "css-properties": false,
    "gruntjs-plugins": false,
    "html": false,
    "lodash": false,
    "javascript": false,
    "jquery": false,
    "jquery-sq": false, // Single Quote
    "php": false,
    "phpci": false,
    "sql": false,
    "twitter-bootstrap": false,
    "twitter-bootstrap-less-variables": false,
    "twitter-bootstrap3": false,
    "twitter-bootstrap3-sass-variables": false,
    "underscorejs": false,
    "react": false,

    // Your own completions?
    // ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/sbc-api-my-angularjs.sublime-settings
    "my-angularjs": false,

    // ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/sbc-api-my-glossary.sublime-settings
    "my-glossary": false,

    // ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/sbc-api-my-html.sublime-settings
    "my-html": false,

    // ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/sbc-api-my-javascript.sublime-settings
    "my-javascript": false
  }
}

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.

    CTRL+SHIFT+P or CMD+SHIFT+P type in sbc settings user to open user setting file

    Paste setting json. (see Setting section)

    Enable your favorite APIs.

    Restart your sublime text app.

    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.