Add cmd!, cmd!!, cmds! convenience macros

It's kind of silly that our command lambda macros (λ! and λ!!) need a
snippet, special key sequence or copy-paste to insert, so in the spirit
of fn! -- and to make sure they take up less space than `lambda!` --
I've added `cmd!` and `cmd!!` aliases. `lambda!` and `lambda!!` are now
deprecated. λ! and λ!! will remain.

I've also added `cmds!` as a convenience wrapper around
general-predicate-dispatch.
This commit is contained in:
Henrik Lissner
2020-05-27 16:12:45 -04:00
parent d4d8c48265
commit a9bf0b8985
5 changed files with 68 additions and 62 deletions

View File

@ -120,7 +120,7 @@
;;; <leader> i --- insert
(:prefix-map ("i" . "insert")
:desc "Current file name" "f" #'+default/insert-file-path
:desc "Current file path" "F" (λ!! #'+default/insert-file-path t)
:desc "Current file path" "F" (cmd!! #'+default/insert-file-path t)
:desc "Snippet" "s" #'yas-insert-snippet
:desc "Unicode" "u" #'unicode-chars-list-chars
:desc "From clipboard" "y" #'+default/yank-pop)
@ -412,7 +412,7 @@
;;; Text scaling
[C-mouse-4] #'text-scale-increase
[C-mouse-5] #'text-scale-decrease
[C-down-mouse-2] (λ! (text-scale-set 0))
[C-down-mouse-2] (cmd! (text-scale-set 0))
"M-+" #'doom/reset-font-size
"M-=" #'doom/increase-font-size
"M--" #'doom/decrease-font-size
@ -463,7 +463,7 @@
:map company-search-map
"C-n" #'company-search-repeat-forward
"C-p" #'company-search-repeat-backward
"C-s" (λ! (company-search-abort) (company-filter-candidates)))
"C-s" (cmd! (company-search-abort) (company-filter-candidates)))
;;; ein notebooks
(:after ein:notebook-multilang