Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime Text autocomplete plugin for C++?

I'm trying to have the autocomplete feature on Sublime Text by using c++ libraries. I use very often EIGEN for example, but there is no autocomplete for functions inside this library. How can I somehow export the library to let sublime know about all the functions and methods I could use within this library?

I would appreciate any helpful answer.

like image 322
DevX10 Avatar asked Nov 21 '16 22:11

DevX10


People also ask

How do I enable autocomplete in Sublime Text?

By default, Sublime Text will automatically show the completions popup when a user is editing source code or markup, but not within prose in comments, strings or markups. Pressing the Esc key will hide the completions popup. To manually show the completions popup, press Ctrl+Space.

Does Sublime have intellisense?

You can add the auto-complete Intellisense feature for Kony UI, API, and SDK functions while working with Sublime Text from Visualizer. You must install the Ternjs for Sublime package to enable this feature.


2 Answers

I use the package EasyClangComplete to auto-complete C++ code. And it works fine.

You can install this package using Package Control. It is easy to set it up, a working setting is as follows:

{  "common_flags" : [
    // some example includes
    "-I/usr/include",
    "-I$project_base_path/src",
    // this is needed to include the correct headers for clang
    "-I/usr/local/lib/clang/4.0.1/include",   ],   "cpp_flags" : [
    "-std=c++11",
    "-Wall"   ], 
   "errors_style": "phantoms", 
   "hide_default_completions": true,
   "progress_style": "ColorSublime", 
   "show_type_info": false,
}
like image 91
jdhao Avatar answered Sep 20 '22 14:09

jdhao


If you are using Sublime Text 3, what you're looking for is a plugin like ClangAutoComplete

Documentation can be found here

like image 21
jreed Avatar answered Sep 18 '22 14:09

jreed