Nvim-Cpp-Tools is a plugin to give more functionality than Clangd can do natively With this Plugin you can auto generate .cpp imeplementation from a .hpp, hxx, h file Remove unused includes. This plugin is developed using Treesitter
These are the requirements of the functionalities that I would like the plugin to have This is what i expect, if you have some suggestion contact me via mail.
- Must be able to remove unused includes.
- Must be able to allow to implement the inheritance methods that could have override the pure virtual parent methods.
- Read attributes and set them to be automatically initialized in the constructor as if it had a parent.
- Template classes
- Ask you in which path you want to create the file.
- Initialize the attributes of the class with the parameters of the constructor, the search must be by type, if there are several parameters of that type, make a comparison by name, if it does not contain the text, the first attribute found of the same type is put.
- Generate getters and setters
- Select a method and generate it.
- Allows to select a method and generate a local variable or attribute from the return of the function.
- Allows to mark (v) a block of code and export it in a function intuiting what kind of return is needed.
- It must allow that if a method returns a variable, it allows to generate a variable of the return type with a default name.
- The plugin must be able to refactor a class, change any comment of the class and put the new name in all the classes that use it.
{
"shadowchiki/nvim-cpp-tools",
dependencies = {
"nvim-treesitter/nvim-treesitter",
},
config = function()
require("nvim-cpp-tools")
end,
}
Name | Description | Command |
---|---|---|
Remove Unused Includes | Remove the unsued includes detected in a file | :RemoveUnusedIncludes |
Generate Cpp Implementation | Creates a complete implementation of a header file to a implementation file | :GenerateCppImplementation |
Generate Method Implementation | Creates a implementation of a method from header file to a implementation file | :GenerateMethodImplementation |
Keymap | Command |
---|---|
<leader>co | :RemoveUnusedIncludes |
<leader>ci | :GenerateCppImplementation |
<leader>cI | :GenerateMethodImplementation |