ProtoDef : Tool to help create skeleton implementations of c++ function prototypes
| script karma
Downloaded by 2321
Comments, bugs, improvements
script versions (upload new version)
- ctags 5.7 or greater
- PERL (just PERL, you don't need to have Vim compiled with PERL support)
- FSwitch Vim utility (vimscript #2590)
Check out the video demo at: http://www.vimeo.com/4448265
You've got a C++ header file and you've got some prototypes declared in there. Now you need to create some definitions in a C++ implementation file. What do you do? Yank and paste? Naw :) Use this plugin instead...
The concept is pretty simple: while in the implementation file, you hit a key and all of the currently undefined function prototypes in the header file are automatically pulled in to the implementation file and inserted at the current cursor position.
- Pure virtual functions are ignored
- Functions that are already defined in the header file are ignored
- Free functions are brought in
- Class name is automatically prefixed to member functions
- Constructors and Destructors sort first
- Only the missing items are pulled in so you can use this utility to bring the implementation file up to match the contents of the header file
- However you format the prototype shouldn't really make a difference. ProtoDef endeavours to reduce all declarations to a canonical form.
ProtoDef can now be found on GitHub: http://github.com/derekwyatt/vim-protodef
|- Extract the archive.
- put doc/protodef.txt into ~/.vim/doc
- put plugin/protodef.vim into ~/.vim/plugin
- :helptags ~/.vim/doc
- read protodef.txt and follow what's in the Setup section to understand what to do with the pullproto.pl file.
Click on the package to download.
ip used for rating: 126.96.36.199
||Fixed up a regular expression so it matches pointers and references better (pointers and references attached to the name instead of the type, which is hideous). (Paolo Capriotti)
|| - Made sure that we need at least 7.0 (Timon Kelter)
- Introduced the disable_protodef_sorting variable.
- Added a fix to deal with default parameters that were class
instances (e.g. MyClass()) (Matt Spear)
- Fixed function prototype parsing in pullproto.pl such that regex
special characters are deal with nicely (Matt Spear)
- Handle template specializations properly (Matt Spear)
- Ensure that implementations in the header file but outside the class
definition are not brought in to the implementation (Dmitry Bashkatov)
||Fixed a bug in the autocmd where the ".C" extension was written as ",C"
||Added the ability to ignore the namespace (e.g. if you define a namespace block and don't need the prototypes to be prefixed with the namespace).
||Fixed issue with nested classes.