diff options
| author | Jake Koroman <jake@jakekoroman.com> | 2025-06-01 10:55:23 -0400 |
|---|---|---|
| committer | Jake Koroman <jake@jakekoroman.com> | 2025-06-01 10:55:23 -0400 |
| commit | 3b4590b1a745b06ce36cb558a4749923675e9b35 (patch) | |
| tree | 532e9f00ae0b7fdeb3645f13b926e8a65b74f1ec /emacs/snippets/c-mode | |
Ready. Set. Go!
Diffstat (limited to 'emacs/snippets/c-mode')
| -rw-r--r-- | emacs/snippets/c-mode/define | 5 | ||||
| -rw-r--r-- | emacs/snippets/c-mode/for | 7 | ||||
| -rw-r--r-- | emacs/snippets/c-mode/fprintf | 5 | ||||
| -rw-r--r-- | emacs/snippets/c-mode/if | 7 | ||||
| -rw-r--r-- | emacs/snippets/c-mode/include | 5 | ||||
| -rw-r--r-- | emacs/snippets/c-mode/includeq | 5 | ||||
| -rw-r--r-- | emacs/snippets/c-mode/main | 9 | ||||
| -rw-r--r-- | emacs/snippets/c-mode/note | 5 | ||||
| -rw-r--r-- | emacs/snippets/c-mode/printf | 5 | ||||
| -rw-r--r-- | emacs/snippets/c-mode/printf_args | 5 | ||||
| -rw-r--r-- | emacs/snippets/c-mode/sdlboil | 29 | ||||
| -rw-r--r-- | emacs/snippets/c-mode/stdio | 5 | ||||
| -rw-r--r-- | emacs/snippets/c-mode/stdlib | 5 | ||||
| -rw-r--r-- | emacs/snippets/c-mode/struct | 6 | ||||
| -rw-r--r-- | emacs/snippets/c-mode/todo | 5 |
15 files changed, 108 insertions, 0 deletions
diff --git a/emacs/snippets/c-mode/define b/emacs/snippets/c-mode/define new file mode 100644 index 0000000..9d5c5dd --- /dev/null +++ b/emacs/snippets/c-mode/define @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: define +# key: d +# -- +#define $0
\ No newline at end of file diff --git a/emacs/snippets/c-mode/for b/emacs/snippets/c-mode/for new file mode 100644 index 0000000..6017e19 --- /dev/null +++ b/emacs/snippets/c-mode/for @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: for +# key: for +# -- +for (u64 ${1:i} = 0; $1 < $2; ++$1) { + $0 +}
\ No newline at end of file diff --git a/emacs/snippets/c-mode/fprintf b/emacs/snippets/c-mode/fprintf new file mode 100644 index 0000000..b38215e --- /dev/null +++ b/emacs/snippets/c-mode/fprintf @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: fprintf +# key: fpr +# -- +fprintf($1, "$2");
\ No newline at end of file diff --git a/emacs/snippets/c-mode/if b/emacs/snippets/c-mode/if new file mode 100644 index 0000000..ee5fd1a --- /dev/null +++ b/emacs/snippets/c-mode/if @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: if +# key: if +# -- +if ($1) { + $0 +}
\ No newline at end of file diff --git a/emacs/snippets/c-mode/include b/emacs/snippets/c-mode/include new file mode 100644 index 0000000..7a1c556 --- /dev/null +++ b/emacs/snippets/c-mode/include @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: include +# key: inc +# -- +#include <$0>
\ No newline at end of file diff --git a/emacs/snippets/c-mode/includeq b/emacs/snippets/c-mode/includeq new file mode 100644 index 0000000..99ffc56 --- /dev/null +++ b/emacs/snippets/c-mode/includeq @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: includeq +# key: incq +# -- +#include "$0"
\ No newline at end of file diff --git a/emacs/snippets/c-mode/main b/emacs/snippets/c-mode/main new file mode 100644 index 0000000..e01bd48 --- /dev/null +++ b/emacs/snippets/c-mode/main @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: main +# key: main +# -- +int +main(int argc, char **argv) { + $0 + return 0; +}
\ No newline at end of file diff --git a/emacs/snippets/c-mode/note b/emacs/snippets/c-mode/note new file mode 100644 index 0000000..2bbf1cb --- /dev/null +++ b/emacs/snippets/c-mode/note @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: note +# key: note +# -- +/* NOTE(jake): $0 */
\ No newline at end of file diff --git a/emacs/snippets/c-mode/printf b/emacs/snippets/c-mode/printf new file mode 100644 index 0000000..6b9386f --- /dev/null +++ b/emacs/snippets/c-mode/printf @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: printf +# key: pr +# -- +printf("$0");
\ No newline at end of file diff --git a/emacs/snippets/c-mode/printf_args b/emacs/snippets/c-mode/printf_args new file mode 100644 index 0000000..6022823 --- /dev/null +++ b/emacs/snippets/c-mode/printf_args @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: printf_args +# key: pra +# -- +printf("$1", $0);
\ No newline at end of file diff --git a/emacs/snippets/c-mode/sdlboil b/emacs/snippets/c-mode/sdlboil new file mode 100644 index 0000000..a96d967 --- /dev/null +++ b/emacs/snippets/c-mode/sdlboil @@ -0,0 +1,29 @@ +# -*- mode: snippet -*- +# name: sdlboil +# key: sdlboil +# -- +SDL_Init(SDL_INIT_VIDEO); + +SDL_Window *window = SDL_CreateWindow("SDL Boilerplate", + 0, 0, + 1280, 720, + SDL_WINDOW_RESIZABLE); + +SDL_Renderer *renderer = SDL_CreateRenderer(window, -1, + SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED); + +bool running = true; +while (running) { + SDL_Event event = {0}; + while (SDL_PollEvent(&event)) { + switch (event.type) { + case SDL_QUIT: { + running = false; + } break; + } + } + SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); + SDL_RenderClear(renderer); + SDL_RenderPresent(renderer); +} +$0
\ No newline at end of file diff --git a/emacs/snippets/c-mode/stdio b/emacs/snippets/c-mode/stdio new file mode 100644 index 0000000..8170eee --- /dev/null +++ b/emacs/snippets/c-mode/stdio @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: stdio +# key: stdio +# -- +#include <stdio.h>
\ No newline at end of file diff --git a/emacs/snippets/c-mode/stdlib b/emacs/snippets/c-mode/stdlib new file mode 100644 index 0000000..038739d --- /dev/null +++ b/emacs/snippets/c-mode/stdlib @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: stdlib +# key: stdlib +# -- +#include <stdlib.h>
\ No newline at end of file diff --git a/emacs/snippets/c-mode/struct b/emacs/snippets/c-mode/struct new file mode 100644 index 0000000..04df052 --- /dev/null +++ b/emacs/snippets/c-mode/struct @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: struct +# key: st +# -- +typedef struct { +} $0;
\ No newline at end of file diff --git a/emacs/snippets/c-mode/todo b/emacs/snippets/c-mode/todo new file mode 100644 index 0000000..ef5acd0 --- /dev/null +++ b/emacs/snippets/c-mode/todo @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: todo +# key: todo +# -- +/* TODO(jake): $0 */
\ No newline at end of file |
