dotfiles/vim/snippets/c.snippets

88 lines
1.4 KiB
Text
Raw Normal View History

2014-04-13 08:03:02 -07:00
# v.snippets
# vim: set ts=8 sw=8 sts=8 noet list:
# Eryn Wells <eryn@erynwells.me>
snippet uint
unsigned int
snippet uchar
unsigned char
snippet ulong
unsigned long
snippet head
2014-04-13 08:03:02 -07:00
/* ${1:`expand('%:t')`}
* vim: set ${2:tw=80}:
* `g:snips_author`
*/
2014-04-13 08:03:02 -07:00
/**
* ${3:File description.}
*/
2014-03-15 00:12:27 -07:00
2014-04-13 08:03:02 -07:00
${4}
snippet main
int
main(int argc,
char* argv[])
{
${1}
return 0;
}
snippet mainn
int
main()
{
${1}
return 0;
}
snippet pragma Ignore warning
#pragma clang diagnostic push
#pragma clang diagnostic ignore "${1}"
2014-04-13 08:03:02 -07:00
${2}
#pragma clang diagnostic pop
2014-03-15 00:12:27 -07:00
snippet once
2014-04-13 08:03:02 -07:00
#ifndef ${1:__`toupper(substitute(expand('%:t'), '\.', '_', ''))`__}
2014-03-15 00:12:27 -07:00
#define $1
${2}
#endif /* $1 */
2014-04-13 08:03:02 -07:00
snippet dc Method Header
2014-03-15 00:12:27 -07:00
/*
* ${1:Function} --
2014-04-13 08:03:02 -07:00
*/${2}
snippet dc Method Description
2014-04-04 21:27:13 -07:00
/**
2014-04-13 08:03:02 -07:00
* ${1:Description}
*/${2}
snippet dc One-line description
/** ${1:Description} */${0}
snippet dcs
@see ${1:SomeOtherEntity}
snippet dcp
@param [${1:in}] ${2:Description}
snippet dcr
@return ${1:Return value}
snippet m Generic method
${1:void}
${2:Class}::${3:Function}(${4:/* args */})
2014-03-15 00:12:27 -07:00
{
2014-04-13 08:03:02 -07:00
${5}
2014-03-15 00:12:27 -07:00
}
2014-04-13 08:03:02 -07:00
snippet m Getter
${1:Type}
${2:Class}::Get${3:VarName}()
const
{
return m${4:$3};
}${0}
snippet m Setter
void
${1:Class}::Set${2:VarName}(${3:Type} ${4:var})
{
m${5:$4} = $4;
}${0}
snippet md Getter/Setter
${1:Type} Get${2:VarName}() const;
void Set${3:$2}(${1} ${4:var});