emacsemacs-preludeemacs-helm

How do create a new file that matches an existing file in Emacs Prelude?


In Emacs Prelude, I cannot figure out how to create a new file when a file exists that "matches" the name of the file.

In the example screen capture, I am trying to create a file called spawn.exs in a directory that already contains a file called spawn_basic.exs. When I use C-xC-f to create a new file, emacs is matching spawn.exs to spawn_basic.exs and hitting Enter results in opening spawn_basic.exs instead of creating spawn.exs.

enter image description here

I've tried some workarounds (i.e. using touch to create the file) but I'm looking for a simpler solution that would require only one command. If there is not a command to do this, is there a way to disable the file name matching feature in Prelude? I like most everything else about Prelude compared to vanilla Emacs so I would rather not switch back.


Solution

  • In Prelude, C-x C-f is bound to helm-find-files. It's usually great, but for this case I don't see a good workaround for bypassing its match (as you've described).

    However, ido-find-file has a similarly friendly completion system, yet offers a nice solution to bypass the completion. When you type spawn.exs, open by pressing C-j instead of RET. I think Helm should do this too (instead of treating them the same), so you might want to submit a feature request (to match Ido's "verbatim entry").

    Ido works well as a find-file replacement, and it's recommended over Helm for simple cases like this in Mastering Emacs. So you could remap it with:

    (global-set-key (kbd "C-x C-f") 'ido-find-file)