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