Ivy 0.10.0 is out
30 Nov 2017Intro
Ivy is a completion method that's
similar to Ido, but with emphasis on simplicity and customizability.
Overview
The current release constitutes of 280 commits and 8 months of
progress since 0.9.0. Many issues ranging from
#952 to
#1336 were fixed.
The number of people who contributed code as grown to
91; thanks,
everyone!
Details on changes
Changelog.org has been a part of the repository since 0.6.0, you
can get the details of the current and past changes:
Highlights
Many improvements are incremental and don't require any extra code to enable. I'll go over a few selected features that require a bit of information to make a good use of them.
Selectable prompt
Off by default. You can turn it on like so:
(setq ivy-use-selectable-prompt t)
After this, your current input becomes selectable as a candidate. Press C-p when you're on the first candidate to select your input instead.
This solves the long standing issue of e.g. creating a file or
a directory foo when a file foobar already exists. Previously, the
only solution was to use C-M-j. It's still available, but
now you can also select your input with C-p and press
RET.
New global actions for ivy
ivy-set-actions was used to enable the following bindings:
- Press M-o w to copy the current candidate to the kill ring.
- Press M-o i to insert the current candidate into the buffer.
These bindings are valid for any completion session by default.
Use C-d in ivy-occur buffers
Here's an example use-case: search your source code for a variable
name with e.g. counsel-rg and call ivy-occur (C-c C-o).
Suppose you get 10 results, only 4 of which are interesting. You can
now delete the uninteresting ones with C-d. Then maybe
check off the others with C-d as well as you complete them
one by one. A sort of a TODO list.
Similarly, if you want to go over variables to customize, you can call
counsel-describe-variable with input ^counsel-[^-] and then check
off the ones you have already examined with C-d.
Defcustoms to play with
Here's the list of new defcustom or defvar that might be
interesting to review:
counsel-async-filter-update-timecounsel-async-ignore-recounsel-describe-function-functioncounsel-describe-function-preselectcounsel-find-file-ignore-regexpcounsel-fzf-dir-functioncounsel-git-grep-skip-counting-linescounsel-git-log-split-string-recounsel-url-expansionsivy-auto-select-single-candidateivy-magic-slash-non-match-actionivy--preferred-re-buildersivy-truncate-lines
New Commands
14 new commands were added by me and many contributors. Here's the list:
counsel-ack- completion for ackcounsel-apropos- completion for aproposcounsel-file-register- completion for file registerscounsel-fzf- completion for fzfcounsel-git-change-worktree- completion for git-worktreecounsel-git-checkout- completion for git-checkoutcounsel-minibuffer-history- generalization ofcounsel-expression-historyandcounsel-shell-command-historycounsel-org-capture- completion for org-capturecounsel-org-file- browse all attachments for the current Org filecounsel-org-goto- completion for Org headingscounsel-org-goto-all- completion for Org headings in all open bufferscounsel-switch-to-shell-buffer- switch to a shell buffer, or create oneivy-occur-delete-candidate- delete current candidate inivy-occur-modeivy-switch-view- select a window configuration, decoupled fromivy-switch-buffer
My personal favorites are counsel-fzf and counsel-org-file.
Outro
Again, thanks to all the contributors. Happy hacking!
P.S. Please consider joining my 74 patrons to give me the opportunity to work on Free Software a lot more. We are currently at 30% of the goal.