I can type control-K to ask the AI to insert text into the current file.
I can just type in the current file and the AI will auto-suggest content. (actually, is there a way to pause that? Sometimes I would like to turn it off)
I can type control L and discuss the code with an AI and get answers.
But nowhere do I see an option to tell the AI that I want to create the following… and have it create the files. That is possible in aider, so if it’s not here that’s a major missing feature.
Yes. It can create files. It has for me, at least.
… in fact, I just did some testing on this.
It actually depends on what model you’re using.
For me, cursor-small would not create the files in my environment. Whereas claude-3.5-sonnet did.
Here’s a video showing the play by play
Thanks. The critical piece of information is control-I. I cannot find anywhere where the composer is shown. It’s not on the menu that I can see. YOu said something about the top right but I couldn’t see. What you are typing in the video is obscured by the top edge of that tool you used to record the video.
I have also created a file via chat, if I remember correctly, using claude
.
WHen I asked the AI in chat, it had no idea how to do that. It could see the file sent to it for context, but was not given any connnection to send data the other way. It could only tell me what I could change. So I would appreciate if you could identify how you did that
Let me try that again and see if I can remember how I did and get back to you.
Here’s the prompt I used in my case:
I would like to create a
club_live.ex
file for a page that will allow me to view the details of a club, but also allow me to edit the details of a club. It will later also allow me to manage memberships to a club and other aspects to it. But for now I want to focus on presenting the details and allowing the details to be edited. As well as toggling the Open/Closed state, and finally allow for deleting a club with a confirmation.
The context was just the clubs_live.ex
file. With just that information, it created the whole file, which I could then apply.
I had the same confusion…but discovered that after you open composer with cntl/cmd-i, you can click on the … on the popup and click ‘display as panel’ (doing this from memory, so exact wording may not be right), then it appear next to ‘CHAT’, as you see @joshg 's video
You have to use the right model if you want it to create files for you. claude-3.5-sonnet is what I used. And don’t worry… when you get the right model, it’ll make changes to your files you didn’t even ask it to make.
So be prepared for that… you have to oversee it pretty well to keep it from doing unwanted things. It loves to delete comments.
All that aside, cursor is amazing and has made me 10x more productive at developing projects.