mirror of
https://github.com/amix/vimrc
synced 2025-07-19 18:14:59 +08:00
merge
This commit is contained in:
@ -1,3 +1,13 @@
|
||||
extends c
|
||||
|
||||
##
|
||||
## Preprocessor
|
||||
# #include <...>
|
||||
snippet incc
|
||||
#include <${1:iostream}>
|
||||
snippet binc
|
||||
#include <boost/${1:shared_ptr}.hpp>
|
||||
##
|
||||
## STL Collections
|
||||
# std::array
|
||||
snippet array
|
||||
@ -68,20 +78,61 @@ snippet mu
|
||||
## Class
|
||||
# class
|
||||
snippet cl
|
||||
/*! \class $1
|
||||
* \brief ${3:Brief class description}
|
||||
*
|
||||
* ${4:Detailed description}
|
||||
*/
|
||||
class ${1:`vim_snippets#Filename('$1', 'name')`}
|
||||
{
|
||||
public:
|
||||
$1(${2});
|
||||
~$1();
|
||||
virtual ~$1();
|
||||
|
||||
private:
|
||||
${0:/* data */}
|
||||
protected:
|
||||
m_${5}; /*!< ${6:Member description} */
|
||||
};
|
||||
# member function implementation
|
||||
snippet mfun
|
||||
${4:void} ${1:`vim_snippets#Filename('$1', 'ClassName')`}::${2:memberFunction}(${3}) {
|
||||
${0}
|
||||
}
|
||||
# member function implementation without parameters
|
||||
snippet dmfun0
|
||||
/*! \brief ${4:Brief function description here}
|
||||
*
|
||||
* ${5:Detailed description}
|
||||
*
|
||||
* \return ${6:Return parameter description}
|
||||
*/
|
||||
${3:void} ${1:`vim_snippets#Filename('$1', 'ClassName')`}::${2:memberFunction}() {
|
||||
${0}
|
||||
}
|
||||
# member function implementation with one parameter
|
||||
snippet dmfun1
|
||||
/*! \brief ${6:Brief function description here}
|
||||
*
|
||||
* ${7:Detailed description}
|
||||
*
|
||||
* \param $4 ${8:Parameter description}
|
||||
* \return ${9:Return parameter description}
|
||||
*/
|
||||
${5:void} ${1:`vim_snippets#Filename('$1', 'ClassName')`}::${2:memberFunction}(${3:Type} ${4:Parameter}) {
|
||||
${0}
|
||||
}
|
||||
# member function implementation with two parameter
|
||||
snippet dmfun2
|
||||
/*! \brief ${8:Brief function description here}
|
||||
*
|
||||
* ${9:Detailed description}
|
||||
*
|
||||
* \param $4 ${10:Parameter description}
|
||||
* \param $6 ${11:Parameter description}
|
||||
* \return ${12:Return parameter description}
|
||||
*/
|
||||
${7:void} ${1:`vim_snippets#Filename('$1', 'ClassName')`}::${2:memberFunction}(${3:Type} ${4:Parameter},${5:Type} ${6:Parameter}) {
|
||||
${0}
|
||||
}
|
||||
# namespace
|
||||
snippet ns
|
||||
namespace ${1:`vim_snippets#Filename('', 'my')`} {
|
||||
@ -96,6 +147,19 @@ snippet cout
|
||||
snippet cin
|
||||
std::cin >> ${1};
|
||||
##
|
||||
## Casts
|
||||
# static
|
||||
snippet sca
|
||||
static_cast<${1:unsigned}>(${2:expr})${3}
|
||||
# dynamic
|
||||
snippet dca
|
||||
dynamic_cast<${1:unsigned}>(${2:expr})${3}
|
||||
# reinterpret
|
||||
snippet rca
|
||||
reinterpret_cast<${1:unsigned}>(${2:expr})${3}
|
||||
# const
|
||||
snippet cca
|
||||
const_cast<${1:unsigned}>(${2:expr})${3}
|
||||
## Iteration
|
||||
# for i
|
||||
snippet fori
|
||||
@ -123,9 +187,19 @@ snippet itera
|
||||
## Lambdas
|
||||
# lamda (one line)
|
||||
snippet ld
|
||||
[${1}](${2}){${3}}
|
||||
[${1}](${2}){${3}};
|
||||
# lambda (multi-line)
|
||||
snippet lld
|
||||
[${1}](${2}){
|
||||
${3}
|
||||
};
|
||||
# snippets exception
|
||||
snippet try
|
||||
try {
|
||||
|
||||
}catch(${1}) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user