Module 3

Getting Started with Cursor

Learning to use a smart text editor that helps you build websites faster and easier

3.1 Installing and Setting Up Cursor

Download and Installation

Cursor Installation Screen

What you'll see when installing Cursor on your computer

  1. Visit cursor.sh to download
  2. Available for Mac, Windows, and Linux computers
  3. Run the installer and click "Next" when prompted
  4. Open Cursor after installation completes
  5. Follow the simple setup guide that appears
What You Need: A computer with at least 8GB of memory, a modern processor, and a good internet connection.

Basic Settings

Simple changes to make Cursor work better for you:

Setting Suggestion Why
Theme Dark/Light based on what you like Easier on your eyes during long sessions
Text Size 14px or 16px Makes text easier to read
Text Style JetBrains Mono (comes built-in) Clear and easy to read
Word Wrap On Prevents text from going off the screen
Auto-Format Enabled Keeps your code neat automatically

To find these settings:
Cmd/Ctrl + , or click File > Preferences > Settings

Connecting to AI Helpers

How to set up the AI assistant that makes Cursor special:

  1. Create or log in to an OpenAI account
  2. Get an API key from OpenAI's website
  3. In Cursor, go to Settings > AI
  4. Paste your OpenAI API key
  5. Select GPT-4 as your AI helper

  1. Create or log in to an Anthropic account
  2. Get a Claude API key from their website
  3. In Cursor, go to Settings > AI
  4. Paste your Anthropic API key
  5. Select Claude as your AI helper

  1. Set up a local AI on your computer
  2. Configure the connection settings
  3. In Cursor, add your local connection
  4. Test it with a simple request
Requires a powerful computer

Project Setup

Setting up your website project in Cursor:

  • Open your website folder so Cursor can see all your files
  • Set up a .gitignore file to avoid sharing private information
  • Create a .cursorignore file to keep some files private from AI
  • Project-specific settings for consistent formatting
  • Add-ons that make website building easier
Simple .cursorignore Example: Create a file called ".cursorignore" in your project folder and add:

node_modules/
.env
private-notes.txt

Helpful Keyboard Shortcuts

Keyboard Shortcut Guide

Visual guide to essential Cursor keyboard commands

AI Shortcuts
  • Cmd/Ctrl + K - Ask AI to write something
  • Cmd/Ctrl + L - Ask AI to change something
  • Cmd/Ctrl + I - Chat with AI
  • Cmd/Ctrl + O - AI command menu
Basic Shortcuts
  • Cmd/Ctrl + P - Open a file quickly
  • Cmd/Ctrl + Shift + P - Open command menu
  • Cmd/Ctrl + \\ - Split the screen
  • Cmd/Ctrl + Tab - Switch between files

3.2 Basic Cursor Features

Using the Command Menu

Command Menu Illustration

Visual example of Cursor's command menu

The command menu is like a search box that lets you do anything in Cursor:

  • Open it with Cmd/Ctrl + Shift + P
  • Type what you want to do
  • Quickly find and use any feature
  • Access AI features directly
  • Find and use add-ons
Tip: Type > first to search just for commands.

Creating New Content with AI

Ask the AI to write website code for you:

Example: Creating a Contact Form

What you could ask: "Create a simple contact form with name, email, and message fields. Include a submit button and make it look nice."

What the AI will do: Write all the HTML and CSS for a complete, working contact form that you can add to your website.

1. Click where you want to add new content
2. Press Cmd/Ctrl + K
3. Type what you want in plain English
4. Review what the AI creates and make changes if needed

Changing Existing Content with AI

Ask the AI to improve or fix your existing website code:

Example: Improving a Button

Original: A basic button that says "Submit"

What you could ask: "Make this button more attractive with a color gradient, rounded corners, and a hover effect."

Result: A professionally styled button with all the requested features

1. Select the content you want to change
2. Press Cmd/Ctrl + L
3. Describe the changes you want in plain English
4. Review the AI's changes and approve them

Chatting with the AI Helper

Have a conversation with the AI about your website project:

  • Open the chat with Cmd/Ctrl + I or the chat icon
  • The AI remembers your previous questions
  • Ask for code examples and explanations
  • Ask about specific files in your project
  • Your chat history is saved for later
You
How do I make my website look good on both phones and computers?
AI

To make your website look good on all devices, you should:

  1. Use responsive design techniques
  2. Include a viewport meta tag
  3. Use flexible layouts with percentages
  4. Set up media queries for different screen sizes
  5. Test on multiple devices

Would you like me to explain any of these in more detail or show you an example?

Using the Built-in Terminal

Access command tools without leaving Cursor:

  • Open with Terminal > New Terminal or the backtick key (`)
  • Use multiple terminals with tabs
  • Run website tools like npm and git
  • Works with all your project files
  • Remembers your previous commands
Tip: Use the terminal to test your website locally before publishing it.

3.3 Smart Ways to Talk to the AI

Helping the AI Understand Your Whole Project

The AI can see and understand all your website files:

Project Understanding Visualization

Visual showing how the AI sees your whole project

Mention Specific Files

Good prompt: "Looking at my index.html and style.css files, create a matching about-us.html page with the same header and footer."

Why it works: Tells the AI exactly which files to look at for reference.

Ask About Your Website Structure

Good prompt: "Based on how my current pages are organized, suggest how I should structure a new blog section for my website."

Why it works: Asks the AI to analyze your existing pages before making suggestions.

Making Changes Throughout Your Website

Update designs across multiple pages at once:

Finding Patterns

Good prompt: "Find all the contact forms on my website and update them to match our new blue color scheme."

Step-by-Step Changes

Good prompt: "I need to replace all our old logo images with the new logo. Can you help me find all the places and create a plan to update them?"

Tip: Always review the AI's changes carefully before saving them, especially when making changes to multiple files.

Creating Website Components Quickly

Save time by asking for complete website pieces:

Complete Feature Requests

Good prompt: "Create a photo gallery section for my website that shows thumbnail images that enlarge when clicked. Make it match my website's existing style."

Result: A complete, ready-to-use photo gallery that matches your site's design.

Using Your Existing Style

Good prompt: "Create a newsletter signup form that matches the style of my other forms but adds a checkbox for topic preferences."

Building Special Website Features

Create more complex elements for your website:

Interactive Elements

Good prompt: "Create a simple countdown timer for my website that shows days, hours, and minutes until our event on December 15th. Make it match our website colors."

Matching Your Design

Good prompt: "Look at our website's navigation menu and create a similar-looking footer menu with links to About, Contact, and Privacy Policy pages."

Feature Breakdown

Visual showing how complex website features are built

Getting Help with Website Problems

Use Cursor's AI to fix issues:

Fixing Errors

Good prompt: "My image isn't showing up on my page. Here's my code - can you help me find what's wrong and fix it?"

Improving Slow Websites

Good prompt: "My website is loading slowly. Can you look at my home page and suggest ways to make it load faster?"

Adding Helpful Comments

Good prompt: "Add simple explanations as comments to my website code so I can understand what each section does."

3.4 Working Smarter with Cursor

Organizing Your Website Files

Smart Organization Diagram

Visual guide to organizing your website files

How to Organize Files So the AI Can Help You Better
  • Use clear file names that explain what each file does
  • Group related files together in folders
  • Keep related pages close to each other
  • Include a README file explaining your project
  • Add comments to explain complex parts of your code

Simple Website Structure Example:

  • my-website
    • README.md - Project info
    • index.html - Home page
    • about.html - About page
    • contact.html - Contact page
    • css
      • style.css - Main styles
    • images
      • logo.png
      • banner.jpg
    • js
      • main.js - Main JavaScript

Creating Reusable Templates

Save time by making templates for common website parts:

1
Create Template Files

Make template files for things you use often (headers, footers, etc.)

2
Save in a Templates Folder

Keep all your templates in one easy-to-find place

3
Mention in Your Requests

Tell the AI to copy your template styles when making new content

Good template request: "Create a new page called team.html that follows the same layout as my about.html template, but with sections for team member profiles."

Using Version Control

Track changes to your website with Git (built into Cursor):

Basic Git Features
  • Save file changes
  • Create save points
  • See change history
  • Fix conflicts
  • Compare versions
AI-Assisted Git
  • Auto-create change notes
  • Summarize your changes
  • Explain any conflicts
  • Review code changes
  • Draft change descriptions

Good Git prompt: "Write a simple description of the changes I made to add the contact form to my website."

Saving Code Snippets

Save and reuse your favorite pieces of code:

  • Save snippets of code you use frequently
  • Organize by type (buttons, forms, etc.)
  • Use keyboard shortcuts to add snippets quickly
  • Share snippets between projects
  • Ask the AI to create new snippets for you

Good snippet request: "Create a reusable button style that I can use throughout my website with our brand colors and rounded corners."

Tips for Faster Website Building

Speed Tips
  • Create project-specific settings
  • Exclude large files
  • Close unused tabs
  • Turn off unused features
  • Use split screen wisely
Get Better AI Responses
  • Be specific in requests
  • Provide clear context
  • Place cursor in the right spot
  • Break big tasks into steps
  • Use simpler AI for simple tasks
Working with AI Tips
  • Start with small AI tasks and build up to bigger ones
  • Learn keyboard shortcuts to work faster
  • Create templates for common website tasks
  • Save effective requests to use again
  • Combine AI help with your own knowledge

Module 3 Summary

What We've Learned

Getting Started with Cursor

Installation, configuration, and connecting to AI services to prepare your development environment.

Basic Features and Navigation

Essential keyboard shortcuts, file navigation, and workspace management to boost productivity.

AI-Powered Code Generation

Using Cursor's chat interface and inline code generation to create and modify code efficiently.

Advanced Cursor Techniques

Multi-file operations, refactoring, AI-assisted debugging, and optimizing your workflow.

Key Cursor Capabilities

  • AI Chat Interface: Conversational interaction with AI that understands your code context
  • Code Generation: Create new functions, components, and features with natural language prompts
  • Codebase Navigation: Find code and jump to related files using AI-powered search
  • Refactoring: Transform and improve code with AI suggestions and automated changes
  • Documentation: Generate comments, explanations, and documentation for your code

Next Steps

Now that you've mastered the Cursor IDE, it's time to dive into practical web development:

  • Practice using Cursor shortcuts to speed up your development workflow
  • Try generating different types of code components with AI assistance
  • Experiment with AI-powered refactoring on existing projects
  • Join Module 4 to learn about AI-powered HTML and Tailwind CSS development
Module 3 Navigation