The defun-ivy+
macro simplifies the creation of custom commands utilizing ivy-read
for enhanced Emacs completion experiences.
(defun-ivy+ km-browse-ivy-chrome-history
:bind "C-c g h"
:collection (km-browse-init-chrome-history-candidates)
:prompt "Select history\s"
:initial-input (km-get-word-or-region)
:multi-action (lambda (marked)
(dolist (it marked)
(km-browse-action-default it)))
:actions '(("C-j" km-browse-eww-action "eww")
("RET" km-browse-action-default "chrome")
("C-c x" km-browse-xvidget-action)
("C-c k d" km-browse-download-url :no-exit))
:display-fn #'km-browse-display-fn)
Name | Version |
---|---|
Emacs | 25.1 |
(use-package defun-ivy+
:straight (defun-ivy+
:repo "KarimAziev/defun-ivy"
:type git
:host github))
Download the source code and put it wherever you like, e.g. into ~/.emacs.d/defun-ivy/
git clone https://github.com/KarimAziev/defun-ivy.git ~/.emacs.d/defun-ivy/
Add the downloaded directory to the load path:
(add-to-list 'load-path "~/.emacs.d/defun-ivy/")
(require 'defun-ivy+)
This table outlines the various keywords you can pass to defun-ivy+
and their associated actions:
Argument | Description |
---|---|
:actions | List of actions (KEYBINDING ACTION DESCRIPTION) . The :no-exit keyword can be included to call an action without exiting the minibuffer. |
:bind | Global keybinding for invoking the command. |
:init | Form to execute before ivy-read . |
:prompt | String normally ending in a colon and a space. The default prompt is an empty string. |
:collection | Specifies the collection for ivy-read . |
… | Additional ivy-read arguments like :predicate , :require-match , :initial-input , :history , :preselect , :def , :keymap , :update-fn , :action , :multi-action , :unwind , :re-builder , :matcher , :dynamic-collection , :extra-props , and :sort . |
:sort-fn | Function for ivy-configure to sort candidates. |
:display-fn | Function for ivy-configure to display candidates. |
… | Additional ivy-configure options like :height , :exit-codes , :occur , :update-fn , :unwind-fn , :index-fn , :format-fn , :more-chars , :grep-p , and :exit-codes . |
To see the full range of arguments and their effects, consult the complete documentation within the source.
If non-nil, cause imenu to see defun-ivy+
declarations. This is done by adjusting lisp-imenu-generic-expression
to include support for finding defun-ivy+
forms. Must be set before loading Defun-Ivye.
Sexp providing regexp for finding defun-ivy+
forms in user files. This is used by defun-ivy-enable-imenu-support
.