docs/api: add cmds! & kbd! demos

This commit is contained in:
Henrik Lissner 2020-12-11 17:50:04 -05:00
parent 91ced79975
commit d2005ab5da
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -20,6 +20,8 @@ It is integrated into Helpful, in Doom.
- [[#file-exists-p][file-exists-p!]]
- [[#cmd][cmd!]]
- [[#cmd-1][cmd!!]]
- [[#cmds][cmds!]]
- [[#kbd][kbd!]]
- [[#letenv][letenv!]]
- [[#load][load!]]
- [[#map][map!]]
@ -263,6 +265,32 @@ Or to create aliases for functions that behave differently:
(fset 'org-reset-global-visibility (cmd!! #'org-global-cycle '(4))
#+END_SRC
*** cmds!
#+BEGIN_SRC elisp :eval no
(map! :i [tab] (cmds! (and (featurep! :editor snippets)
(bound-and-true-p yas-minor-mode)
(yas-maybe-expand-abbrev-key-filter 'yas-expand))
#'yas-expand
(featurep! :completion company +tng)
#'company-indent-or-complete-common)
:m [tab] (cmds! (and (bound-and-true-p yas-minor-mode)
(evil-visual-state-p)
(or (eq evil-visual-selection 'line)
(not (memq (char-after) (list ?\( ?\[ ?\{ ?\} ?\] ?\))))))
#'yas-insert-snippet
(and (featurep! :editor fold)
(save-excursion (end-of-line) (invisible-p (point))))
#'+fold/toggle
(fboundp 'evil-jump-item)
#'evil-jump-item))
#+END_SRC
*** kbd!
#+BEGIN_SRC elisp :eval no
(map! "," (kbd! "SPC")
";" (kbd! ":"))
#+END_SRC
*** letenv!
#+BEGIN_SRC elisp
(letenv! (("SHELL" "/bin/sh"))