feat: refactor yasnippet
Put snippets in standard path
This commit is contained in:
parent
ffcbf8ec41
commit
5ebe6422f8
4 changed files with 13 additions and 14 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
@ -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
10
snippets/c-mode/header
Normal 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 */
|
||||
Loading…
Add table
Add a link
Reference in a new issue