通过SublimeCodeIntel设置JavaScript自动补全

时间:2023-03-10 06:14:36
通过SublimeCodeIntel设置JavaScript自动补全

1、首先安装SublimeCodeIntel包。

进入sublime,通过Ctrl+Shift+P进入包管理,输入pci(首字母),选择Package Contrl:Intall Package,如图:

通过SublimeCodeIntel设置JavaScript自动补全

回车,进入包安装界面,输入首字母,选择SublimeCodeIntel,如图:

通过SublimeCodeIntel设置JavaScript自动补全

回车,安装,等待安装完成(需要时间较长)。

2、配置SublimeCodeIntel。

通过路径Perferences->Package Settings->SublimeCodeIntel->Setting - Defalut打开配置文件,找到如下配置项:

  1. "codeintel_language_settings": {
  2. "Python3": {
  3. "python3": "/usr/local/bin/python3.3",
  4. "codeintel_scan_extra_dir": [
  5. "/Applications/Sublime Text.app/Contents/MacOS",
  6. "~/Library/Application Support/Sublime Text 3/Packages/SublimeCodeIntel/arch",
  7. "~/Library/Application Support/Sublime Text 3/Packages/SublimeCodeIntel/libs"
  8. ],
  9. "codeintel_scan_files_in_project": true,
  10. "codeintel_selected_catalogs": []
  11. },
  12. "JavaScript": {
  13. "codeintel_scan_extra_dir": [],
  14. "codeintel_scan_exclude_dir":["/build/", "/min/"],
  15. "codeintel_scan_files_in_project": false,
  16. "codeintel_max_recursive_dir_depth": 2,
  17. "codeintel_selected_catalogs": ["jQuery"]
  18. },
  19. "PHP": {
  20. "php": "/Applications/MAMP/bin/php/php5.5.3/bin/php",
  21. "codeintel_scan_extra_dir": [],
  22. "codeintel_scan_files_in_project": true,
  23. "codeintel_max_recursive_dir_depth": 15,
  24. "codeintel_scan_exclude_dir":["/Applications/MAMP/bin/php/php5.5.3/"]
  25. }
  26. }

找到"JavaScript"代码段,将

  1. "codeintel_selected_catalogs": ["jQuery"]

改为:

  1. "codeintel_selected_catalogs": ["JavaScript"]

保存。

3、关闭重启Sublime,写JavaScript代码,发现自动补全已经生效。

通过SublimeCodeIntel设置JavaScript自动补全