docs/api: add cmds! & kbd! demos
This commit is contained in:
parent
91ced79975
commit
d2005ab5da
1 changed files with 28 additions and 0 deletions
28
docs/api.org
28
docs/api.org
|
@ -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"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue