summaryrefslogtreecommitdiff
path: root/.emacs.d/snippets/c-mode
diff options
context:
space:
mode:
Diffstat (limited to '.emacs.d/snippets/c-mode')
-rw-r--r--.emacs.d/snippets/c-mode/.yas-parents1
-rw-r--r--.emacs.d/snippets/c-mode/assert6
-rw-r--r--.emacs.d/snippets/c-mode/compile5
-rw-r--r--.emacs.d/snippets/c-mode/define5
-rw-r--r--.emacs.d/snippets/c-mode/fopen4
-rw-r--r--.emacs.d/snippets/c-mode/malloc6
-rw-r--r--.emacs.d/snippets/c-mode/packed5
-rw-r--r--.emacs.d/snippets/c-mode/printf5
-rw-r--r--.emacs.d/snippets/c-mode/stdio5
-rw-r--r--.emacs.d/snippets/c-mode/stdlib5
-rw-r--r--.emacs.d/snippets/c-mode/string5
-rw-r--r--.emacs.d/snippets/c-mode/switch11
-rw-r--r--.emacs.d/snippets/c-mode/union7
-rw-r--r--.emacs.d/snippets/c-mode/unistd5
14 files changed, 75 insertions, 0 deletions
diff --git a/.emacs.d/snippets/c-mode/.yas-parents b/.emacs.d/snippets/c-mode/.yas-parents
new file mode 100644
index 0000000..ce9828b
--- /dev/null
+++ b/.emacs.d/snippets/c-mode/.yas-parents
@@ -0,0 +1 @@
cc-mode
diff --git a/.emacs.d/snippets/c-mode/assert b/.emacs.d/snippets/c-mode/assert
new file mode 100644
index 0000000..964205e
--- /dev/null
+++ b/.emacs.d/snippets/c-mode/assert
@@ -0,0 +1,6 @@
1# -*- mode: snippet -*-
2# name: assert
3# key: ass
4# --
5#include <assert.h>
6$0 \ No newline at end of file
diff --git a/.emacs.d/snippets/c-mode/compile b/.emacs.d/snippets/c-mode/compile
new file mode 100644
index 0000000..8246a10
--- /dev/null
+++ b/.emacs.d/snippets/c-mode/compile
@@ -0,0 +1,5 @@
1# -*- mode: snippet -*-
2# name: compile
3# key: compile
4# --
5// -*- compile-command: "${1:gcc -Wall -o ${2:dest} ${3:file}}" -*- \ No newline at end of file
diff --git a/.emacs.d/snippets/c-mode/define b/.emacs.d/snippets/c-mode/define
new file mode 100644
index 0000000..9d5c5dd
--- /dev/null
+++ b/.emacs.d/snippets/c-mode/define
@@ -0,0 +1,5 @@
1# -*- mode: snippet -*-
2# name: define
3# key: d
4# --
5#define $0 \ No newline at end of file
diff --git a/.emacs.d/snippets/c-mode/fopen b/.emacs.d/snippets/c-mode/fopen
new file mode 100644
index 0000000..0e48c21
--- /dev/null
+++ b/.emacs.d/snippets/c-mode/fopen
@@ -0,0 +1,4 @@
1#name : FILE *fp = fopen(..., ...);
2# key: fopen
3# --
4FILE *${fp} = fopen(${"file"}, "${r}"); \ No newline at end of file
diff --git a/.emacs.d/snippets/c-mode/malloc b/.emacs.d/snippets/c-mode/malloc
new file mode 100644
index 0000000..2a51de3
--- /dev/null
+++ b/.emacs.d/snippets/c-mode/malloc
@@ -0,0 +1,6 @@
1# -*- mode: snippet -*-
2# name: malloc
3# key: malloc
4# --
5malloc(sizeof($1)${2: * ${3:3}});
6$0 \ No newline at end of file
diff --git a/.emacs.d/snippets/c-mode/packed b/.emacs.d/snippets/c-mode/packed
new file mode 100644
index 0000000..b4eb125
--- /dev/null
+++ b/.emacs.d/snippets/c-mode/packed
@@ -0,0 +1,5 @@
1# -*- mode: snippet -*-
2# name: packed
3# key: packed
4# --
5__attribute__((__packed__))$0 \ No newline at end of file
diff --git a/.emacs.d/snippets/c-mode/printf b/.emacs.d/snippets/c-mode/printf
new file mode 100644
index 0000000..ccc788c
--- /dev/null
+++ b/.emacs.d/snippets/c-mode/printf
@@ -0,0 +1,5 @@
1# -*- mode: snippet -*-
2# name: printf
3# key: pr
4# --
5printf("${1:format string}"${2: ,a0,a1}); \ No newline at end of file
diff --git a/.emacs.d/snippets/c-mode/stdio b/.emacs.d/snippets/c-mode/stdio
new file mode 100644
index 0000000..7529766
--- /dev/null
+++ b/.emacs.d/snippets/c-mode/stdio
@@ -0,0 +1,5 @@
1# -*- mode: snippet -*-
2# name: stdio
3# key: io
4# --
5#include <stdio.h> \ No newline at end of file
diff --git a/.emacs.d/snippets/c-mode/stdlib b/.emacs.d/snippets/c-mode/stdlib
new file mode 100644
index 0000000..a7d117b
--- /dev/null
+++ b/.emacs.d/snippets/c-mode/stdlib
@@ -0,0 +1,5 @@
1# -*- mode: snippet -*-
2# name: stdlib
3# key: std
4# --
5#include <stdlib.h>
diff --git a/.emacs.d/snippets/c-mode/string b/.emacs.d/snippets/c-mode/string
new file mode 100644
index 0000000..d45b757
--- /dev/null
+++ b/.emacs.d/snippets/c-mode/string
@@ -0,0 +1,5 @@
1# -*- mode: snippet -*-
2# name: string
3# key: str
4# --
5#include <string.h> \ No newline at end of file
diff --git a/.emacs.d/snippets/c-mode/switch b/.emacs.d/snippets/c-mode/switch
new file mode 100644
index 0000000..0916059
--- /dev/null
+++ b/.emacs.d/snippets/c-mode/switch
@@ -0,0 +1,11 @@
1# -*- mode: snippet -*-
2# name: switch
3# key: case
4# --
5switch (${1:ch}) {
6 case ${2:const}:
7 ${3:a = b};
8 break;
9 ${4:default:
10 ${5:action}}
11}
diff --git a/.emacs.d/snippets/c-mode/union b/.emacs.d/snippets/c-mode/union
new file mode 100644
index 0000000..b4ec5fa
--- /dev/null
+++ b/.emacs.d/snippets/c-mode/union
@@ -0,0 +1,7 @@
1# -*- mode: snippet -*-
2# name: union
3# key: union
4# --
5typedef union {
6 $0
7} ${1:name}; \ No newline at end of file
diff --git a/.emacs.d/snippets/c-mode/unistd b/.emacs.d/snippets/c-mode/unistd
new file mode 100644
index 0000000..d5fca02
--- /dev/null
+++ b/.emacs.d/snippets/c-mode/unistd
@@ -0,0 +1,5 @@
1# -*- mode: snippet -*-
2# name: unistd
3# key: uni
4# --
5#include <unistd.h> \ No newline at end of file