How I'm using Cursor

Updated 14 January 2025

After not using Twitter for the past couple of years and only coding at my day job, I’ve been a bit out of the loop tech-wise. At work, we tend to be 2 major React versions behind, so I never really deal with the “latest and greatest” in tech unless I code outside of work. This means that I’ve been mostly ignoring the whole AI thing (outside of occasionally asking ChatGPT a question), but now that I’m back on Bluesky and seeing it mentioned everywhere I figured I should finally up-skill into using it, before AI comes and takes my job.

Using AI to help in your programming definitely does have a learning curve though, so here’s some notes and what I’ve found works for me.

Give the AI some rules

If you go to Cursor > Settings > Cursor Settings > General you can give the AI some rules. And you can get pretty specific.

Cursor’s Chat vs Composer

After bringing up the AI UI with Command + L, you’ll notice there are multiple tabs. By default it lands you in Chat which is what I’ve mostly been using. Even from Googling, I’m not sure what the difference is between the chat and the Composer tab. But I think the composer is supposed to be better.

Give the AI context files

By default, the chat doesn’t have access to any of your files. If you select code in a file, and then press Cmd + L, it will open the Chat with that file automatically added as context. I can add more files by doing the @ symbol in the chat, and then adding a file path, and it will bring up a UI to let you choose from the available files.

You can also drag and drop folders and files from the file explorer and it will use it as context.

I’ve noticed you can hit enter on the chat, but the UI also has a “Submit codebase chat” option if you press Cmd + enter, which will use the codebase as context.

Getting alt text for all of your images

Adding alt text to my image-heavy posts usually takes a bit of time, and I’m not the best at writing it. I’m finding the AI to be a super helpful tool here. I just ask it:

Can you add alt text to all the images in this file?

And give it the Markdown file of my blog post as context. It’s not 100% accurate so I do go through and edit it a bit.

Actually I wonder if it can actually view my images, or if it’s using the file name the text surrounding it for context. Either way, it does the trick.

Tell the AI to first clarify the requirements

So as an example, if I’m asking the chat to write a script, I’ve found that first getting the AI to play-back your requirements to make sure it’s not misunderstood anything seems to be useful. This is what I told the AI:

Before writing the script, can you first play back to me what you are planning on doing, and I will confirm if you are on the right track or not.

Otherwise, it will immediately spit out the code, and you have to read it all, and figure out if you are missing anything.

In this, it had left out one of my requirements, so I was able to get it amended before it wrote me my code.

If you want to modify a dataset, ask the AI for a script instead

This example was with ChatGPT, but is probably applicable to Cursor as well. I’ve had a case where I’m storing a lot of data about mountains in a JSON file. I naively asked the AI to loop through all the data and update it for me, e.g. change one of the key values to something else. But it got stuck partway through. I realised that it’s more efficient to ask it to generate a script to change it, and then run it yourself.

Asking it CSS questions

This is a bit of a hit or miss. Sometimes I still need to get Stack overflow.

It’s pretty good at this one.

Asking it to write unit tests

In a work context, I usually give it a sample file to base it off, since my company’s codebase has so many niche util functions and so on that I wouldn’t make sense to randomly write the unit test using its own gener knowledge.

Using it for writing blog posts

To be honest, I’m not finding AI useful at all in helping me write my blog posts. The way it writes feels a bit too flowery and AI-like for my liking. At best, I think it’s been a little useful when I’ve asked it to help me clean up my introduction paragraph a bit or give me better suggestions on how to structure it, since I find I’m not so good at writing those. But I’ll report back if I find that changes.

Leave a comment