Hot answers tagged

29 votes

Ivy disable completion for a command in minibuffer

I think what you're looking for is C-M-j (ivy-immediate-done) in the mini buffer. This function is described as follows in the Ivy manual: Exits with the current input instead of the current ...
25 votes
Accepted

Enable ivy fuzzy matching everywhere, except in swiper

I'd like to continue using fuzzy matching with Ivy except in swiper. The variable that determines which "regexp builder", as Ivy refers to these functions, is used for which collection function is ...
  • 11.7k
12 votes
Accepted

How can I setup eshell to use ivy for tab completion?

This should work fine: (define-key eshell-mode-map (kbd "<tab>") 'completion-at-point) I don't know why the above isn't the default. But I use only shell-mode and term-mode anyway.
  • 13.8k
11 votes
Accepted

Code auto completion with ivy

What you want can be achieved by adding a new source to completion-at-point-functions. This isn't specific to ivy, but ivy makes use of it: (defun dabbrev-complation-at-point () (dabbrev--reset-...
  • 13.8k
11 votes
Accepted

Display corresponding key binding of command during M-x completion

The command counsel-M-x does this for you: (ivy) Global key bindings recommends you remap M-x (execute-extended-command) to counsel-M-x in order to avail of its increased Ivy-ness, e.g. via (when (...
  • 11.7k
11 votes
Accepted

how to ignore current selection from ivy when my typed text matches one

C-M-j (ivy-immediate-done) - exit with the current action, calling it on the current input instead of the current candidate. This is useful especially when creating new files or directories - often ...
9 votes

How to create a new buffer with ivy-switch-buffer that shares a substring with an existing buffer?

You can use C-M-j which calls ivy-immediate-done to force the output to be exactly what you typed instead of having it complete to the the nearest match This and more information can be found in the ...
  • 1,255
9 votes
Accepted

How to ignore certain filename patterns in `find-file`/`counsel-find-file`?

Yes, use counsel-find-file-ignore-regexp. For the simple example you provide use (setq counsel-find-file-ignore-regexp "\\.elc\\'") The are more examples in the docstring for that variable.
  • 1,490
9 votes
Accepted

Show counsel-ag results in separate buffer?

Try C-c C-o (ivy-occur) in the minibuffer.
8 votes

What's the equivalent of `helm-find` in ivy/counsel? I want to find files **recursively**

The counsel equivalent of helm-find is counsel-file-jump. See also counsel-dired-jump and John Kitchin's answer for suggestions on writing a custom function.
  • 11.7k
8 votes

Ivy disable completion for a command in minibuffer

There are multiple approaches to file navigation that apply here. Just to rephrase your statement: switch from ~/code/study to ~/other/code/study Easiest and most consistent: use ~ to switch to ~/...
  • 13.8k
8 votes
Accepted

Insert file path via counsel

What would be more convenient is for me to do so via counsel-find-file, navigate to the file path and then insert at the point in the current buffer (or some similar workflow with autocompletion) ...
  • 11.7k
8 votes
Accepted

Swiper get last search term

When you invoke swiper press M-p to search for previously searched thing. M-n will let you search for the word under cursor. C-s will search for the next occurence. UPD, thx @Basil After you ...
  • 1,326
7 votes

Enable ivy fuzzy matching everywhere, except in swiper

If you want to turn off regex matching in swiper, but keep it active elsewhere, add this to your user-init-file: (setq ivy-re-builders-alist '((swiper . regexp-quote) (t . ivy--...
7 votes
Accepted

Omit current and parent directories in Ivy find-file completion

When I'm opening a file I'd like . and .. to be omitted from the list of completion candidates. This is what the user option ivy-extra-directories is for: ivy-extra-directories is a variable defined ...
  • 11.7k
6 votes
Accepted

Extending word search selection in swiper

Try M-j, which is bound to ivy-yank-word in the ivy minibuffer key map. It's worth reading through the the ivy manual, either in Emacs or online. The relevant key bindings are discussed here: http://...
  • 19.9k
6 votes
Accepted

After enabling ivy-mode, `dired-create-directory' does not allow me to choose an entry not in the completion list

Yes. There are 2 cases. The name you want to create doesn't match anything in the completion list, or when it does. When it doesn't, you can just type in the name and press enter. If it does match, ...
  • 1,869
6 votes

How can I setup eshell to use ivy for tab completion?

I found something that seems to work OK upon initial testing: essentially rebind <tab> to pcomplete-std-complete, but since that function isn't interactive for some reason, you need to wrap it: ...
  • 4,662
6 votes
Accepted

Edit org-mode tags using ido or ivy completion

For those users of an ivy/counsel persuasion, the command counsel-org-tag (added in v0.6 AFAICT) enables ivy-backed completion (including multiple selection and deselection) of org-mode tags: ...
  • 11.7k
6 votes

How to toggle regex for helm/ivy user input?

If it's not possible for helm, how about ivy/counsel/swiper? Ivy is the library which Swiper search and Counsel convenience functions are backed by, so changing the way Ivy interprets its input ...
  • 11.7k
6 votes
Accepted

How to keep Ivy from quitting when I press backspace in the minibuffer?

Ivy provides a user option to control this behaviour. Quoth (ivy) Defcustoms (edit mine): -- User Option: ivy-on-del-error-function Specify what [to do] when ‘DEL’ (‘ivy-backward-delete-char’) ...
  • 11.7k
6 votes
Accepted

Open directory containing file during counsel-file-jump

You can create a new Ivy action that opens the directory of a file name selection. It can be done with: (defun my/ivy-open-dir-action (x) (interactive) (dired (or (file-name-directory x) ...
6 votes
Accepted

Ivy: sort candidates by most recently used

I would suggest using ivy-prescient. It is a package that provides sorting and filtering for ivy. After installing it, you enable it with ivy-prescient-mode. For more details on it's usage see its ...
  • 1,363
6 votes
Accepted

ivy counsel find-file with similar name

Using C-M-j when you're at prompt line. Binds to ivy-immediate-done As manual states it goes with current input instead the current candidate.
  • 2,476
5 votes
Accepted

distinguish ido/ivy's virtual-buffers with equal names using directory?

According to https://github.com/abo-abo/swiper/issues/648, it's simply (setq ivy-virtual-abbreviate 'full) It's not quite as nice as opened buffers (where only the differing part is shown), but ...
  • 1,085
5 votes
Accepted

How to switch between Ivy completion styles?

The code in this answer is now part of Ivy: https://github.com/abo-abo/swiper/commit/ae438ff62fa3d9b98d899afc0e97c13be2148725 Within ivy-hydra, the m key is bound to the command ivy-toggle-fuzzy, ...
  • 11.7k
5 votes
Accepted

How to remove files from recentf / ivy-virtual-buffers?

Ivy already has an action bound to "k" for ivy-switch-buffer, but it just calls kill-buffer so it does not work on virtual buffers. Based on what ido is doing, here's some code to replace the ...
  • 19.9k
5 votes
Accepted

Create a new file in a new folder

In ivy, it can not to create directly a new file in a new folder Emacs can do this regardless of whether ivy-mode is enabled, or whether you are using counsel-find-file. You will be prompted to ...
  • 11.7k
5 votes
Accepted

Don't show "." and ".." in counsel-find-file

You can hide those entries with (setq ivy-extra-directories nil).
4 votes
Accepted

sql-connect with Ivy

This is an issue in ivy, so I filed it: https://github.com/abo-abo/swiper/issues/1112. And it's already been fixed!
  • 19.9k

Only top scored, non community-wiki answers of a minimum length are eligible