Create a new file with a similar name in Emacs with Helm
Asked Answered
T

1

14

I always end up opening an eshell and executing find-file new-file-name, because helm always supplies me with candidates and a million options that don't look like the basic feature that I want: forcing the file to be called what I typed. For example, I want to great an org document called mto.org in a directory with another org file in it.

Helm completes rather than letting me make a new file :(

How can I force helm to create the file with the name I typed, so I can save 10 seconds by avoiding opening up eshell and adding a small, but (hopefully easily) avoidable disruption of my concentration?

Tadeas answered 8/9, 2014 at 17:48 Comment(2)
If you have the external application touch, how about evaluating?: (start-process "touch-file" nil "touch" "moto.org") If you like that, then you can make it more elaborate to check the existence of a file with that name and if it exists then creating that name plus 1, 2, 3, etc. -- e.g., moto1.org, moto2.org, moto3.org.Hernia
is your helm package up-to-date? I think there was bug around this a while back.Glove
J
29

You can press C-p and select the line

[?] mto.org

and then just press RET. It will (ask you to) create the file with the name you typed.

Joannjoanna answered 8/9, 2014 at 22:10 Comment(2)
Perfect. I should have guessed!Tadeas
This is extremely nonobvious, so thank you very much!Hedvig

© 2022 - 2024 — McMap. All rights reserved.