Cursor AI Coding
The Easiest Way to Use Cursor to build apps.
Related
Best Practices
The key is to provide clear instructions with ample context to get the most relevant and accurate code suggestions.
By planning ahead, leveraging existing prompt libaries and rules, using shortcuts, providing context, and continuously training the AI - you can significantly boost your productivity and code quality when working with Cursor AI.
- Visualize Intentions
- Copy Effective Configs
- Learn Keyboard Shortcuts
- Provide Valuable Context
- Positive Feedback Loop
Visualize Intentions
Map out flow of value before coding.
- Sketch your ideas: Use tools like Figma or even pen and paper to outline your project before starting to code. Having a visual reference can help clarify your intentions to Cursor AI.
- Visualize with tools: Platforms like V0 by Vercel can help you quickly create wireframes. Providing Cursor AI with a clear plan and visual references gives it more context, resulting in more accurate code generation.
Copy Effective Configs
Leverage Cursor Directory for Better Prompts
- Copy expert prompts: Find prompts in cursor.directory tailored to the technologies you're using, such as Next.js, React, or Python.
- Set up cursor rules: Create a
cursor.rules
file in your project root with appropriate prompts to guide Cursor AI to align with your project's specific needs and conventions.
Learn Keyboard Shortcuts
Use Keyboard Shortcuts Effectively
- (Ctrl | ⌘) + K instead of (Ctrl | ⌘) + L: ⌘+K edits the file directly, allowing you to stay focused on the code without the distraction of the chat window.
- (Ctrl | ⌘) + Shift + I for Composer: Enable the Composer feature in settings, then use this shortcut to open it for making edits across multiple files simultaneously.
Provide Valuable Context
- Upload documentation: In Cursor settings, upload documentation URLs for the frameworks, languages, or packages you're using. This allows Cursor AI to refer to them for best practices.
- Use @ to link files: When asking Cursor AI for help, use @ to link the relevant files and components to provide it with the right amount of context for accurate suggestions.
Positive Feedback Loop
Drive continuous improvement by fine-tuning settings.
- Update AI rules: Edit the "Rules for AI" in settings whenever Cursor AI makes a mistake or does something wrong. This feedback loop helps it learn your preferences and coding style.
- Request explanations: When working with AI-generated code, ask Cursor AI to explain parts you don't understand. This helps you learn best practices and the reasoning behind the code.