In spacemacs, a user can normally create a file using 'Ctrl-x Ctrl-f', and then entering a filename in the minibuffer.
However, if a file with a similar name exists, then spacemacs does not create a new file. It opens the existing file instead.
One workaround is to jump to a terminal and create the new file, then return to spacemacs and open that file.
But this interferes with the workflow.
This isn't how an editor should work, and I can't see how it isn't a bug. This behaviour does not exist in normal emacs.
Is there a way to disable this behaviour?
It's not a bug... it's a feature of ivy completion. It happens when the file name is a prefix of an existing name, for example if you try to open a new file foo
in a directory containing an existing file foobar
. You can choose the current input ( foo
) instead of the current candidate ( foobar
) with CMj, see: https://elpa.gnu.org/devel/doc/ivy.html#Key-bindings-for-single-selection-action-then-exit-minibuffer
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.