-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
243 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
diff --git a/snippets/c.snippets b/snippets/c.snippets | ||
index c476de4..f89790b 100644 | ||
--- a/snippets/c.snippets | ||
+++ b/snippets/c.snippets | ||
@@ -42,8 +42,11 @@ snippet #if | ||
# header include guard | ||
snippet once | ||
#ifndef ${1:`toupper(Filename('$1_H', 'UNTITLED_H'))`} | ||
- | ||
#define $1 | ||
+ /* | ||
+ * Created by ${2:`g:snips_author`} on `strftime("%Y-%m-%d %H:%M:%S")`. | ||
+ * All rights reserved. | ||
+ */ | ||
|
||
${2} | ||
|
||
@@ -233,3 +236,9 @@ snippet gpl | ||
*/ | ||
|
||
${2} | ||
+ | ||
+# comment | ||
+snippet com | ||
+ /* | ||
+ * ${1} | ||
+ * */ |
167 changes: 167 additions & 0 deletions
167
vim/bundle/snipmate-snippets/patches/cpp.snippets.patch
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
diff --git a/snippets/cpp.snippets b/snippets/cpp.snippets | ||
index c3e19fe..00501a9 100644 | ||
--- a/snippets/cpp.snippets | ||
+++ b/snippets/cpp.snippets | ||
@@ -1,5 +1,27 @@ | ||
+## Documentation | ||
+snippet doc | ||
+ /* | ||
+ * ${1:function()} | ||
+ * Created by ${2:`g:snips_author`} on `strftime("%Y-%m-%d %H:%M:%S")`. | ||
+ * | ||
+ * Description: | ||
+ * ${3:Function/Method Description} | ||
+ * Parameters: | ||
+ * ${4:input parameters} | ||
+ * Returns: | ||
+ * ${5:return value} | ||
+ * Throws: | ||
+ * ${6:Exceptions} | ||
+ */ | ||
+snippet top | ||
+ // `expand('%:t')` | ||
+ // Created by ${1:`g:snips_author`} on `strftime("%Y-%m-%d %H:%M:%S")`. | ||
+ // All rights reserved. | ||
+ | ||
+ | ||
## STL Collections | ||
# std::array | ||
+ | ||
snippet array | ||
std::array<${1:T}, ${2:N}> ${3};${4} | ||
# std::vector | ||
@@ -64,30 +86,119 @@ snippet fr | ||
# mutable | ||
snippet mu | ||
mutable | ||
-## | ||
-## Class | ||
-# class | ||
+## | ||
+## Classes | ||
+## | ||
snippet cl | ||
- class ${1:`Filename('$1', 'name')`} | ||
+ class ${1:`Filename('$1', 'name')`} | ||
{ | ||
+ // ---------- friend classes and functions --------------- | ||
public: | ||
+ // ---------- constants, enums and typedefs -------------- | ||
+ | ||
+ // ---------- Constructors and destructor ---------------- | ||
$1(${2}); | ||
- ~$1(); | ||
+ //virtual ~$1(); | ||
+ | ||
+ // ---------- member functions --------------------------- | ||
+ | ||
+ // ---------- const member functions --------------------- | ||
+ | ||
+ // ---------- static member functions -------------------- | ||
+ | ||
+ protected: | ||
+ // ---------- protected member functions ----------------- | ||
+ | ||
+ // ---------- protected const member functions ----------- | ||
|
||
private: | ||
- ${3:/* data */} | ||
+ // ---------- Constructors and destructor ---------------- | ||
+ $1( const $1& src ); // copy-ctor, stop default | ||
+ | ||
+ // ---------- assignment operator(s) --------------------- | ||
+ const $1& operator=( const $1& rhs ); // stop default | ||
+ | ||
+ // ---------- private member functions ------------------- | ||
+ | ||
+ // ---------- private const member functions ------------- | ||
+ | ||
+ // ---------- data members ------------------------------- | ||
+ | ||
+ // ---------- static data members ------------------------ | ||
}; | ||
# member function implementation | ||
snippet mfun | ||
${4:void} ${1:`Filename('$1', 'ClassName')`}::${2:memberFunction}(${3}) { | ||
${5:/* code */} | ||
} | ||
+snippet tcl | ||
+ template <typename T> | ||
+ class ${1:`Filename('$1', 'name')`} | ||
+ { | ||
+ // ---------- friend classes and functions --------------- | ||
+ public: | ||
+ // ---------- constants, enums and typedefs -------------- | ||
+ | ||
+ // ---------- Constructors and destructor ---------------- | ||
+ $1(${2}); | ||
+ //virtual ~$1(); | ||
+ | ||
+ // ---------- member functions --------------------------- | ||
+ | ||
+ // ---------- const member functions --------------------- | ||
+ | ||
+ // ---------- static member functions -------------------- | ||
+ | ||
+ protected: | ||
+ // ---------- protected member functions ----------------- | ||
+ | ||
+ // ---------- protected const member functions ----------- | ||
+ | ||
+ private: | ||
+ // ---------- Constructors and destructor ---------------- | ||
+ $1( const $1<T>& src ); // copy-ctor, stop default | ||
+ | ||
+ // ---------- assignment operator(s) --------------------- | ||
+ const $1<T>& operator=( const $1<T>& rhs ); // stop default | ||
+ | ||
+ // ---------- private member functions ------------------- | ||
+ | ||
+ // ---------- private const member functions ------------- | ||
+ | ||
+ // ---------- data members ------------------------------- | ||
+ | ||
+ // ---------- static data members ------------------------ | ||
+ }; | ||
+# member function implementation | ||
+snippet mtfun | ||
+ template <typename T> | ||
+ ${4:void} | ||
+ ${1:`Filename('$1', 'ClassName')`}<T>::${2:memberFunction}(${3}) { | ||
+ ${5:/* code */} | ||
+ } | ||
# namespace | ||
snippet ns | ||
namespace ${1:`Filename('', 'my')`} { | ||
${2} | ||
} /* namespace $1 */ | ||
## | ||
+## Pointers and casts | ||
+## | ||
+snippet sptr | ||
+ shared_ptr<$1> | ||
+snippet uptr | ||
+ unique_ptr<$1> | ||
+ | ||
+snippet ccast | ||
+ const_cast<$1>($2) | ||
+snippet scast | ||
+ static_cast<$1>($2) | ||
+snippet rcast | ||
+ reinterpret_cast<$1>($2) | ||
+snippet dcast | ||
+ dynamic_cast<$1>($2) | ||
+ | ||
+## | ||
## Input/Output | ||
# std::cout | ||
snippet cout | ||
@@ -97,7 +208,7 @@ snippet cin | ||
std::cin >> ${1};${2} | ||
## | ||
## Iteration | ||
-# for i | ||
+# for i | ||
snippet fori | ||
for (int ${2:i} = 0; $2 < ${1:count}; $2${3:++}) { | ||
${4:/* code */} |
28 changes: 28 additions & 0 deletions
28
vim/bundle/snipmate-snippets/patches/python.snippets.patch
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
diff --git a/snippets/python.snippets b/snippets/python.snippets | ||
index dd2e812..dee3bec 100644 | ||
--- a/snippets/python.snippets | ||
+++ b/snippets/python.snippets | ||
@@ -1,5 +1,23 @@ | ||
snippet #! | ||
#!/usr/bin/env python | ||
+ #-*- coding: utf-8 -*- | ||
+ #pylint: disable-msg= | ||
+ """ | ||
+ File : ${1:`Filename('$1.py', 'foo.py')`} | ||
+ Author : ${2:`g:snips_author`} | ||
+ Description: ${3} | ||
+ """ | ||
+ | ||
+ # system modules | ||
+ import os | ||
+ import sys | ||
+ | ||
+ def main(): | ||
+ "Main function" | ||
+ pass | ||
+ | ||
+ if __name__ == '__main__': | ||
+ main() | ||
snippet imp | ||
import ${1:module} | ||
snippet from |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
diff --git a/snippets/rst.snippets b/snippets/rst.snippets | ||
index 97845de..e294afa 100644 | ||
--- a/snippets/rst.snippets | ||
+++ b/snippets/rst.snippets | ||
@@ -20,3 +20,16 @@ snippet - | ||
snippet cont: | ||
.. contents:: | ||
|
||
+snippet cb | ||
+ .. code-block:: ${1:python} | ||
+ | ||
+ ${2:code} | ||
+ | ||
+ $0 | ||
+snippet toc | ||
+ .. toctree:: | ||
+ :maxdepth: ${1:2} | ||
+snippet ref | ||
+ \`${1:ref} <${2:url}>\`_ | ||
+snippet v | ||
+ \`\`${1:variable}\`\` |