Hello everyone!

I'm looking for a free (open source preferred) source code editor. Ideally it would be as light-weight as Notepad++, gedit, kate, mousepad, you see the pattern. However, the most important thing I'm looking for in this editor is flexible, dynamic, intelligent autocomplete (for c/c++).

To be fair, Notepad++ has autocomplete, but it is hardly an intelligent implementation. It simply gives me a predefined list of all standard C++ variables from the standard library. Not very useful or timesaving.

If you're going to recommend Geany, Anjunta, Eclipse, or the like, please don't. These are full featured IDEs with more features than I know what to do with.

To know the kind of autocomplete I'm looking for, you need to have used Netbeans for C++. Eclipse and Code::Blocks have good autocomplete, much better than Notepad++, but they still pale in comparison with Netbeans. In Netbeans, I can hit ctrl+space anywhere at any time and get a suggestion box filled with intelligent useful results. If I'm in a function, it would give me the local variables, global variables, and other functions in the same scope. If the function is a method of a class, it would give me the member data of that class and other functions of the same class. It would also give me functions of a parent class even if this class doesn't override them (and let me know this in the suggestion box).

With functions, Netbeans is helpful also. It will tell me in the suggestion box what the function returns and what variables it takes.

An amazing thing Netbeans does with autocomplete is work properly with templates. Even when I write my own templated class and create an instance with some obscure type I defined in another header, Netbeans autocomplete suggestions will list all the functions with the correct types.

So you can see I really love Netbeaans autocomplete. All I ask is to have a simple text editor with that one feature implemented equally well.

If you know of a program that does this, or can suggest something else that is as light weight as Notepad++ and as helpful as Netbeans autocomplete, then please do so.

One of the main reasons why autocomplete features are generally lacking in enhanced text editors (like Emacs or Kate) is that it requires some knowledge of the build configuration (source files included in the build, include paths, environment variables and such things). So, the bare minimum that you are going to need is an integration of a build-system into the text editor, and once you have that, it is pretty much an IDE.

The other reason why auto-completion is lacking in light-weight code editors is that a good and intelligent code-completion system is NOT a light-weight piece of software.

I don't know of anything that is like that, half-way between an enhanced text editor and a full-blown IDE.

Personally, I use KDevelop (for Linux, you didn't specify the OS). The code-completion engine it uses is really good. In my experience, I find that it outperforms even IntelliSense (the Visual Studio code-completion engine). KDevelop uses Kate to manage the text-editing part of the IDE (code-highlighting, auto-formatting, folding, and all that stuff), but it supplements it with code-completion and great support for external build-systems. I also write heavily templated code which usually is too much to handle for the code-completion systems of CodeBlocks, Eclipse, and Visual Studio, but, amazingly, the code-completion system of KDevelop is mostly able to keep up and resolve to good suggestions most of the time. KDevelop is a full-blown IDE (albeit a very light-weight one), and I don't know if there are any ways to get an even lighter version of it.

Kate does advertise code-completion features but I doubt it is the same strength as KDevelop, if it is, then it would be worth a try. Also, given the plugin-based system that the KDevelop team is using (with KDevPlatform) I would imagine that it would be quite possible to create a kind of KDevelop-Lite edition fairly easily, one that would just include Kate and the KDevelop code-completion system.

This article has been dead for over six months. Start a new discussion instead.