abo-abo / swiper

Ivy - a generic completion frontend for Emacs, Swiper - isearch with an overview, and more. Oh, man!
https://oremacs.com/swiper/
2.3k stars 338 forks source link

how to write-file to a name that is a prefix/substring of a candidate? #2994

Closed mooseyboots closed 2 years ago

mooseyboots commented 2 years ago

i use ivy/counsel (and swiper too! thx).

sometimes i want to write-file to a name that is a sub-string of an existing file in the same directory. as i type in my filename, my only option is to match the existing file and overwrite it.

e.g., in .emacs.d/: C-x C-w ini RET [or C-j] offers to overwrite init.el, but i don't want to do that, i want to save a file in the same dir called ini [for argument's sake].

is this possible?

currently it seems like the only way to get around this is to add a letter that matches no candidates, like ino. but then you have to re-name the file later.

i suspect there's a similar issue for find-file also, as it should also create a new file if one doesn't exist, so the user should be able to create a new file ini, and not only match candidate init.el.

i'm probably just missing something, but thought to query here.

mooseyboots commented 2 years ago

looks like C-M-j is what we're after!