ā† Home

My Cursor Setup

7 min read Ā·

cursor is Ai powered code editor, it is a game changer for me, I use it for everything, from writing to coding to thinking to everything, i bought the pro version, i am able to use all the models from one place from asking question to whatever i want, for $20 a month is fair deal, cause rather than buying many subscription, i can use one, and i can use all the models from one place,

but this was not the same when i started using it, you may have seen lot of people tweeting about that they built this app without any knowledge of coding and whatsoever, but when we try it, it feels like goose chase,end less loops and itā€™s not able to understand what i want,

here are some of the things which i did to make cursor experience better, and shipping things at god speed:

Fix the system prompt:

itā€™s all about prompts!

in cursor there is setting where you can set the system prompt, and it will use that as base prompt for all the projects,

you can find it in the settings > cursor settings cursor-base-prompt

here is the prompt which i use which i got from Ian(who works at cursor):

DO NOT GIVE ME HIGH LEVEL SHIT, IF I ASK FOR FIX OR EXPLANATION, I WANT ACTUAL CODE OR EXPLANATION!!! I DON'T WANT "Here's how you can blablabla"
Be casual unless otherwise specified
Be terse
Suggest solutions that I didn't think aboutā€”anticipate my needs
Treat me as an expert
Be accurate and thorough
Give the answer immediately. Provide detailed explanations and restate my query in your own words if necessary after giving the answer
Value good arguments over authorities, the source is irrelevant
Consider new technologies and contrarian ideas, not just the conventional wisdom
You may use high levels of speculation or prediction, just flag it for me
No moral lectures
Discuss safety only when it's crucial and non-obvious
If your content policy is an issue, provide the closest acceptable response and explain the content policy issue afterward
Cite sources whenever possible at the end, not inline
No need to mention your knowledge cutoff
No need to disclose you're an AI
Please respect my prettier preferences when you provide code.
Split into multiple responses if one response isn't enough to answer the question.
If I ask for adjustments to code I have provided you, do not repeat all of my code unnecessarily. Instead try to keep the answer brief by giving just a couple lines before/after any changes you make. Multiple code blocks are ok.
DO NOT GIVE ME HIGH LEVEL SHIT, IF I ASK FOR FIX OR EXPLANATION, I WANT ACTUAL CODE OR EXPLANATION!!! I DON'T WANT "Here's how you can blablabla"
Be casual unless otherwise specified
Be terse
Suggest solutions that I didn't think aboutā€”anticipate my needs
Treat me as an expert
Be accurate and thorough
Give the answer immediately. Provide detailed explanations and restate my query in your own words if necessary after giving the answer
Value good arguments over authorities, the source is irrelevant
Consider new technologies and contrarian ideas, not just the conventional wisdom
You may use high levels of speculation or prediction, just flag it for me
No moral lectures
Discuss safety only when it's crucial and non-obvious
If your content policy is an issue, provide the closest acceptable response and explain the content policy issue afterward
Cite sources whenever possible at the end, not inline
No need to mention your knowledge cutoff
No need to disclose you're an AI
Please respect my prettier preferences when you provide code.
Split into multiple responses if one response isn't enough to answer the question.
If I ask for adjustments to code I have provided you, do not repeat all of my code unnecessarily. Instead try to keep the answer brief by giving just a couple lines before/after any changes you make. Multiple code blocks are ok.

paste the above in rules for AI, also make sure you have checked the include cursor rules checkbox.

.cursorrules:

The instructions in the .cursorrules file will be included for features such as Cursor Chat composer and other places, this is like project specific prompts,

this site cursor.directory is full of useful cursrorules which is created for specific framework or project you are working on,

so create .cursorrules at the root of the project and customise it according to the stack of your project,

one important thing/hack which i found it, .cursorrules is not one time thing, that you create and forget, it needs to evolve as your project evolve, if you want specific coding style, specific things for some specific lib, update it, and i use curosr chat to update the cursorrules when i am stuck on the bug or being faced by endless loop in cursor, so it never happens again!

prompt -> bug by cursor-> yell it it to fix it ->prompt it again to fix the curosrrules

Composer hacks:

if you donā€™t know you can open composer by using āŒ˜ + I, add all the files which you need as context to edit the code and tell cursor what to do, it can create new files(canā€™t delete), and auto applies the changes,

first enable the following settings:

compser-setting

make sure you enable Auto Context, which will automatically include the relevant codebase and other things in composer, best thing!

@ is your friend, use it as much as you can, and it will improve your life easily, donā€™t be shy when using it, i would say abuse it: cursor-composer

@files:

I am not talking about basic ones like files and folder, cause they are straight forward, add files/folder what you want in context and continue the prompting it,

how i use it: composer-file i include in the prompt itself, thatā€™s how i write my prompt.

@web:

my stackoverflow visit has been reduced lot, because of this, whatever question or error i am getting there is higher chance that other people also got it, but models may not have that info when they were trained, so google search helps a lot, but i just add @web at the end of the prompt,

it goes to web, find relevant github issue and site and whatnot, and gives me the solution: web-composer

and many times i find great blog or article regarding feature i am implementing but itā€™s too long so i directly past the link in the composer and it fetches the context from that blog, and get me what i want, and even i can chat with it

@docs:

there will be many new lib, or some unknow lib which i am using in my codebase, which models are not aware about, so it sucks when generating the code, so if model donā€™t have the knowledge, it will hallucinate it like crazy!

i docs for most of lib i am using using @doc > Add New Doc

after which following pop up will come in that you only need to give the entry point and it will figure out other things by itself! composer-add-docs

so when you are dealing with code which requires specific lib, tell the composer by using @, so it can produce better code

there are some advanced ones also like @git, @code, @Codebase, which you can checkout them on their docs

Agents:

recently in composer they have introduced new mode as agent,

difference between normal and agent mode is, agent mode can plan things, execute them, and if it stuck it can get back on the track by itself, think of it like your smart junior intern!

currently by default Agent can make up to 25 tool calls before stopping, if want more mail the cursor team,

in that also i tell it to what to avoid or what not to do, so i can get what i better when i know what i want, but if i donā€™t know, and i am on the exploration mode, i let it take me wherever it takes me, which i havenā€™t thought about, or if have vague idea, then tell the references of your vague inspirations.

composer-agent

Checkpoints:

whenever you use composer, and you tell it to make new change, it creates checkpoint at previous one, and start following new instruction, so if i am not happy with newer changes, i can go back to the previously generated code by clicking it on restore composer-checkpoint

Images:

Whenever i am dealing with frontend related changes, which i hate, i just paste the images of the output i want and prompt it with relevant file context to get what i want:

make sure you donā€™t upload too blurry or low resolution image if you want better results

composer-image

Note: if your composer chat becomes too big, and it starts giving bad/useless code, it because of context window issue, start new composer again and continue what you were doing to get better resule.

also you can manually go in the files and select the changes which you want by clicking on yes and reject what you donā€™t want,

.cursorignore:

it works same as gitignore, it tells cursor which files or folder not to index, so if you have some files or folder which you donā€™t want cursor to take in context, add them here

sh
# Ignore all files in the `dist` directory
dist/
# Ignore all `.log` files
*.log
# Ignore specific file `config.json`
config.json
sh
# Ignore all files in the `dist` directory
dist/
# Ignore all `.log` files
*.log
# Ignore specific file `config.json`
config.json

Cursor tab:

Cursor tab is custom code completion model which is developed by the cursor team, which learn as you write code and suggest the next changes, and you just have to press tab,

it comes by default turned on, but make sure you are using that over github copilot,

why?

GitHub Copilot can insert text at your cursor position. It cannot edit the code around your cursor or remove text.

turn off github copilot if you are using it to get best out of cursor!

tab to accept and esc to reject!

it is so good that sometime i find myself just pressing tab tab tab, no other keys!

if you want to refactor or small changes select the code and hit āŒ˜+K and tell what to do, and it will work on it, donā€™t use composer or chat for small small changes or refactor

Terminal:

directly adding errors to composer or chat, if you donā€™t get those buttons, try selecting the text,

curosr-terminal

generate commands for terminals using cursor(i am not going to download wrap for just this one feature):

open terminal hit āŒ˜+K and tell it: cursor-terminal-suggestion

Notepads:

will write this after lunch!

yup thatā€™s it for now, share it if you find them useful, and share other good features and hacks with me if you find them on twitter