feat: refactor yasnippet

Put snippets in standard path
This commit is contained in:
Laurens Miers 2023-06-08 23:37:58 +02:00
parent ffcbf8ec41
commit 5ebe6422f8
4 changed files with 13 additions and 14 deletions

View file

@ -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

View file

@ -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 */

View file

@ -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
}

10
snippets/c-mode/header Normal file
View file

@ -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 */