SublimeCodeIntel is a must-have plugin. Its main features are:
We can easily install this plugin using the Package Control utility that we installed earlier. Let's open it up by pressing Ctrl + Shift + P in Windows or Linux and command + Shift + P in OS X. Choose Install Package and install the SublimeCodeIntel plugin. We will then need to restart Sublime.
When it first starts, SublimeCodeIntel needs to build an index of the languages you're using. Depending on the number of modules/libraries you have installed and the size and complexity of the project you're working on, this can take some time. Be patient though, it will be well worth it when it's ready.
After SublimeCodeIntel finishes indexing, start typing code as usual; autocomplete will pop up whenever it's available. SublimeCodeIntel shortcuts map:
SublimeCodeIntel action |
Windows |
Linux |
OS X |
---|---|---|---|
Jump to definition |
Alt + Left Mouse Click |
Super + Left Mouse Click |
Control + Left Mouse Click |
Jump to definition |
Control + Windows + Alt + Up |
Control + Super + Alt + Up |
Control + command + Option + Up |
Go Back |
Control + Windows + Alt + Left |
Control + Super + Alt + Left |
Control + command + Option + Left |
Manual Code Intelligence |
Control + Shift + Space |
Control + Shift + Space |
Control + Shift + Space |
To add additional libraries such as Django, extra paths for Python or extra paths to look for .js
files for JavaScript, we can edit the codeintel
config file that is located at ~/.codeintel/config
in Linux or OS X and C:Usersusername.codeintelconfig
in Windows. By default, this file will be an empty JSON-formatted file. Here is an example for optional configuration:
{ "PHP": { "php": '/usr/bin/php', "phpExtraPaths": [], "phpConfigFile": 'php.ini' }, "JavaScript": { "javascriptExtraPaths": [] }, "Ruby": { "ruby": "/usr/bin/ruby", "rubyExtraPaths": [] }, "Python": { "python": '/usr/bin/python', "pythonExtraPaths": [ "/usr/local/lib/python2.7/site-packages " ] }}