Ivy - a generic completion frontend for Emacs, Swiper - isearch with an overview, and more. Oh, man!
The Changelog for version 0.13.0 (and previous versions) is available here
The Changelog for version 0.12.0 (and previous versions) is available here
The Changelog for version 0.11.0 (and previous versions) is available here
The Changelog for version 0.10.0 (and previous versions) is available here.
The Changelog for version 0.9.0 (and previous versions) is available here
The Changelog for version 0.8.0 (and previous versions) is available here
Table of Contents
C-g
out of a long-running async processC-j
should no stop completion for a pasted file pathC-M-j
should use ivy--directory
ivy-scroll-up-command
and ivy-scroll-down-command
M-o
shouldn't set the action permanentlyswiper
swiper-font-lock-ensure
evil-jumper/backward
visual-line-mode
swiper-toggle-face-matching
push-mark
only if exited the minibufferivy-resume
should restore the buffer for swiper
swiper
callstwittering-mode
ivy
C-M-n
should not leave the minibufferflx
sortingivy-count-format
ivy-index-functions-alist
ivy-virtual-abbreviate
ivy-case-fold-search
ivy-extra-directories
to defcustomivy-sort-function-alist
to defcustomM-n
should prefer url at point to symbol at pointC-x C-f M-n
calls ffap-url-fetcher
when at URLivy-modified-buffer
faceenable-recursive-minibuffers
ivy-display-style
ivy-hydra
t
to toggle-truncate-lines
a
to ivy-read-action
ivy-switch-buffer
M-o r
rename the buffer instead of switching.counsel-locate
counsel-org-tag
counsel-unicode-char
counsel-M-x
current-prefix-arg
in the promptcounsel-find-file
counsel-git-grep
counsel-git-grep
-> ivy-occur
-> wgrep
ivy-occur
gives full candidatescounsel--find-symbol
counsel-ag
initial-directory
ivy-occur
ivy-avy
ivy-kill-ring-save
ivy-dispatching-call
ivy-read-action
swiper-multi
swiper-mc
swiper-all
counsel-grep
counsel-git-grep-query-replace
counsel-jedi
counsel-cl
counsel-yank-pop
See #195.
See #198.
Allows ivy-read
to return a propertized string.
C-g
out of a long-running async processUse counsel-delete-process
as :unwind
.
See #245.
See #266.
See #245.
See #270.
C-j
should no stop completion for a pasted file pathC-M-j
should use ivy--directory
When completing file names, expand the file name properly. See #275.
See #278.
ivy-scroll-up-command
and ivy-scroll-down-command
M-o
shouldn't set the action permanentlySo now it's possible to e.g. counsel-describe-function
-> M-o d
-> ivy-resume
-> M-o o
-> ivy-resume
-> M-o i
.
See #290.
See #295.
The syntax for whitespace, separators etc. is different for modes. See #298.
swiper
Each candidate is now a single space plus the original string. The display property of the single space holds the line number. This means that it's no longer possible to match line numbers in queries, which is a good thing if you're searching for numbers.
swiper-font-lock-ensure
Add mu4e-view-mode
, mu4e-headers-mode
, help-mode
, elfeed-show-mode
, emms-stream-mode
, debbugs-gnu-mode
, occur-mode
, occur-edit-mode
, bongo-mode
, eww-mode
, vc-dir-mode
.
evil-jumper/backward
See #268.
visual-line-mode
swiper
will split the lines when visual-line-mode
is on. This is convenient for small buffers. For large buffers, it can be very slow, since visual-line-mode
is slow. See #227.
swiper-toggle-face-matching
Bound to C-c C-f
. At each start of swiper
, the face at point will be stored. Use this command to toggle matching only the candidates with that face. See #288.
push-mark
only if exited the minibufferC-M-n
and C-M-p
will no longer push mark and annoy with messages.
ivy-resume
should restore the buffer for swiper
See #302.
swiper
callsWhile you swiper
buffer-1, you can switch out of the minibuffer into buffer-2 and call swiper
again. Exiting the second minibuffer will restore the first minibuffer.
To use this, you need to enable recursive minibuffers.
(setq enable-recursive-minibuffers t)
It's also useful to indicate the current depth:
(minibuffer-depth-indicate-mode 1)
See #309.
twittering-mode
The field
text property is now removed before inserting text into the minibuffer. This fixes the swiper
problems with twittering-mode
. See #310.
ivy
In the current state, the manual covers the most basic topics, like the minibuffer key bindings and the regexp builders.
See #240.
C-M-n
should not leave the minibufferMake sure that the minibuffer window remains selected as long as the completion hasn't finished. For example, <f1> f
to call counsel-describe-function
, input "forward" and spam C-M-n
to read the doc for each function that starts with "forward". The *Help*
window popup would move the window focus, but this change moves it back to the minibuffer.
flx
sortingSee #207. Since flx is costly, move the caching to an earlier point. This means immediate return for when the input hasn't changed, i.e. for C-n
or C-p
. When flx
is installed, and (eq ivy--regex-function 'ivy--regex-fuzzy)
for current function (through ivy-re-builders-alist
), then sort the final candidates with ivy--flx-sort
.
In the worst case, when some error pops up, return the same list. In the best case sort the cands
that all match name
by closeness to name
.
How to use:
flx
installed - (require 'flx)
should succeed.ivy-re-builders-alist
appropriately to use ivy--regex-fuzzy
.For example:
(setq ivy-re-builders-alist
'((t . ivy--regex-fuzzy)))
Since all-completions
also works for hash tables, no reason not to support them.
ivy-count-format
Now possible to set it with Customize.
ivy-index-functions-alist
Customize this to decide how the index, i.e. the currently selected candidate, is updated with new input. For example, one strategy is not reset it to 0 after each change.
Another strategy, used for swiper
, is to try to select the first appropriate candidate after (inclusive) the first previously selected candidate. This way, if you're typing something that matches what is currently selected, the selection won't change.
See #253.
ivy-virtual-abbreviate
The mode of abbreviation for virtual buffer names.
ivy-case-fold-search
Used to override case-fold-search
. See #259.
Each time 0.5s pass after the last input, if the external process hasn't finished yet, update minibuffer with the amount of candidates collected so far. This is useful to see that long running commands like counsel-locate
or counsel-ag
(when in a very large directory) aren't stuck.
ivy-extra-directories
to defcustomivy-sort-function-alist
to defcustomM-n
should prefer url at point to symbol at pointC-x C-f M-n
calls ffap-url-fetcher
when at URLivy-modified-buffer
faceThis new face is blank by default, but you can use e.g.:
(custom-set-faces
'(ivy-modified-buffer ((t (:background "#ff7777")))))
enable-recursive-minibuffers
Store the old ivy-last
in case ivy-read
is called while inside the minibuffer. Restore it after ivy-call
.
New defcustom ivy-sort-matches-functions-alist
. See #269 #265 #213.
By default, Ivy doesn't sort the matched candidates, they remain in the same order as in the original collection. This option is the default, since it's fast and simple.
A small problem with this approach is that we usually want prefix matches to be displayed first. One solution to this is to input "^" to see only the prefix matches.
Now, another solution is to can set:
(setq ivy-sort-matches-functions-alist
'((t . ivy--prefix-sort)))
Here's another example of using this defcustom:
(add-to-list
'ivy-sort-matches-functions-alist
'(read-file-name-internal . ivy--sort-files-by-date))
After this, during file name completion, most recently changed files will be ahead.
ivy-display-style
Adds fancy highlighting to the minibuffer. See #212, #217, .
ivy-hydra
t
to toggle-truncate-lines
See #214.
a
to ivy-read-action
ivy-switch-buffer
M-o r
rename the buffer instead of switching.See #233.
counsel-locate
See counsel-locate-options
. The current setting is:
(setq counsel-locate-options '("-i" "--regex"))
Use open
instead of xdg-open
. Modify counsel-locate-options
for OSX, since there locate
doesn't support --regex
.
See #194.
See #289.
counsel-org-tag
See #200.
counsel-unicode-char
counsel-M-x
Use M-o d
to jump to definition.
current-prefix-arg
in the promptSee #287.
counsel-find-file
See #283.
Selecting items after //
now works properly.
counsel-git-grep
Remember to use M-i
to insert the current candidate into the minibuffer.
See #244.
counsel-git-grep
-> ivy-occur
-> wgrep
Using C-c C-o
(ivy-occur
) while in counsel-git-grep
will produce a wgrep
-compatible buffer.
ivy-occur
gives full candidatesThis means that the =" | head -n 200"= speed-up isn't used and full candidates are returned.
counsel--find-symbol
Using C-.
in:
counsel-describe-function
counsel-describe-variable
counsel-load-library
will change the current buffer. The buffer and point can be restored with M-*
(pop-tag-mark
).
I also recommend this binding:
(global-set-key (kbd "M-,") 'pop-tag-mark)
When the symbol is both bound and fbound, prefer the fbound one, unless the :caller
is counsel-describe-variable
.
counsel-ag
initial-directory
Support alternative initial directory which helps other packages call this function with their unique starting directory.
Using the "--vimgrep" argument improves things.
ivy-occur
Bound to C-c C-o
. Store the current completion session to its own buffer. You can have an unlimited amount of these buffers.
ivy-avy
Bound to C-'
.
Speeds up selecting a candidate that's currently visible in the minibuffer.
ivy-kill-ring-save
Bound to M-w
.
When the region is active, call kill-ring-save
. Otherwise, store all selected candidates to the kill ring.
ivy-dispatching-call
Bound to C-M-o
.
This is a non-exiting version of M-o
(ivy-dispatching-done
).
ivy-read-action
Bound to C-M-a
. Select the current action. Don't call it yet.
swiper-multi
Use swiper
in multiple buffers. See #182.
Basic usage tips for selecting multiple buffers:
C-M-m
(ivy-call
) to add or remove one more buffer without exiting.C-m
(ivy-done
) to add one last buffer.C-M-j
(ivy-immediate-done
) to finish without adding more buffers.C-M-n
(ivy-next-line-and-call
) to add a lot of buffers at once.swiper-mc
Open multiple cursors at all selected candidates.
swiper-all
New command to launch swiper
for all open file buffers. Note that this can be excruciatingly slow if you don't clean up your buffer list often.
counsel-grep
This is essentially swiper
for huge files. It's not as smooth as swiper
for small files, but has a faster startup and faster matching for files that measure in megabytes.
counsel-git-grep-query-replace
Bound to M-q
. Perform query-replace
on all matches in all buffers.
counsel-jedi
Complete Python symbols using Jedi.
counsel-cl
Complete Common Lisp symbols using SLIME.
counsel-yank-pop
Give completion for inserting from the kill ring. See counsel-yank-pop-truncate
defcustom and #218.
swiper-avy
should use only the current windowNot all windows. See #117.
ivy-next-line
See #118.
swiper-avy
should do nothing for empty inputSee #50.
ivy-alt-done
should require TRAMP if necessarySee #145.
swiper-query-replace
shouldn't miss the first occurrenceSee #144.
swiper
should not deactivate markivy-mode
should not switch to TRAMP for certain inputSee #145.
counsel-find-file
should work better with TRAMP"/ssh:foo" should not be cut off See #145.
counsel-find-file
supports Windows drive lettersSee #155.
counsel-file-file
should work better with files that contain "~"See #157.
counsel-M-x
should respect ivy-format-function
See #150.
counsel-git-grep
should position better on exitSee #153.
ivy-mode
should re-scale text to minibuffer heightSee #151.
counsel-unicode-char
should use action-style callSee #160.
ivy-read
should allow % in prompt stringSee #171.
ivy-call
should execute in proper windowSee #176.
ivy-mode
When in Info-mode
, press g
and select either "(./)" or "(../)" to
switch to file name completion. That file will be opened with Info.
2. Account for minibuffer-depth-indication-mode
If you have minibuffer-depth-indication-mode
on, the minibuffer
prompt will indicate the current depth.
See #134.
3. Add fuzzy matching function
To enable fuzzy matching, set your ivy-re-builders-alist
accordingly:
(setq ivy-re-builders-alist
'((t . ivy--regex-fuzzy)))
See #136.
See also #142 for toggling fuzzy matching with C-o m
.
4. case-fold-search
optimization
Bind case-fold-search to t when the input is all lower-case:
See #166.
5. Allow to see the candidate index a la anzu
via ivy-count-format
To have this feature, use something like this:
(setq ivy-count-format "(%d/%d) ")
See #167.
You can also set this to nil, if you don't want any count, see #188. 6. Allow to add additional exit points for any command
Example for ivy-switch-to-buffer
:
(ivy-set-actions
'ivy-switch-buffer
'(("k"
(lambda (x)
(kill-buffer x)
(ivy--reset-state ivy-last))
"kill")
("j"
ivy--switch-buffer-other-window-action
"other")))
After this:
M-o k
to kill a bufferM-o j
to switch to a buffer in other windowYou can always use M-o o
to access the default action. When there is
only one action, M-o
does the same as C-m
.
See #164.
counsel-describe-function
and counsel-decribe-variable
Press C-,
to look up the symbol in info, instead of the default
describe action.
See #121.
2. Handle symbol-at-point better in non-Elisp buffers
See #126.
ivy-switch-buffer
ivy-virtual
See #129. 2. Deal better with invisible buffers
See #135. 3. Add custom keymap
You can customize ivy-switch-buffer-map
.
See #164. 4. Add extra actions
Add a kill-buffer
action, and switch-to-buffer-other-window
action.
counsel-git-grep
Make it fully async: the process git grep
will be killed and
restarted on new input. This results in almost no keyboard delay.
2. Own history variable
swiper
Having own history variable allows to get more use of M-p
, M-n
and C-r
.
counsel-el
This allows to make use of C-M-n
and C-M-p
.
counsel-locate
In addition to the default action of opening a file add:
xdg-open
actiondired
actionPress M-o
or C-o
to access these actions.
3. Add own history
A matcher is a function that accepts a regexp and a list of candidates and returns the filtered list of candidates.
The default matcher is basically cl-remove-if-not
+ string-match
.
If you'd like to customize this, pass your own matcher.
See counsel-git-grep-matcher
for an example.
2. Allow to customize the initial input for all commands
Customize ivy-initial-inputs-alist
for this.
See #140.
3. ivy-sort-functions-alist
should also examine this-command
4. :dynamic-collection is now a boolean
Pass the collection function as the second var instead.
ivy-call
Execute the current action for the current candidate without exiting
the minibuffer. Bound to C-M-m
or M-RET
or C-o g
.
counsel-find-file
Forward to find-file
with Ivy completion.
ivy-next-line-and-call
as well as ivy-resume
should work for this command.
The variable counsel-find-file-ignore-regexp
allows to ignore
certain files, like dot files. Input a leading dot to see all files.
The variable counsel-find-file-at-point
allows to automatically use
ffap
. You also can do it manually with M-n
when the point is on a file name.
The variable counsel-find-file-map
allows to customize the
minibuffer key bindings for this command.
Recommended binding:
(global-set-key (kbd "C-x C-f") 'counsel-find-file)
You can peek at files with C-M-n
and C-M-p
.
See #152 about M-n
, M-p
and M-i
switching directories when necessary.
ivy-recentf
Find a file on recentf-list
.
Note that if your set ivy-use-virtual-buffers
, recentf-list
is
merged into candidates list for ivy-switch-buffer
. But if you want
it separately, you can use this command.
See #124.
ivy-yank-word
Add word at point to minibuffer input.
This is similar to what C-w
does for isearch
. However it's bound
to M-j
instead of C-w
, since C-w
is bound to kill-region
- a
useful command.
See #125.
counsel-M-x
Forward to execute-extended-command
with Ivy completion.
The candidate list will also display the key binding for each bound command.
This command will piggyback on smex
for sorting, if smex
is installed.
Use counsel-M-x-initial-input
to customize the initial input for
this command. By default, it's "^" - the regex character that
indicates beginning of string. This results in much faster matching,
since you usually type the command name from the start.
hydra-ivy
Press C-o
to toggle the Hydra for Ivy.
It gives access to shorter bindings and many customizable options.
Use C-o >
to grow the minibuffer.
Use C-o <
to shrink the minibuffer.
See #151.
ivy-toggle-calling
Toggle executing the current action each time a new candidate is selected.
This command is bound to C-o c
.
To explain how this is useful: C-M-m C-M-f C-M-f C-M-f
is equivalent to C-o cjjj
.
ivy-insert-current
Inserts the current candidate into the minibuffer.
Press M-i
if you want something close to the current candidate. You
can follow up with an edit and select.
I find this very useful when creating new files with a similar name to
the existing file: C-x C-f M-i
+ a bit of editing is very fast.
See #141.
counsel-load-theme
Forward to load-theme
with Ivy completion. Allows to rapidly try themes (e.g. with C-M-n
).
ivy-reverse-i-search
Allow to recursively match history with C-r
.
I like this command from bash shell. The usual way to search through
history is with M-p
and M-n
. Using ivy-reverse-i-search
will
open a recursive completion session with the current history as the
candidates.
counsel-rhythmbox
ivy-dispatching-done
Select an action for the current candidate and execute it. Bound to M-o
.
Some commands that support M-o
:
counsel-rhythmbox
counsel-describe-function
counsel-describe-variable
ivy-switch-buffer
counsel-locate
counsel-org-tag
Forward to org-set-tags
with Ivy completion.
Selecting any tag each time will toggle it on/off. The current list of selected tags will be displayed in the prompt.
counsel-org-tag-agenda
Forward to org-agenda-set-tags
with Ivy completion.
See #177.
counsel-ag
Interactively ag
using Ivy completion.
counsel-recoll
Use recoll
with Ivy completion.
See Using Recoll desktop search database with Emacs.
Install recoll with sudo apt-get install recoll
.
swiper-from-isearch
Start swiper
from the current isearch
input.
ivy-immediate-done
Use this command to exit the minibuffer choosing not the current
candidate, but the current text. Bound to C-M-j
or C-u C-j
.
See #183.
dired
when completing file names, so that the directory face is loaded.confirm-nonexistent-file-or-buffer
.grep-read-files
: it should be possible to simply M-x rgrep
RET RET RET.ivy-switch-buffer
should pre-select other-buffer
just like switch-buffer
does it.counsel-git-grep
should warn if not in a repository.counsel-info-lookup-symbol
.ivy-read
should check for an outdated cons initial-input.I actually like in-order matching, meaning the input "in ma" will match "in-order matching", but not "made in". But the users can switch to out-of-order matching if they use this code:
(setq ivy-re-builders-alist
'((t . ivy--regex-ignore-order)))
ivy-re-builders-alist
is the flexible way to customize the regex builders per-collection. Using t
here, means to use this regex builder for everything. You could choose to have in-order for files, and out-of-order for buffers and so on.
ivy-tab-space
Use this to have a space inserted each time you press TAB:
(setq ivy-tab-space t)
"pub" can expand to "Public License".
counsel-load-library
This command is much better than the standard load-libary
that it upgrades. It applies a sort of uniquify
effect to all your libraries, which is very useful:
In this case, I have avy
installed both from the package manager and manually. I can easily distinguish them.
Another cool feature is that instead of using find-library
(which is also bad, since it would report two versions of avy
with the same name and no way to distinguish them), you can simply use counsel-load-library
and type C-. instead of RET to finalize.
Here's another scenario: first load the library, then call ivy-resume
and immediately open the library file.
ivy-partial
Does a partial complete without exiting. Use this to replace ivy-partial-or-done
with this command:
(define-key ivy-minibuffer-map (kbd "TAB") 'ivy-partial)
^
in swiper
In regex terms, ^
is the beginning of line. You can now use this in swiper
to filter your matches.
swiper-avy
This command is crazy good: it combines the best features of swiper
(all matches an once, flexible input length) and avy
(quickly select one candidate once you've narrowed to about 10-20 candidates).
For instance, I can enter "to" into swiper
to get around 10 matches. Instead of using C-n a bunch of times to select the one of 10 that I want, I just press C-', followed by a or s or d ... to select one of the matches visible on screen.
So both packages use their best feature to cover up the others worst drawback.
I was never a fan of recentf
until now. The virtual buffers feature works in the same way as ido-use-virtual-buffers
: when you call ivy-switch-buffer
, your recently visited files as well as all your bookmarks are appended to the end of the buffer list.
Suppose you killed a buffer and want to bring it back: now you do it as if you didn't kill the buffer and instead buried it. The bookmarks access is also nice.
Here's how to configure it, along with some customization of recentf
:
(setq ivy-use-virtual-buffers t)
(use-package recentf
:config
(setq recentf-exclude '("COMMIT_MSG" "COMMIT_EDITMSG" "github.*txt$"
".*png$"))
(setq recentf-max-saved-items 60))
All these commands just forward to their built-in counterparts, only trying not to exit the first line of the minibuffer.
ivy-backward-kill-word
ivy-delete-char
ivy-kill-word
ivy-forward-char
See the wiki on how to customize the minibuffer display to look like this:
100 Find file: ~/
file1
file2
> file3
file4
minibuffer-complete
Thanks to this, you can TAB-complete your ssh hosts, e.g.:
/ss
TAB -> /ssh
/ssh:ol
TAB -> /ssh:oleh@
ivy-resume
I've added:
counsel-git-grep
counsel-git
Others (that start with counsel-
) should work fine as well. Also don't forget that you can use C-M-n and C-M-p to:
This is especially powerful for counsel-git-grep
: you can easily check the whole repository for something with just typing in the query and holding C-M-n. The matches will be highlighted swiper
-style, of course.
counsel-git-grep
Use C-l to recenter.
Split only on single spaces, from all other space groups, remove one space.
As you might know, a space is used in place of .*
in ivy
. In case you want an actual space, you can now quote them even easier.
rgrep
While completing file names, ivy expands the file name to full. Unfortunately, rgrep
uses read-file-name-internal
and isn't receptive to globs being expanded with the current directory. A work-around this is to use the generic strategy when ivy is in trouble:
ivy-immediate-done
).ivy-immediate-done
is currently unbound by default. If you want, you can bind it in your config like this:
(define-key ivy-minibuffer-map (kbd "C-c C-d") 'ivy-immediate-done)
This time, they are jabber-chat-mode
and elfeed-search-mode
.
swiper-query-replace
You can launch a query replace with M-q from swiper.
org-refile
candidatesBy default, ivy completion candidates are sorted with string-lessp
. The sorting can be customized with ivy-sort-functions-alist
. While refiling, the natural order is actually best, so the sorting is turned off in that case.
With ivy-mode
you can select a file anywhere on your file system by switching directories repeatedly with C-j (ivy-alt-done
). After moving to a new directory, the point should be on the first candidate.
All this time there was an issue with the face order swapping between 1 and 2 groups. This is now fixed. Also, I've made swiper-match-face-4
inherit from isearch-fail
. It's important to have all 4 faces be different.
When the current input is a bad regex, just display no candidates and continue. Don't throw an error.
While completing file names, you can enter // to move to the root directory. This change was necessary in order to make it possible to enter e.g. /sudo:
or /ssh:
.
/sudo:
and /ssh:
This feature is a bit flaky for now. But it works well on my machine. It should get better after a few bug reports. You can start the completion right after the method, e.g. /ssh:
RET, or after method+user, e.g. /ssh:oleh@
RET.
confirm-nonexistent-file-or-buffer
If you set confirm-nonexistent-file-or-buffer
to t (it's nil by default), you'll have to confirm when you create a new file or buffer with ivy.
ivy-remote
faceJust some extra polish to make things look nicer. The buffers to which you're connected through TRAMP will be highlighted with the new ivy-remote
face.
match-required
interactionsSometimes, the Emacs functions that call completion specify to it that a match is required, i.e. you can't just type in some random stuff - you have to select one of the candidates given to you. In that case ivy will appropriately change the prompt like this:
While completing, you press M-p to select the previous input. This update tries to select not just the first candidates that matches, but the actual previous candidate that you selected before.
ivy-current-match-face
This is only relevant for when the completion candidates have custom face backgrounds. But in that case, the minibuffer looks a lot nicer.
Press TAB to do call ivy-partial-or-done
to complete the current thing to the largest possible prefix. When called twice in a row, it's the same as C-j, i.e. it will finish the completion.
In Emacs, hidden buffer names start with a space. To see them all, press a single space while completing buffers in ivy-mode
. You can toggle between hidden and non-hidden buffers by editing the first space in your input query. Remember that with ivy-mode
the minibuffer is a proper editable area, so C-a works properly (unlike in isearch
or ido-mode
).
Spaces are wild while matching - they serve as group boundaries. However, sometimes it would be useful to quote them. From now on, you can quote N
consecutive spaces by inputting N+1
consecutive spaces.
This is actually a really cool feature, so if you're paying attention to any section, let it be this one.
For example, I cloned boost_1_58_0 and called
counsel-git
, which is like a find-file
for all files in a git repository at once.
Now, the interesting part. If I want to exclude anything with "hpp" in it, I change the input to "utility !hpp" (with M-b !) to get 95 candidates (95=234-139, it checks out). I could exclude some more:
You can use this strategy anywhere, not just for git file. For example, in describe-function
or swiper
.
You can customize ivy-re-builders-alist
to make ivy-mode
complete in the way that you like. The alist dispatches on the collection type, so you can have one completion strategy for buffers, another for files and still another for everything else.
Each function on the alist should turn the string input into a string regex. So the simplest one would be regexp-quote
. If you want to use multi-tier matching, the function should instead return a list of regexps of two types:
and
).or
).ivy-resume
This feature is still a bit of a work-in-progress. But it allows you to resume the last completion to the point before you entered RET or C-g etc. It only works for features that specifically passed :action
to ivy-read
. You could resume other features, but nothing would be done when you select the candidate, since ivy-completing-read
has no idea what the function that called it was going to do with the result.
Currently, you can resume:
counsel-describe-variable
counsel-describe-function
lispy-goto
swiper
Here's how I've bound it in my config:
(global-set-key (kbd "C-c C-r") 'ivy-resume)
(global-set-key [f6] 'ivy-resume)
The ivy-resume
feature adds occur
-like functionality to swiper
. Calling ivy-resume
is like switching to the *Occur*
buffer.