https://github.com/karimaziev/ivy-extra
Extends ivy-read.
https://github.com/karimaziev/ivy-extra
emacs ivy ivyhacks
Last synced: 7 months ago
JSON representation
Extends ivy-read.
- Host: GitHub
- URL: https://github.com/karimaziev/ivy-extra
- Owner: KarimAziev
- License: gpl-3.0
- Created: 2022-05-08T13:05:30.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-09T12:21:58.000Z (11 months ago)
- Last Synced: 2025-01-07T18:21:06.591Z (9 months ago)
- Topics: emacs, ivy, ivyhacks
- Language: Emacs Lisp
- Homepage:
- Size: 66.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
- License: LICENSE
Awesome Lists containing this project
README
* ivy-extra
Functions and commands that extends ~ivy-read~.
** Requirements
+ Emacs >= 27.1
+ ivy** Installation
*** Manually
Download repository and it to your load path in your init file:
#+begin_src elisp :eval no
(add-to-list 'load-path "/path/to/ivy-extra)
(require 'ivy-extra)
#+end_src
*** With use-package and straight
#+begin_src elisp :eval no
(use-package ivy-extra
:straight (ivy-extra
:repo "KarimAziev/ivy-extra"
:type git
:host github)
:commands (ivy-extra-read-multi
ivy-extra-read))
#+end_src** Commands
*** ~ivy-extra-read-multi~ (prompt collection &rest ivy-args)
Read ~collection~ with ~prompt~ and return list with selected candidates. ~ivy-args~ are combined args both from ~ivy-read~ and ~ivy-configure~, excluding:
- =:action=
- =:multi-action=
- =:caller=
but accepting:
- =:persistent-action= - a function to call with current candidate without exiting minibuffer
- =:premarked= - candidates from ~collection~ which should be initially marked.*Usage example*:
#+begin_src elisp
(ivy-extra-read-multi "My prompt" '("a" "b" "c")
:display-transformer-fn (lambda (it) (concat it "- my suffix")))
#+end_src*** ~ivy-extra-read~ (prompt collection &rest ivy-args)
Configure and call ~ivy-read~ with ~prompt,~ ~collection~ and ~ivy-args.~ ~ivy-args~ are combined args both from ~ivy-read~ and ~ivy-configure,~ excluding caller.For example with plain ~ivy-read~ and ~ivy-configure~ you would write something like:
#+begin_src elisp
(defun my-completion-read ()
(interactive)
(ivy-read "My prompt"
'("a" "b" "c")))(ivy-configure 'my-completion-read
:display-transformer-fn (lambda (it) (concat it "- my suffix")))
#+end_srcAnd with ~ivy-extra-read~:
#+begin_src emacs-lisp
(defun my-completion-read ()
(ivy-extra-read "My prompt" '("a" "b" "c")
:display-transformer-fn (lambda (it) (concat it "- my suffix"))))
#+end_src