dot-files/vim/.vim/UltiSnips/c.snippets

15 lines
253 B
Plaintext

snippet once "Include header once only guard"
#ifndef ${1:`!p
if not snip.c:
import random, string
name = re.sub(r'[^A-Za-z0-9]+','_', snip.fn).upper()
snip.rv = name.upper()
else:
snip.rv = snip.c`}
#define $1
${0}
#endif /* !$1 */
endsnippet