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

Ycmd​Completion

by LuckyGeck ST3

Sublime Text 3 plugin for C++ code completion and error highlighting, based on Ycmd server

Details

Installs

  • Total 7K
  • Win 3K
  • Mac 1K
  • Linux 3K
Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12
Windows 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

YcmdCompletion

Sublime Text 3 plugin for code completion and error highlighting, based on Ycmd server

Installation

Simply use Package Control and Install Package YcmdCompletion. Direct link to plugin in sublime packages repository.

Post-Install

  1. Open default settings to see, what options are available. To open default settings, you can use Sublime Text menu:

Preferences > Package Settings > YcmdCompletion > Settings - Default

  1. To set your personal settings, use User Settings file:

Preferences > Package Settings > YcmdCompletion > Settings - User

  1. Prepare Ycmd Server (clone to your machine and build) as it is described here

Note that you need to enable Rust/Go support explicitly by adding them to the languages array in the settings file. Other languages mentioned in the default settings file may also work, however this plugin has only been tested with these. For Rust and Go to work you must have compiled ycmd with the appropriate options, check out the docs for more information. This is true for most other ycmd-supported languages as well.

Option 1:

4.1 Generate your personal HMAC key. It can be done by executing additional command:

Command Palette > Ycmd: Create HMAC keys

It will be automaticaly written down to your plugin's settings. Just copy-n-paste it to settings of ycmd.

5.1 Run ycmd with your settings. You can find this article useful.

6 Open any *.cpp or *.py file and try to use auto-completion.

Option 2:

4.2 Go to your personal settings and set use_auto_start_localserver to 1

5.2 Set ycmd_path to point to your local installation of Ycmd Server (e.g.:home/USERNAME/ycmd/ycmd), and either provide the location to your settings file for the ycmd Server or ignore default_settings_path to use the default file that comes with ycmd.

6 Open any *.cpp or *.py file and try to use auto-completion.

Functions

YcmdCompletion now supports three new handy functions!

  1. GoTo goes to the definition of the variable under the cursor. If it's a type that the cursor is on, GoTo automatically recognizes that and instead opens the file that contains the declaration and jumps to the corresponding point.
  2. GeType shows the type of the Object in the statusbar.
  3. GetParent shows the enclosing function in the statusbar.

Please note that the cursor must be in front of or somewhere in the word you are calling the function for.

FAQ

Feel free to email me with any questions about this plugin. Questions with answers are placed here.

Miscellaneous enhancements

By default, Sublime only shows the autocomplete dialog when you have started typing a word. This means that field and path autocompletion only occur after you type the first character of the field or path (e.g. only after typing x in foo::x or foo.x). To make it appear when you have typed foo:: or foo. and show the full range of path/field/method autocompletions, you need to add a syntax-specific config file to Sublime.

To do this, open a file of the language you wish to tweak, go to Preferences -> Settings - More -> Syntax Specific - User, and add an autocomplete specification like so:

{
    "auto_complete_selector": "source - (comment, string.quoted)",
    "auto_complete_triggers": [
        {"selector": "source.c++", "characters": "."},
        {"selector": "source.c++", "characters": "::"},
        {"selector": "source.c++", "characters": "->"}
    ]
}

The - (comment, string.quoted) means that autocompletion will not complete within comments or strings (you can remove this if you don't need it). Depending on your language, you may need to modify the triggers.

License

Copyright 2014 Pavel Sychev. Licensed under the MIT License