PROJECTS NOTES HOME

Ivy new file creation completion candidates bug

1 ivy new file creation completion candidates bug

In Emacs with Ivy, when you try to create a new file with a name that partially matches an existing file, Ivy will prioritize the existing file as a completion candidate. If you want to create a new file with a similar name, you can use the following workaround:

Start typing the name of the new file you want to create, for example, "api".

When Ivy presents the completion options and highlights the existing file "lifeapi", press the C-M-j key combination (which stands for ivy-immediate-done). This key combination allows you to bypass the completion and directly accept the current input as the selected option.

After pressing C-M-j, Ivy will accept the current input and create a new file with the name you specified ("api" in this case), instead of choosing the existing "lifeapi" file.

By using C-M-j, you can bypass the completion and proceed with creating the new file with the desired name, even if it partially matches an existing file.

Note: The keybinding C-M-j is the default binding for ivy-immediate-done, but it may vary depending on your Emacs configuration. If C-M-j doesn't work for you, you can check your Ivy keybindings or customize the keybinding for ivy-immediate-done in your Emacs configuration.