[ADD][VIM] C header guard snippet
This commit is contained in:
parent
0178fe9c44
commit
99c5a8148c
14
vim/.vim/UltiSnips/c.snippets
Normal file
14
vim/.vim/UltiSnips/c.snippets
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
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
|
Loading…
Reference in a new issue