Cursor AI Beginner Guide: Set Up and Write Code in 30 Minutes
Learn how to use Cursor AI editor from scratch. Install, configure, and start writing AI-assisted code in under 30 minutes with this step-by-step tutorial.
Cursor AI Beginner Guide: Set Up and Write Code in 30 Minutes
You've heard developers rave about Cursor AI — the code editor that writes code alongside you, not just for you. But downloading a new editor and figuring out where to start? That's where most people stall.
This tutorial solves that. In the next 30 minutes, you'll install Cursor, connect it to your first project, and write real code using AI assistance. No prior experience with AI tools required.
By the end, you'll know exactly how to use Cursor AI editor to build faster without sacrificing control over your code.
Caption: The complete workflow you'll follow to start coding with Cursor AI.
What You'll Need
Before we dive in, make sure you have these basics covered:
- A computer running macOS, Windows, or Linux
- An internet connection for downloading Cursor and connecting to AI models
- A code project — any folder with code files works, or create an empty one
- Optional: A GitHub account for version control integration
You don't need a paid subscription to get started. Cursor offers a free Hobby tier that includes 2,000 completions and 50 premium model requests per month — plenty for learning.
Total estimated time: 25–30 minutes from download to your first AI-assisted code.
Step 1: Download and Install Cursor
Head to cursor.com and click the Download button. The site auto-detects your operating system, so you'll get the right installer.
For macOS: drag the Cursor app into your Applications folder. For Windows: run the .exe installer and follow the prompts. For Linux: use the .AppImage file.
When you first launch Cursor, it asks whether you want to import your VS Code settings. If you currently use VS Code, say yes — this pulls in your extensions, themes, and keybindings automatically. Cursor is built on the VS Code framework, so almost everything transfers over seamlessly.
If you're brand new to code editors, skip the import and start fresh. The default setup works well out of the box.
Common mistake: Don't skip the sign-in step. You need a Cursor account (free) to use AI features. Sign up with your email or GitHub account when prompted.
Step 2: Connect Your AI Provider
Cursor needs access to an AI model to generate code. Here's how to set it up:
- Open Cursor and press
Cmd+,(Mac) orCtrl+,(Windows/Linux) to open Settings - Navigate to the Models section in the sidebar
- You'll see options for different AI models — Claude 3.5 Sonnet, GPT-4o, and Cursor's own cursor-small model
The free tier gives you access to basic models. For the best experience, start with Claude 3.5 Sonnet — it's currently the strongest model for code generation and understanding context.
If you have an API key from OpenAI or Anthropic, you can add it under Settings > Models > API Keys for unlimited usage on your own dime. Most beginners should stick with the built-in free tier first.
You can always compare features in our Cursor AI review to decide if upgrading makes sense for you.
Step 3: Open Your First Project
Now let's get some code in front of Cursor:
- Go to File > Open Folder (or
Cmd+O/Ctrl+O) - Select any folder containing code — an existing project or create a new empty folder
- The file explorer appears on the left side, just like VS Code
If you don't have a project, create a new folder called cursor-test and open it. Then create a file called index.html — we'll use this for your first AI-assisted code.
Caption: Quick reference for getting a project open and ready for AI assistance in Cursor.
Step 4: Write Code with Cmd+K (AI Generate)
This is where the magic happens. Cmd+K (Mac) or Ctrl+K (Windows/Linux) is Cursor's inline AI generation shortcut.
Here's how to use it:
- Open your
index.htmlfile (or any code file) - Press
Cmd+K— a small input bar appears at your cursor position - Type a natural language instruction, like: "Create a responsive landing page with a hero section, navigation bar, and footer"
- Press Enter and watch Cursor generate the code inline
You'll see the generated code appear as a diff — green highlights show what's being added. You can:
- Press Accept to keep the code
- Press Reject to discard it
- Edit the instruction and try again
The key to getting good results: be specific. Instead of "make a website," say "create a dark-themed product landing page with a hero image, three feature cards, and a CTA button."
Pro move: Select existing code first, then press
Cmd+Kto edit it. You can say things like "refactor this function to use async/await" or "add error handling to this API call."
Step 5: Chat with AI Using Cmd+L
While Cmd+K generates code inline, Cmd+L opens Cursor's AI chat panel — a conversational interface for asking questions about your code.
Try these commands:
- Press
Cmd+Lto open the chat panel on the right side - Ask: "What does this file do?" — Cursor analyzes the current file and explains it
- Ask: "How can I optimize this function?" — it reviews your selected code and suggests improvements
- Highlight a block of code, press
Cmd+L, and ask "Find the bug in this code"
The chat remembers context from your current session, so you can have a back-and-forth conversation. This is especially useful when you're learning a new framework or debugging a tricky issue.
One powerful feature: @-mentions. Type @ in the chat to reference specific files, folders, or documentation. For example, @index.html explain how the CSS grid is structured tells Cursor to focus on that specific file.
Step 6: Use AI Autocomplete
Beyond the manual commands, Cursor provides intelligent autocomplete as you type. This works differently from traditional autocomplete — it understands the context of your entire project.
Start typing a function name, a comment describing what you want, or even a partial line of code. Cursor will show a grayed-out suggestion that completes your thought. Press Tab to accept it.
What makes this powerful:
- It reads multiple files in your project, not just the current one
- It suggests multi-line completions, not just single words
- It adapts to your coding style as you work
For example, if you type // function to validate email addresses, Cursor will generate the entire function below your comment. The AI reads your intent from plain English.
You can toggle autocomplete in Settings > Features > Autocomplete if you ever want to turn it off.
Step 7: Configure Cursor for Your Workflow
Spend five minutes on these settings to make Cursor work better for you:
| Setting | Where to Find | Recommended Value |
|---|---|---|
| Default model | Settings > Models | Claude 3.5 Sonnet |
| Autocomplete | Settings > Features | Enabled |
| Copilot++ | Settings > Features | Enabled (predicts multiple edits) |
| Privacy mode | Settings > Privacy | "Local" if working on private code |
| Keybindings | Settings > Keybindings | VS Code (if you're familiar with it) |
Copilot++ is worth enabling — it's Cursor's enhanced autocomplete that predicts not just your next edit, but the next several edits across your file. It learns patterns from your changes and suggests batched modifications.
If you're working on proprietary or sensitive code, switch Privacy Mode to "Local" — this prevents your code from being used for training while still giving you AI assistance.
Pro Tips
Use .cursorrules files to customize AI behavior for each project. Create a .cursorrules file in your project root and add instructions like "Use TypeScript strict mode" or "Follow the Airbnb style guide." Cursor reads this file and follows your rules for every AI interaction in that project.
Learn the Tab-heavy workflow. The fastest Cursor developers rarely type full lines. They write a comment, press Cmd+K, review the suggestion, then hammer Tab to accept autocompletions. Your typing drops by 40–60% once you get the rhythm.
Use Cmd+I for multi-file edits. This opens the Composer, which can make coordinated changes across multiple files simultaneously. Say "add user authentication" and Cursor will update your routes, models, and middleware all at once.
Check out our Cursor vs GitHub Copilot comparison if you're deciding between the two tools. The short version: Cursor gives you a more integrated experience, while Copilot works across more editors.
Troubleshooting
"AI features aren't working" — Make sure you're signed in to your Cursor account. Check your internet connection. If you're on the free tier, verify you haven't hit your monthly usage limits under Settings > Account.
"Completions are slow or timing out" — Switch to a lighter model like cursor-small in Settings > Models. Close other bandwidth-heavy applications. If you have an API key, add it for direct model access without queue delays.
"Code suggestions are off-topic or wrong" — Provide more context. Use @ mentions to reference relevant files. Add a .cursorrules file with project conventions. Remember: AI writes plausible code, but you must always review before accepting.
"Cursor crashed or feels slow" — Disable extensions you don't need. Large projects (10,000+ files) can slow down indexing. Go to Settings > Indexing and exclude folders like node_modules, dist, and .git.
Next Steps
Now that you can generate and edit code with Cursor AI, here's where to go deeper:
- Try the Composer (
Cmd+I) for multi-file features — it's where Cursor truly outshines other AI editors - Set up
.cursorrulesfor each project to keep AI suggestions consistent with your team's standards - Explore keyboard shortcuts — press
Cmd+Shift+Pto see all available commands
If you want a deeper look at what Cursor can do, read our full Cursor AI review or compare it against alternatives in our best AI coding assistants roundup.
For pricing details, check out our Cursor AI pricing breakdown to see which plan fits your needs.
Frequently Asked Questions
Is Cursor AI free to use?
Yes. Cursor offers a free Hobby plan with 2,000 completions and 50 premium model requests per month. For heavier use, the Pro plan costs $20/month and includes unlimited completions and 500 fast premium requests. See our Cursor pricing guide for a full breakdown.
Can I use Cursor without VS Code experience?
Absolutely. Cursor is beginner-friendly and doesn't require any VS Code knowledge. The interface is intuitive, and the AI chat (Cmd+L) can answer questions about the editor itself. Think of it as having a coding mentor built into your text editor.
Does Cursor AI replace writing code manually?
No. Cursor assists you — it doesn't replace you. The best workflow combines your judgment with AI speed. You decide what to build, guide the AI with clear instructions, and review every suggestion before it ships. The result: you write less boilerplate and focus on the interesting problems.
How does Cursor handle my code privacy?
Cursor offers three privacy modes. "Local" keeps your code on your machine. "Private" sends code to AI providers but opts out of training. The default mode may use anonymized data for improvement. For proprietary work, switch to Local or Private mode in Settings > Privacy.
Conclusion
Cursor AI turns the intimidating process of writing code into a conversation. Install it, press Cmd+K, describe what you want, and review the result. That's the entire workflow.
The 30 minutes you spent on this tutorial gave you everything you need to start coding faster today. The real productivity gains come from daily use — the more you work with Cursor, the better its suggestions become.
Try Cursor free at cursor.com, and when you're ready to compare it against other tools, check out our best AI coding assistants guide.