YcmdCompletion
Sublime Text 3 plugin for C++ code completion and error highlighting, based on Ycmd server
Details
Installs
- Total 7K
- Win 3K
- Mac 2K
- Linux 3K
Dec 4 | Dec 3 | Dec 2 | Dec 1 | Nov 30 | Nov 29 | Nov 28 | Nov 27 | Nov 26 | Nov 25 | Nov 24 | Nov 23 | Nov 22 | Nov 21 | Nov 20 | Nov 19 | Nov 18 | Nov 17 | Nov 16 | Nov 15 | Nov 14 | Nov 13 | Nov 12 | Nov 11 | Nov 10 | Nov 9 | Nov 8 | Nov 7 | Nov 6 | Nov 5 | Nov 4 | Nov 3 | Nov 2 | Nov 1 | Oct 31 | Oct 30 | Oct 29 | Oct 28 | Oct 27 | Oct 26 | Oct 25 | Oct 24 | Oct 23 | Oct 22 | Oct 21 | Oct 20 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 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 |
Mac | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
Linux | 0 | 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 |
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
- 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
- To set your personal settings, use User Settings file:
Preferences > Package Settings > YcmdCompletion > Settings - User
- 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!
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.GeType
shows the type of the Object in the statusbar.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