C++: Add a snippet to generate an entire .h skeleton

This commit is contained in:
Laurent Georget 2016-04-02 11:15:17 +02:00
parent ae142259cd
commit c133679866

View File

@ -54,4 +54,20 @@ snippet tp "template <typename ..> (template)"
template <typename ${1:_InputIter}> template <typename ${1:_InputIter}>
endsnippet endsnippet
snippet cla "An entire .h generator" b
#ifndef ${2:`!v substitute(vim_snippets#Filename('$1_H','ClassName'),'.*','\U&\E','')`}
#define $2
class ${1:`!v substitute(substitute(vim_snippets#Filename('$1','ClassName'),'^.','\u&',''), '_\(\w\)', '\u\1', 'g')`}
{
private:
${3}
public:
$1();
virtual ~$1();
};
#endif /* $2 */
endsnippet
# vim:ft=snippets: # vim:ft=snippets: