Create elisp-insert hydra, yasnippet config

This commit is contained in:
contrapunctus 2022-01-05 20:19:48 +05:30
parent 469eeda81f
commit c90545730c
3 changed files with 38 additions and 1 deletions

View File

@ -2058,7 +2058,8 @@ With PREFIX argument and CMD not supplied - prompt for command."
("j" xref-find-definitions "Jump to definition")
("J" org-babel-tangle-jump-to-org "Jump to definition (Org)")
("r" ielm "REPL")
("t" contrapunctus-el-test/body "Test"))
("t" contrapunctus-el-test/body "Test")
("n" my-elisp-insert-hydra/body "Insert"))
#+END_SRC
*** eval
#+BEGIN_SRC emacs-lisp
@ -2090,6 +2091,16 @@ With PREFIX argument and CMD not supplied - prompt for command."
("r" (byte-recompile-file (buffer-file-name)) "recompile")
("R" byte-force-recompile "force recompile"))
#+END_SRC
*** insert
:PROPERTIES:
:CREATED: 2022-01-05T19:45:33+0530
:END:
#+BEGIN_SRC emacs-lisp
(defhydra my-elisp-insert-hydra (:color blue)
"Insert"
("g" (yas-expand-snippet (yas-lookup-snippet "cl-defgeneric")) "defgeneric")
("m" (yas-expand-snippet (yas-lookup-snippet "cl-defmethod")) "defmethod"))
#+END_SRC
** Common Lisp
#+BEGIN_SRC emacs-lisp
@ -3317,6 +3328,15 @@ Used by Eldev documentation.
(midnight . clean-buffer-list))
#+END_SRC
* yasnippet
:PROPERTIES:
:CREATED: 2022-01-05T20:16:31+0530
:END:
#+BEGIN_SRC emacs-lisp
(use-package yasnippet
:commands (yas-expand-snippet))
#+END_SRC
* Programming
** FIXME common [%]
*** swap keys :disabled:
@ -3390,6 +3410,10 @@ pjb suggested a different approach [[http://paste.lisp.org/display/10157][here]]
:hook (prog-mode . rainbow-delimiters-mode))
#+END_SRC
*** company
:PROPERTIES:
:CREATED: 2022-01-05T20:16:03+0530
:END:
#+BEGIN_SRC emacs-lisp
(use-package company
:diminish company-mode

View File

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: cl-defgeneric
# key: defg
# --
(cl-defgeneric ${1:name} (${2:args})
"${3:docstring}"
$0)

View File

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: cl-defmethod
# key: defme
# --
(cl-defmethod ${1:name} (${2:args})
$0)