diff options
Diffstat (limited to '.emacs.d/mysnippets/text-mode/cc-mode')
31 files changed, 227 insertions, 0 deletions
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/c++-mode/beginend b/.emacs.d/mysnippets/text-mode/cc-mode/c++-mode/beginend new file mode 100644 index 0000000..68303e2 --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/c++-mode/beginend | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | #name : v.begin(), v.end() | ||
| 2 | # -- | ||
| 3 | ${1:v}.begin(), $1.end \ No newline at end of file | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/c++-mode/class b/.emacs.d/mysnippets/text-mode/cc-mode/c++-mode/class new file mode 100644 index 0000000..820fc6c --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/c++-mode/class | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | #name : class ... { ... } | ||
| 2 | # -- | ||
| 3 | class ${1:Name} | ||
| 4 | { | ||
| 5 | public: | ||
| 6 | ${1:$(yas/substr text "[^: ]*")}($2); | ||
| 7 | virtual ~${1:$(yas/substr text "[^: ]*")}(); | ||
| 8 | }; \ No newline at end of file | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/c++-mode/ns b/.emacs.d/mysnippets/text-mode/cc-mode/c++-mode/ns new file mode 100644 index 0000000..0c2513f --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/c++-mode/ns | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | #name : namespace ... | ||
| 2 | # -- | ||
| 3 | namespace \ No newline at end of file | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/c++-mode/template b/.emacs.d/mysnippets/text-mode/cc-mode/c++-mode/template new file mode 100644 index 0000000..7e50616 --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/c++-mode/template | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | #name : template <typename ...> | ||
| 2 | # -- | ||
| 3 | template <typename ${T}> \ No newline at end of file | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/c++-mode/using b/.emacs.d/mysnippets/text-mode/cc-mode/c++-mode/using new file mode 100644 index 0000000..13d0f5d --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/c++-mode/using | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #name : using namespace ... | ||
| 2 | # -- | ||
| 3 | using namespace ${std}; | ||
| 4 | $0 \ No newline at end of file | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/c-mode/fopen b/.emacs.d/mysnippets/text-mode/cc-mode/c-mode/fopen new file mode 100644 index 0000000..044c743 --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/c-mode/fopen | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | #name : FILE *fp = fopen(..., ...); | ||
| 2 | # -- | ||
| 3 | FILE *${fp} = fopen(${"file"}, "${r}"); | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/c-mode/printf b/.emacs.d/mysnippets/text-mode/cc-mode/c-mode/printf new file mode 100644 index 0000000..055461d --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/c-mode/printf | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name : printf | ||
| 3 | # contributor : joaotavora | ||
| 4 | # -- | ||
| 5 | printf ("${1:%s}\\n"${1:$(if (string-match "%" text) "," "\);") | ||
| 6 | }$2${1:$(if (string-match "%" text) "\);" "")} \ No newline at end of file | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/attrib b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/attrib new file mode 100644 index 0000000..9e14e22 --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/attrib | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | #contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> | ||
| 2 | #name : private attribute ....; | ||
| 3 | # -- | ||
| 4 | /// <summary> | ||
| 5 | /// $3 | ||
| 6 | /// </summary> | ||
| 7 | private $1 $2; | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/attrib.1 b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/attrib.1 new file mode 100644 index 0000000..099cc7b --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/attrib.1 | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | #contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> | ||
| 2 | #name : private attribute ....; public property ... ... { ... } | ||
| 3 | # -- | ||
| 4 | /// <summary> | ||
| 5 | /// $3 | ||
| 6 | /// </summary> | ||
| 7 | private $1 $2; | ||
| 8 | |||
| 9 | /// <summary> | ||
| 10 | /// $4 | ||
| 11 | /// </summary> | ||
| 12 | /// <value>$5</value> | ||
| 13 | public $1 $2 | ||
| 14 | { | ||
| 15 | get { | ||
| 16 | return this.$2; | ||
| 17 | } | ||
| 18 | set { | ||
| 19 | this.$2 = value; | ||
| 20 | } | ||
| 21 | } | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/attrib.2 b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/attrib.2 new file mode 100644 index 0000000..566eacf --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/attrib.2 | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | #contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> | ||
| 2 | #name : private _attribute ....; public Property ... ... { ... } | ||
| 3 | # -- | ||
| 4 | /// <summary> | ||
| 5 | /// $3 | ||
| 6 | /// </summary> | ||
| 7 | private $1 ${2:$(if (> (length text) 0) (format "_%s%s" (downcase (substring text 0 1)) (substring text 1 (length text))) "")}; | ||
| 8 | |||
| 9 | /// <summary> | ||
| 10 | /// ${3:Description} | ||
| 11 | /// </summary> | ||
| 12 | /// <value><c>$1</c></value> | ||
| 13 | public ${1:Type} ${2:Name} | ||
| 14 | { | ||
| 15 | get { | ||
| 16 | return this.${2:$(if (> (length text) 0) (format "_%s%s" (downcase (substring text 0 1)) (substring text 1 (length text))) "")}; | ||
| 17 | } | ||
| 18 | set { | ||
| 19 | this.${2:$(if (> (length text) 0) (format "_%s%s" (downcase (substring text 0 1)) (substring text 1 (length text))) "")} = value; | ||
| 20 | } | ||
| 21 | } | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/class b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/class new file mode 100644 index 0000000..1cce2e8 --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/class | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | #contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> | ||
| 2 | #name : class ... { ... } | ||
| 3 | # -- | ||
| 4 | ${5:public} class ${1:Name} | ||
| 5 | { | ||
| 6 | #region Ctor & Destructor | ||
| 7 | /// <summary> | ||
| 8 | /// ${3:Standard Constructor} | ||
| 9 | /// </summary> | ||
| 10 | public $1($2) | ||
| 11 | { | ||
| 12 | } | ||
| 13 | |||
| 14 | /// <summary> | ||
| 15 | /// ${4:Default Destructor} | ||
| 16 | /// </summary> | ||
| 17 | public ~$1() | ||
| 18 | { | ||
| 19 | } | ||
| 20 | #endregion | ||
| 21 | } | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/comment b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/comment new file mode 100644 index 0000000..3bd20d3 --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/comment | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> | ||
| 2 | #name : /// <summary> ... </summary> | ||
| 3 | # -- | ||
| 4 | /// <summary> | ||
| 5 | /// $1 | ||
| 6 | /// </summary> | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/comment.1 b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/comment.1 new file mode 100644 index 0000000..3c14ad9 --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/comment.1 | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> | ||
| 2 | #name : /// <param name="..."> ... </param> | ||
| 3 | # -- | ||
| 4 | /// <param name="$1">$2</param> | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/comment.2 b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/comment.2 new file mode 100644 index 0000000..63a6a20 --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/comment.2 | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> | ||
| 2 | #name : /// <param name="..."> ... </param> | ||
| 3 | # -- | ||
| 4 | /// <returns>$1</returns> | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/comment.3 b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/comment.3 new file mode 100644 index 0000000..394c323 --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/comment.3 | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> | ||
| 2 | #name : /// <exception cref="..."> ... </exception> | ||
| 3 | # -- | ||
| 4 | /// <exception cref="$1">$2</exception> | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/method b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/method new file mode 100644 index 0000000..e9a5906 --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/method | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | #contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> | ||
| 2 | #name : public void Method { ... } | ||
| 3 | # -- | ||
| 4 | /// <summary> | ||
| 5 | /// ${5:Description} | ||
| 6 | /// </summary>${2:$(if (string= (upcase text) "VOID") "" (format "%s%s%s" "\n/// <returns><c>" text "</c></returns>"))} | ||
| 7 | ${1:public} ${2:void} ${3:MethodName}($4) | ||
| 8 | { | ||
| 9 | $0 | ||
| 10 | } | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/namespace b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/namespace new file mode 100644 index 0000000..af7c928 --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/namespace | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | #contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> | ||
| 2 | #name : namespace .. { ... } | ||
| 3 | # -- | ||
| 4 | namespace $1 | ||
| 5 | { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/prop b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/prop new file mode 100644 index 0000000..df9df91 --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/prop | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | #contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> | ||
| 2 | #name : property ... ... { ... } | ||
| 3 | # -- | ||
| 4 | /// <summary> | ||
| 5 | /// $5 | ||
| 6 | /// </summary> | ||
| 7 | /// <value>$6</value> | ||
| 8 | $1 $2 $3 | ||
| 9 | { | ||
| 10 | get { | ||
| 11 | return this.$4; | ||
| 12 | } | ||
| 13 | set { | ||
| 14 | this.$4 = value; | ||
| 15 | } | ||
| 16 | } | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/region b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/region new file mode 100644 index 0000000..83f9a24 --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/region | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> | ||
| 2 | #name : #region ... #endregion | ||
| 3 | # -- | ||
| 4 | #region $1 | ||
| 5 | $0 | ||
| 6 | #endregion | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/using b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/using new file mode 100644 index 0000000..704637e --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/using | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> | ||
| 2 | #name : using ...; | ||
| 3 | # -- | ||
| 4 | using $1; | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/using.1 b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/using.1 new file mode 100644 index 0000000..e9f0bb0 --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/using.1 | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> | ||
| 2 | #name : using System; | ||
| 3 | # -- | ||
| 4 | using System; | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/using.2 b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/using.2 new file mode 100644 index 0000000..0a3c07d --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/csharp-mode/using.2 | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #contributor : Alejandro Espinoza Esparza <aespinoza@structum.com.mx> | ||
| 2 | #name : using System....; | ||
| 3 | # -- | ||
| 4 | using System.$1; | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/do b/.emacs.d/mysnippets/text-mode/cc-mode/do new file mode 100644 index 0000000..5f7a313 --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/do | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #name : do { ... } while (...) | ||
| 2 | # -- | ||
| 3 | do | ||
| 4 | { | ||
| 5 | $0 | ||
| 6 | } while (${1:condition}); \ No newline at end of file | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/for b/.emacs.d/mysnippets/text-mode/cc-mode/for new file mode 100644 index 0000000..c4cade6 --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/for | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #name : for (...; ...; ...) { ... } | ||
| 2 | # -- | ||
| 3 | for (${1:int i = 0}; ${2:i < N}; ${3:++i}) | ||
| 4 | { | ||
| 5 | $0 | ||
| 6 | } \ No newline at end of file | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/if b/.emacs.d/mysnippets/text-mode/cc-mode/if new file mode 100644 index 0000000..c3fe10d --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/if | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #name : if (...) { ... } | ||
| 2 | # -- | ||
| 3 | if (${1:condition}) | ||
| 4 | { | ||
| 5 | $0 | ||
| 6 | } \ No newline at end of file | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/inc b/.emacs.d/mysnippets/text-mode/cc-mode/inc new file mode 100644 index 0000000..ae33328 --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/inc | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | #name : #include "..." | ||
| 2 | # -- | ||
| 3 | #include "$1" | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/inc.1 b/.emacs.d/mysnippets/text-mode/cc-mode/inc.1 new file mode 100644 index 0000000..66326cd --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/inc.1 | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | #name : #include <...> | ||
| 2 | # -- | ||
| 3 | #include <$1> | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/main b/.emacs.d/mysnippets/text-mode/cc-mode/main new file mode 100644 index 0000000..9249049 --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/main | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | #name: int main(argc, argv) { ... } | ||
| 2 | # -- | ||
| 3 | int main(int argc, char *argv[]) | ||
| 4 | { | ||
| 5 | $0 | ||
| 6 | return 0; | ||
| 7 | } | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/objc-mode/prop b/.emacs.d/mysnippets/text-mode/cc-mode/objc-mode/prop new file mode 100644 index 0000000..4d585db --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/objc-mode/prop | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | #name : foo { ... } ; setFoo { ... } | ||
| 2 | # -- | ||
| 3 | - (${1:id})${2:foo} | ||
| 4 | { | ||
| 5 | return $2; | ||
| 6 | } | ||
| 7 | |||
| 8 | - (void)set${2:$(capitalize text)}:($1)aValue | ||
| 9 | { | ||
| 10 | [$2 autorelease]; | ||
| 11 | $2 = [aValue retain]; | ||
| 12 | } | ||
| 13 | $0 \ No newline at end of file | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/once b/.emacs.d/mysnippets/text-mode/cc-mode/once new file mode 100644 index 0000000..1b63c39 --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/once | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | #name : #ifndef XXX; #define XXX; #endif | ||
| 2 | # -- | ||
| 3 | #ifndef ${1:_`(upcase (file-name-nondirectory (file-name-sans-extension (buffer-file-name))))`_H_} | ||
| 4 | #define $1 | ||
| 5 | |||
| 6 | $0 | ||
| 7 | |||
| 8 | #endif /* $1 */ \ No newline at end of file | ||
diff --git a/.emacs.d/mysnippets/text-mode/cc-mode/struct b/.emacs.d/mysnippets/text-mode/cc-mode/struct new file mode 100644 index 0000000..f50dabf --- /dev/null +++ b/.emacs.d/mysnippets/text-mode/cc-mode/struct | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #name : struct ... { ... } | ||
| 2 | # -- | ||
| 3 | struct ${1:name} | ||
| 4 | { | ||
| 5 | $0 | ||
| 6 | }; \ No newline at end of file | ||
