0

Using Doom Emacs, when I invoke a command (such as diff) that needs a filepath I get an ivy prompt that names a default value:

ivy with default

But I am unable to clear the line or somehow tell ivy to take that default. Does ivy even know about it? Can I force ivy to output an empty string?

I browsed the ivy docs but to no avail

4
  • 1
    You can exit completion with an empty or the current input using C-M-j (ivy-immediate-done), documented under (info "(ivy) Key bindings for single selection action then exit minibuffer").
    – Basil
    Jul 2 '21 at 16:26
  • I know and use that binding, but it uses the current input - and I can't clear the input line, at least to my knowledge
    – xeruf
    Jul 3 '21 at 17:05
  • With empty input, C-M-j should exit with the default offered by diff. Ivy doesn't support completely clearing the prompt during file name completion.
    – Basil
    Jul 3 '21 at 17:28
  • Thanks @Basil, you are right, I didn't try correctly yet!
    – xeruf
    Jul 3 '21 at 17:45
0

Use ivy-immediate-done (defaults to C-M-j) without entering any text to use the default value.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.