Ravindra BagaleCourses & study guides Track your progress
AI CODING ASSISTANTS · CHAPTER 2 · SETUP

How to Set Up Cursor, the AI Code Editor (Step by Step)

Cursor is a code editor built on VS Code with AI built in. It has Tab suggestions, inline edit, and an Agent that can read your project, edit files and run commands.

In short: download Cursor, sign in, import your VS Code settings, then use Tab, Ctrl+K (inline edit) and Ctrl+I (Agent). Put project rules in AGENTS.md.

Why use Cursor

WHY

You do not install an AI plugin. The AI is part of the editor. It feels like VS Code, so your shortcuts and most extensions keep working. You can also pick from several AI models in one place.

What you get

WHAT
  • Tab: grey suggestions as you type. Tab accepts.
  • Inline edit: select code, press Ctrl+K (Mac: Cmd+K), type what to change.
  • Agent: side panel (Ctrl+I). It searches your code, edits files and runs terminal commands.
  • Plan Mode: Shift+Tab in the Agent box. It researches, asks questions and writes a plan before coding.
  • Model picker: switch AI models in the Agent box (Ctrl+/ loops through them).
  • Rules: AGENTS.md or .cursor/rules/*.mdc files with your project rules.

How setup flows

1 · Download cursor.com 2 · Sign in create or use your account 3 · Import VS Code Ctrl+Shift+J → General → Account 4 · Add rules AGENTS.md in the project 5 · First task Agent, then review the diff

Install steps

HOW
  1. Go to cursor.com and download the installer for your system (Windows 10+, macOS 12+, or Linux).
  2. Windows: run the .exe. Mac: open the .dmg and drag Cursor to Applications.
  3. Ubuntu/Debian: Cursor has an apt package (preferred over the AppImage, because it updates itself). Copy the exact commands from the Cursor download page.
  4. Open Cursor and sign in.
  5. Import VS Code: press Ctrl+Shift+J (Mac Cmd+Shift+J) → General → Account → under VS Code Import click Import. This brings extensions, themes, settings and keybindings.
  6. Open your project: File → Open Folder.

Settings

  1. Cursor Settings (Ctrl+Shift+J): models, rules, Tab and privacy options live here.
  2. Privacy: check the privacy / data-sharing option in Cursor Settings before working on company code. Follow your company policy.
  3. Extensions: Cursor uses the Open VSX registry, not the VS Code Marketplace. Most popular extensions are there; a few Microsoft-only ones may be missing.
  4. Shortcuts: same defaults as VS Code, plus AI keys. Change them in the keyboard shortcuts editor.

Configuration: project rules

  1. AGENTS.md in the project root: simple rules in plain Markdown. Works with other coding agents too.
  2. .cursor/rules/: one .mdc file per rule, with a small header that says when it applies (always, or only for some files). Plain .md files in that folder are ignored.
  3. Keep rules short. They are sent with requests.
AGENTS.md
# Project rules
- Node 20, TypeScript strict
- Tests: npm test must pass before you finish
- Never edit .env or deploy scripts
- Ask before adding a new npm package

First task (5 minutes)

  1. Press Ctrl+I to open Agent. Ask: “Explain this codebase. Point me to the main entry points.”
  2. Ask for one small change: “Add input checks to the function in @utils.ts and add a test.” (Type @ to point at a file.)
  3. Watch the diff. Reject anything you do not want.
  4. Ask it to run your tests. Check the result yourself.
  5. For a bigger job, press Shift+Tab for Plan Mode first and approve the plan.
ActionWindows/LinuxMac
Agent panelCtrl+ICmd+I
Inline editCtrl+KCmd+K
Switch agent modeShift+TabShift+Tab
Next AI modelCtrl+/Cmd+/
Accept Tab suggestionTabTab
Rule: the Agent can run terminal commands. Read each command before you allow it, especially delete, install or deploy.

Quick quiz

1. Which shortcut opens the Cursor Agent?

Ctrl+I (Mac: Cmd+I).

2. How do you import VS Code settings?

Ctrl+Shift+J → General → Account → VS Code Import → Import.

3. Which extension registry does Cursor use?

Open VSX.

4. Where do simple project rules go?

AGENTS.md in the project root (or .mdc files in .cursor/rules/).

Save tokens and money

SMART AI USE

Use Tab and inline edit (Ctrl+K) for small changes; they are cheaper than Agent. Point Agent at files with @ instead of letting it search everything. Start a new chat for each new task.

Save these cards

INTERVIEW CARDAI Coding

What is Cursor?

A VS Code-based editor with AI built in.
Tab suggestions, inline edit, Agent, Plan Mode, model picker.
Ravindra Bagale · ravindrabagale.com/ai-coding
COMPARISON CARDAI Coding

Cursor vs VS Code + Copilot

Cursor: AI is the editor; Open VSX extensions.
VS Code + Copilot: AI is an extension; full Microsoft Marketplace.
Ravindra Bagale · ravindrabagale.com/ai-coding
REVISION CARDAI Coding

Cursor keys

Tab = accept. Ctrl+K = inline edit.
Ctrl+I = Agent. Shift+Tab = Plan.
Rules in AGENTS.md.
Ravindra Bagale · ravindrabagale.com/ai-coding