Using the must-have SublimeCodeIntel

SublimeCodeIntel is a must-have plugin. Its main features are:

  • The Jump to Symbol Definition feature, which allows a user to jump to the file and line of the defining symbol
  • It Imports autocomplete and displays the available modules/symbols in real time
  • The Function Call tooltips display information in the status bar about the working function

Installing SublimeCodeIntel

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.

Using SublimeCodeIntel

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

Configuring SublimeCodeIntel

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 "
         ]
    }}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset