diff --git a/config.org b/config.org index cb7b869..8c73fbf 100644 --- a/config.org +++ b/config.org @@ -1131,10 +1131,8 @@ https://github.com/joaotavora/yasnippet #+BEGIN_SRC emacs-lisp (use-package yasnippet - :init - (add-to-list 'load-path - "~/.emacs.d/plugins/yasnippet") :config + (yas-reload-all) (add-hook 'prog-mode-hook 'yas-minor-mode) ) #+END_SRC diff --git a/plugins/yasnippet/c-mode/oncekl b/plugins/yasnippet/c-mode/oncekl deleted file mode 100644 index d0f8afc..0000000 --- a/plugins/yasnippet/c-mode/oncekl +++ /dev/null @@ -1,9 +0,0 @@ -#name : #ifndef XXX; #define XXX; #endif -# key: oncekl -# -- -#ifndef ${1:`(upcase (file-name-nondirectory (file-name-sans-extension (or (buffer-file-name) ""))))`_H_} -#define $1 - -$0 - -#endif /* $1 */ \ No newline at end of file diff --git a/plugins/yasnippet/c-mode/fori b/snippets/c-mode/fori similarity index 62% rename from plugins/yasnippet/c-mode/fori rename to snippets/c-mode/fori index 63e65b0..e2e0ac6 100644 --- a/plugins/yasnippet/c-mode/fori +++ b/snippets/c-mode/fori @@ -3,6 +3,6 @@ # key: fori # -- -for (${1:int i = 0}; ${2:i < N}; ${3:++i}) { +for (${1:size_t i = 0}; ${2:i < N}; ${3:++i}) { $0 -} +} \ No newline at end of file diff --git a/snippets/c-mode/header b/snippets/c-mode/header new file mode 100644 index 0000000..a7b5339 --- /dev/null +++ b/snippets/c-mode/header @@ -0,0 +1,10 @@ +#name : #ifndef XXX; #define XXX; #endif +# key: header +# -- + +#ifndef ${1:_`(upcase (file-name-nondirectory (file-name-sans-extension (or (buffer-file-name) ""))))`_H_} +#define $1 + +$0 + +#endif /* $1 */ \ No newline at end of file