Skip to content

Commit

Permalink
Merge pull request honza#710 from lgeorget/master
Browse files Browse the repository at this point in the history
C++: Add a snippet to generate an entire .h skeleton
  • Loading branch information
lpil committed Apr 7, 2016
2 parents ae14225 + c133679 commit ee4a8e9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions UltiSnips/cpp.snippets
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,20 @@ snippet tp "template <typename ..> (template)"
template <typename ${1:_InputIter}>
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:

0 comments on commit ee4a8e9

Please sign in to comment.