Inspiration
Clangpletion was inspired out of a desire to implement a lightweight yet effective autocomplete engine into vim. There were few solutions to autocomplete engines, especially on Windows. And, from there, the idea of making an autocomplete engine in vim for C was born.
What it does
Clangpletion uses pre-processing from the Clang compiler to help generate relevant code suggestions to finish off snippets. From there, there is a Vimscript that is running in the background to help connect the Clang backend to the text editor in Vim. Finally, as seen in the demos, the results are displayed under the cursor, which can be navigated through with different hot keys, to help complete the expression. Up and Down arrows are used to navigate through the different results when the menu is open. Then, to close the menu, simply backspace out of the character, and finally to open the window, just type! When a code snippet appears that will help finish the expression, just hit tab and the code will appear right after the cursor!
How We Built It
Clangpletion was completely build in the command line with Vim itself! The rest came from a lot of documentation reading from the Clang compiler and researching when we found ourselves at a roadblock. We used the Clang C compiler and some of it's built in libraries to make the code completion come to fruition. Then, vimscript, with some of it's built in functionality, was used to make the pop up menu that is seen under cursor when typing.
Challenges We Ran Into
During its creation, we ran into many challenges with having poor documentation on smaller issues partially because some of the libraries we used were very old. In addition, making sure that the autocompletion was fast became a struggle later in the project. To add, we ran into problems getting the product to be bug-free when running cross-platform. Specifically, this came when getting Clangpletion working on Linux.
Accomplishments We Are Proud Of
We are proud of having one of the few autocomplete engines for C that is cross platform for Windows and Linux machines! We are also proud of having a functional autocomplete engine that runs completely in the background without slowing down productivity.
What We Learned
We learned that documentation is extremely important when it comes to understanding older software, especially things that don't have a lot of forum posts on to supplement. We also learned that being cross compatible can make a project much more challenging, primarily with different standards for compiled libraries.
What's next for Clangpletion
Next, we would like to extend into pre-compiled headers and function argument guidance. Finally, honing in on the syntax suggestions would make this truly a great alternative to larger autocomplete engines for other languages in Vim.
Log in or sign up for Devpost to join the conversation.