docs/api: add lambda! demos

This commit is contained in:
Henrik Lissner 2019-12-13 14:35:15 -05:00
parent 008c14640b
commit 33dfe85c66
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -214,7 +214,15 @@ It is integrated into Helpful, in Doom.
#+RESULTS: #+RESULTS:
: /home/hlissner/.emacs.d/LICENSE : /home/hlissner/.emacs.d/LICENSE
*** TODO lambda! *** lambda!
#+BEGIN_SRC elisp
(map! "C-j" (lambda! (newline) (indent-according-to-mode)))
;; The `λ!' short-form alias exists. If you have the snippets module enabled and
;; Doom's default snippets, the 'lam' snippet will expand into 'λ!'. Otherwise,
;; you can use `lambda!'.
(map! "C-j" (λ! (newline) (indent-according-to-mode)))
#+END_SRC
*** lambda!! *** lambda!!
When ~newline~ is passed a numerical prefix argument (=C-u 5 M-x newline=), it When ~newline~ is passed a numerical prefix argument (=C-u 5 M-x newline=), it
inserts N newlines. We can use ~lambda!!~ to easily create a keybinds that bakes inserts N newlines. We can use ~lambda!!~ to easily create a keybinds that bakes