1. First install the SublimeCodeIntel package.
Enter sublime, enter package management via Ctrl+Shift+P, enter pci (the first letter), and select Package Control:Intall Package, as shown in the figure:
Press Enter, enter the package installation interface, enter the first letter, and select SublimeCodeIntel, as shown in the figure:
Enter, install, and wait for the installation to complete (it takes a long time).
2. Configure SublimeCodeIntel.
Open the configuration file through the path Perferences->Package Settings->SublimeCodeIntel->Setting - Defalut and find the following configuration items:
- "codeintel_language_settings": {
- "Python3": {
- "python3": "/usr/local/bin/python3.3",
- "codeintel_scan_extra_dir": [
- "/Applications/Sublime Text.app/Contents/MacOS",
- "~/Library/Application Support/Sublime Text 3/Packages/SublimeCodeIntel/arch",
- "~/Library/Application Support/Sublime Text 3/Packages/SublimeCodeIntel/libs"
- ],
- "codeintel_scan_files_in_project": true,
- "codeintel_selected_catalogs": []
- },
- "JavaScript": {
- "codeintel_scan_extra_dir": [],
- "codeintel_scan_exclude_dir":["/build/", "/min/"],
- "codeintel_scan_files_in_project": false,
- "codeintel_max_recursive_dir_depth": 2,
- "codeintel_selected_catalogs": ["jQuery"]
- },
- "PHP": {
- "php": "/Applications/MAMP/bin/php/php5.5.3/bin/php",
- "codeintel_scan_extra_dir": [],
- "codeintel_scan_files_in_project": true,
- "codeintel_max_recursive_dir_depth": 15,
- "codeintel_scan_exclude_dir":["/Applications/MAMP/bin/php/php5.5.3/"]
- }
- }
Find the "JavaScript" code snippet, put
- "codeintel_selected_catalogs": ["jQuery"]
Change it to:
- "codeintel_selected_catalogs": ["JavaScript"]
keep.
3. Close and restart Sublime, write JavaScript code, and find that auto-completion has taken effect.