Configure YASnippet
This commit is contained in:
26
config.org
26
config.org
@@ -202,6 +202,25 @@
|
||||
(ido-mode t))))
|
||||
#+end_src
|
||||
|
||||
** Snippets
|
||||
YASnippet is the de facto snippet engine. There are two packages
|
||||
for it: one for the engine itself and one with a library of
|
||||
snippets:
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(use-package yasnippet)
|
||||
(use-package yasnippet-snippets)
|
||||
#+end_src
|
||||
|
||||
I don't want it enabled all the time, only in certain modes. The
|
||||
[[help:yas-minor-mode][yas-minor-mode]] function is provided for this, but it requires that
|
||||
the snippet tables are loaded beforehand, so that has to be done
|
||||
now.
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(yas-reload-all)
|
||||
#+end_src
|
||||
|
||||
* Calendar / Diary
|
||||
Weeks start on Sunday by default, this can be changed to start on
|
||||
Monday by setting [[help:calendar-week-start-day][calendar-week-start-day]] to 1:
|
||||
@@ -677,6 +696,13 @@
|
||||
(smart-tabs-insinuate 'c)
|
||||
#+end_src
|
||||
|
||||
There's a lot of boilerplate in C, so I want YASnippet enabled.
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(add-hook 'c-mode-hook (lambda ()
|
||||
(yas-minor-mode)))
|
||||
#+end_src
|
||||
|
||||
** C++
|
||||
Essentially the same story as for C.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user