Skip to content

Macros for creating custom ivy completion commands with ease.

Notifications You must be signed in to change notification settings

KarimAziev/defun-ivy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 

Repository files navigation

About

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)

Table of Contents

Requirements

NameVersion
Emacs25.1

Installation

With use-package and straight.el

(use-package defun-ivy+
  :straight (defun-ivy+
              :repo "KarimAziev/defun-ivy"
              :type git
              :host github))

Manual installation

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+)

Arguments

This table outlines the various keywords you can pass to defun-ivy+ and their associated actions:

ArgumentDescription
:actionsList of actions (KEYBINDING ACTION DESCRIPTION). The :no-exit keyword can be included to call an action without exiting the minibuffer.
:bindGlobal keybinding for invoking the command.
:initForm to execute before ivy-read.
:promptString normally ending in a colon and a space. The default prompt is an empty string.
:collectionSpecifies 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-fnFunction for ivy-configure to sort candidates.
:display-fnFunction 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.

Customization

defun-ivy-enable-imenu-support

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.

defun-ivy-regexp-eval

Sexp providing regexp for finding defun-ivy+ forms in user files. This is used by defun-ivy-enable-imenu-support.

About

Macros for creating custom ivy completion commands with ease.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published