Last active
April 18, 2020 00:07
-
-
Save madskjeldgaard/19ec486bfd854dfd6e0806e885c57948 to your computer and use it in GitHub Desktop.
Simple and sensible snippet for openframeworks classes in Vim/Ultisnips
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
snippet ofclass "Class for open frameworks" | |
#include "${1:`!p snip.rv = snip.basename`}.h" | |
$1::$1(){} | |
void $1::setup(){${2:}} | |
void $1::update(){${3:}} | |
void $1::draw(){${4:}} | |
endsnippet | |
snippet ofheader "Header for open frameworks class" | |
#ifndef ${1:`!p snip.rv = "_" + snip.basename.upper()`} | |
#define $1 | |
#include "ofMain.h" | |
class ${2:`!p snip.rv = snip.basename`} { | |
public: | |
void setup(); | |
void update(); | |
void draw(); | |
$2(); // constructor | |
${0} | |
private: | |
}; | |
#endif | |
endsnippet |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Place in one of your ultisnips folders, type
ofheader
and hit tab orofclass
and hit tab