Minibuffer key bindings
* Key bindings for navigation::
-* Key bindings for single selection, action, then exit minibuffer: Key bindings for single selection action then exit minibuffer.
-* Key bindings for multiple selections and actions, keep minibuffer open: Key bindings for multiple selections and actions keep minibuffer open.
+* Key bindings for single selection, action, then exit minibuffer: Key bindings for single selection action then exit minibuffer.
+* Key bindings for multiple selections and actions, keep minibuffer open: Key bindings for multiple selections and actions keep minibuffer open.
* Key bindings that alter the minibuffer input::
* Other key bindings::
* Hydra in the minibuffer::
@indentedblock
Uncluttered minibuffer is minimalism. Ivy shows the completion
defaults, the number of matches, and 10 candidate matches below
-the input line. Customize @code{ivy-length} to adjust the number of
+the input line. Customize @code{ivy-height} to adjust the number of
candidate matches displayed in the minibuffer.
@end indentedblock
@subsubheading Simplicity
First clone the Swiper repository with:
@example
-cd ~/git && git clone https://github.com/abo-abo/swiper
-cd swiper && make compile
+ cd ~/git && git clone https://github.com/abo-abo/swiper
+ cd swiper && make compile
@end example
Second, add these lines to the Emacs init file:
@lisp
-(add-to-list 'load-path "~/git/swiper/")
-(require 'ivy)
+ (add-to-list 'load-path "~/git/swiper/")
+ (require 'ivy)
@end lisp
Then, update the code with:
@example
-git pull
-make
+ git pull
+ make
@end example
@end indentedblock
@subsubheading Ivy-based interface to standard commands
@indentedblock
@lisp
-(global-set-key (kbd "C-s") 'swiper)
-(global-set-key (kbd "M-x") 'counsel-M-x)
-(global-set-key (kbd "C-x C-f") 'counsel-find-file)
-(global-set-key (kbd "<f1> f") 'counsel-describe-function)
-(global-set-key (kbd "<f1> v") 'counsel-describe-variable)
-(global-set-key (kbd "<f1> l") 'counsel-load-library)
-(global-set-key (kbd "<f2> i") 'counsel-info-lookup-symbol)
-(global-set-key (kbd "<f2> u") 'counsel-unicode-char)
+ (global-set-key (kbd "C-s") 'swiper)
+ (global-set-key (kbd "M-x") 'counsel-M-x)
+ (global-set-key (kbd "C-x C-f") 'counsel-find-file)
+ (global-set-key (kbd "<f1> f") 'counsel-describe-function)
+ (global-set-key (kbd "<f1> v") 'counsel-describe-variable)
+ (global-set-key (kbd "<f1> l") 'counsel-load-library)
+ (global-set-key (kbd "<f2> i") 'counsel-info-lookup-symbol)
+ (global-set-key (kbd "<f2> u") 'counsel-unicode-char)
@end lisp
@end indentedblock
@subsubheading Ivy-based interface to shell and system tools
@indentedblock
@lisp
-(global-set-key (kbd "C-c g") 'counsel-git)
-(global-set-key (kbd "C-c j") 'counsel-git-grep)
-(global-set-key (kbd "C-c k") 'counsel-ag)
-(global-set-key (kbd "C-x l") 'counsel-locate)
-(global-set-key (kbd "C-S-o") 'counsel-rhythmbox)
+ (global-set-key (kbd "C-c g") 'counsel-git)
+ (global-set-key (kbd "C-c j") 'counsel-git-grep)
+ (global-set-key (kbd "C-c k") 'counsel-ag)
+ (global-set-key (kbd "C-x l") 'counsel-locate)
+ (global-set-key (kbd "C-S-o") 'counsel-rhythmbox)
@end lisp
@end indentedblock
@subsubheading Ivy-resume and other commands
@code{ivy-resume} resumes the last Ivy-based completion.
@lisp
-(global-set-key (kbd "C-c C-r") 'ivy-resume)
+ (global-set-key (kbd "C-c C-r") 'ivy-resume)
@end lisp
@end indentedblock
@kbd{C-y} key bindings work the same as in @code{fundamental-mode}.
@menu
* Key bindings for navigation::
-* Key bindings for single selection, action, then exit minibuffer: Key bindings for single selection action then exit minibuffer.
-* Key bindings for multiple selections and actions, keep minibuffer open: Key bindings for multiple selections and actions keep minibuffer open.
+* Key bindings for single selection, action, then exit minibuffer: Key bindings for single selection action then exit minibuffer.
+* Key bindings for multiple selections and actions, keep minibuffer open: Key bindings for multiple selections and actions keep minibuffer open.
* Key bindings that alter the minibuffer input::
* Other key bindings::
* Hydra in the minibuffer::
Example ERT test:
@lisp
-(should
- (equal (ivy-with
- '(progn
- (ivy-read "Test: " '("can do" "can't, sorry" "other"))
- ivy-text)
- "c <tab>")
- "can"))
+ (should
+ (equal (ivy-with
+ '(progn
+ (ivy-read "Test: " '("can do" "can't, sorry" "other"))
+ ivy-text)
+ "c <tab>")
+ "can"))
@end lisp
@end indentedblock
@subsubheading @kbd{C-M-j} (@code{ivy-immediate-done})
For example:
@lisp
-(setq confirm-nonexistent-file-or-buffer t)
+ (setq confirm-nonexistent-file-or-buffer t)
@end lisp
Then call @code{find-file}, enter "eldorado" and press @kbd{RET} - the
Enable virtual buffers with:
@lisp
-(setq ivy-use-virtual-buffers t)
+ (setq ivy-use-virtual-buffers t)
@end lisp
@end indentedblock
To disable showing the number of candidates:
@lisp
-(setq ivy-count-format "")
+ (setq ivy-count-format "")
@end lisp
To also display the current candidate:
@lisp
-(setq ivy-count-format "(%d/%d) ")
+ (setq ivy-count-format "(%d/%d) ")
@end lisp
The @code{format}-style switches this variable uses are described
macro.
@lisp
-(defun ivy-insert-action (x)
- (with-ivy-window
- (insert x)))
+ (defun ivy-insert-action (x)
+ (with-ivy-window
+ (insert x)))
@end lisp
@end indentedblock
Magit requries this setting for ivy completion:
@lisp
-(setq magit-completing-read-function 'ivy-completing-read)
+ (setq magit-completing-read-function 'ivy-completing-read)
@end lisp
@end indentedblock
@subsubheading @code{find-file-in-project}
Projectile requires this seeting for ivy completion:
@lisp
-(setq projectile-completion-system 'ivy)
+ (setq projectile-completion-system 'ivy)
@end lisp
@end indentedblock
@subsubheading @code{helm-make}
Helm-make requires this seeting for ivy completion.
@lisp
-(setq helm-make-completion-method 'ivy)
+ (setq helm-make-completion-method 'ivy)
@end lisp
@end indentedblock
Adding this to Emacs init file:
@lisp
-(setq ivy-use-virtual-buffers t)
+ (setq ivy-use-virtual-buffers t)
@end lisp
will add additional virual buffers to the buffers list for recent
files. Selecting such virtual buffers, which are highlighted with
@printindex ky
-@bye
\ No newline at end of file
+@bye