What is Cursor?
Cursor (also known as Cursor.sh) is an innovative AI-first code editor that’s revolutionizing software development. Imagine if VSCode and ChatGPT had a brilliant offspring — it would be Cursor. This cutting-edge tool is designed to learn a developer’s coding style and preferences, providing personalized suggestions and completions in real-time.
With its seamless integration into popular coding platforms, Cursor becomes an extension of your coding workflow, streamlining your development process and freeing you to focus on the creative aspects of coding.
By harnessing the power of AI, Cursor transforms the coding experience, making it faster, smarter, and more enjoyable.
Table of Contents
Core Features
- Command K: Edit and write code with AI assistance.
- Copilot++: Native autocomplete feature with mid-line completions and entire diffs.
- Chat: Talk to an AI that sees your codebase and ask questions.
- @ Symbols: Easily show code to the AI and generate code with dependencies.
- Codebase Answers: Ask the AI about your entire codebase.
- Docs: Improve the AI’s understanding of third-party libraries.
- Auto-Debug: Fix errors in the terminal with AI assistance.
- Fix Lints: Quickly fix lint errors with AI suggestions.
- Terminal Command K: Write terminal commands in plain English.
- Notes: Get quick summaries of unfamiliar variables and types.
- Vision: Use images to prompt the AI (GPT-4 only).
- Apply From Chat: Quickly apply code suggestions from chat to your editor.
- Rules for AI: Specify style guidelines for the AI.
Pros & Cons
Pros | Cons |
---|---|
Efficient Code Exploration: Cursor, built on OpenAI GPT models, understands your codebase and offers real-time suggestions, enhancing productivity. | Initial Developmental Phase: Cursor is still evolving, so some features may be under development. |
Interactive AI Assistance: Chat with your projects, tailoring answers to your specific repositories. This simplifies finding code solutions. | Potential for Inaccuracy: While it excels in many cases, occasional inaccuracies may occur due to its AI nature. |
Beginner-Friendly UI: Cursor provides an intuitive interface, accessible even to developers new to AI-powered tools. | |
Secured Local Mode: For security-critical work, Cursor offers a local mode option, ensuring your code remains on your machine. | |
Innovation-Driven Coding: Generate code from scratch based on simple instructions, as if you have an AI co-developer at your fingertips. |
Pricing
- Basic Plan (Free):
- 50 slow GPT-4 uses
- 200 GPT-3.5 uses per month
- 2000 Copilot++ completions
- Private Data Controls
- Pro Plan ($20/month):
- Includes everything in the Basic plan, plus:
- 500 fast GPT-4 uses per month
- Unlimited slow GPT-4 uses
- Unlimited GPT-3.5 uses
- Unlimited Copilot++ completions
- 10 Claude Opus uses per day
- Business Plan ($40/user/month):
- Includes everything in the Pro plan, and additional features:
- Admin usage dashboard
- Centralized billing
- Enforce privacy mode
- OpenAI zero-data retention
More Options:
- API Key: If you prefer not to upgrade, you can enter your OpenAI/Anthropic key to use Cursor’s non-custom-model features at cost.
- Self Hosting (Future): In the future, Cursor.sh may offer the ability to run its server on your own machine.
How to Use Cursor
Installation
- Go to https://cursor.sh/ in your web browser.
- Click on the “Download for Windows” button if you are using Windows, or click “Other” if you are on Linux or macOS.
- Follow the platform-specific instructions to download and install Cursor.
- Once installed, open the Cursor application.
Setup and Configuration
Import from Visual Studio Code
When you first launch Cursor, you’ll be prompted to import your settings from Visual Studio Code if you’d like:
- Click the “Import from VSCode” button.
- Browse and select your VSCode user data directory location when prompted.
- Click “Import” to bring over all your VSCode extensions, settings, keybindings and more into Cursor.
Keybindings
Note that Cursor uses some different default keybindings compared to VSCode. For example, the keychord leader is Ctrl+M on Windows/Linux and Command+R on Mac instead of Ctrl+K. You can change this and other keybindings under Preferences -> Keyboard Shortcuts.
Using the AI Chat
The AI Chat in Cursor allows you to communicate naturally with an AI assistant that has access to your codebase context.
- Open or create the file/project you want the AI to see and understand.
- Click on the Chat icon in the left sidebar to open the Chat pane.
- Select the AI model you want to use from the dropdown (e.g. GPT-4, GPT-3.5).
- Type your question or instruction for the AI into the chat input box.
- Use “@” symbol references to provide additional context:
- @filename – Reference a file for the AI to see
- @functionname – Send a code snippet
- @docs – Reference documentation for the AI
- @linterrors – Show lint errors
- @git – Git diffs
- @codebase – Relevant code from your repo (requires indexing)
- Hit Enter to send your message to the AI.
- The AI will process your request and provide a detailed response in the chat.
You can use /edit slash commands in the chat to instruct the AI to directly edit files for you.
Chat Settings
- Choose your AI model from the dropdown
- Add “Rules for AI” for additional context the AI should always be aware of
- Enable codebase indexing for better context from your repo
- Add custom documentation sources
Inline Code Editing
Cursor allows you to make edits and additions to your code via AI assistance inline without leaving your editor.
Inline Editing Existing Code
- Highlight the section of code you want the AI to edit or modify.
- Click the “Edit” button or use the keyboard shortcut for your platform.
- In the prompt box, describe how you want the highlighted code to be changed.
- The AI will process your instruction and make the edits, showing them as an inline code diff.
- Review the AI’s code changes. You can then accept, reject, or provide additional follow-up instructions.
Generating New Code
- Place your cursor at the location where you want new code to be generated.
- Use the “Generate” keyboard shortcut.
- In the prompt box, describe what new code you want the AI to write for you.
- The AI will generate the new code inline at your cursor position.
- Review the generated code and accept, reject, or iterate with follow-up instructions.
The inline editing/generation prompts support the same “@” symbol references as the chat for better context.
Other Key Features
Codebase Indexing
To provide the AI with better context and understanding of your entire codebase, you can compute embeddings by indexing your code:
- Open the Cursor sidebar pane and go to the More tab.
- Click “Compute Index” under the Codebase Indexing section.
- This will analyze your codebase and allow the AI to reference relevant code snippets when using @codebase.
Custom Documentation
You can add your own documentation sources for the AI to reference:
- In chat, use the @docs reference and click “Add new doc”.
- Provide the entry point URL for your documentation.
- Optionally configure the prefix and filters.
- Let Cursor index and ingest your documentation.
Rules for AI
Provide permanent rules and context that the AI should always be aware of:
- In the Cursor sidebar, go to the More tab.
- Type your rules into the “Rules for AI” box.
Auto Terminal Debug
Get AI assistance when you encounter errors in the integrated terminal:
- Stop the terminal process with the error.
- Hover over the error and click the “Auto debug” button.
- A new chat will open where the AI will analyze the issue and provide suggestions.
Copilot++
Enable the enhanced Copilot++ AI code suggestion model:
- In the Cursor sidebar, go to the More tab.
- Toggle “Enable Copilot++” to activate inline code completions.
API Keys
Connect your OpenAI or Azure API keys for additional capabilities:
- Open User Preferences > Settings.
- Go to the OpenAI API or Azure API section.
- Enter your API key and additional configs.
- This enables custom model usage, privacy mode, etc.
Additional Settings
Various other settings can be configured from User Preferences, such as:
- Privacy mode
- Tooltip visibility
- Advanced options
Tips for Using Cursor
Ready to dive into Cursor.sh and revolutionize your coding workflow? Here’s a curated collection of tips and insights from experienced users to help you navigate the platform’s capabilities effectively and optimize your development process.
- Embrace New Tools: Don’t hesitate to try out new IDEs and code editors like Cursor to enhance your workflow.
- Understand the Technology: Take the time to understand the underlying technology, such as the integration of GPT-4 and GPT-3.5 in Cursor, to leverage its capabilities effectively.
- Smooth Transition: If transitioning from another editor like VS Code to Cursor, consider importing settings and extensions to maintain familiarity and minimize disruptions.
- Utilize Hotkeys: Learn and utilize hotkeys or keyboard shortcuts provided by Cursor to streamline interactions with the editor and enhance productivity.
- Leverage AI Features: Take advantage of Cursor’s AI features, such as code understanding and rewriting capabilities powered by OpenAI embeddings, to understand and modify code more efficiently.
- Provide Feedback: If encountering issues or having suggestions for improvement while using Cursor, provide feedback to the developers to contribute to the refinement and enhancement of the tool.
- Experiment and Learn: Experiment with different prompts and queries to understand Cursor’s capabilities better and learn how to use it effectively.
- Stay Informed: Keep yourself informed about advancements in coding tools and technologies, including AI-powered editors like Cursor, to stay ahead of the curve and adapt to changes in the development landscape.
When to Use Different Features
Chat
- Use the chat for in-depth discussions and planning before implementation. The chat excels at exploring ideas, analyzing code, and providing detailed explanations.
- Leverage the chat’s conversation history and context tracking capabilities.
Inline Code Edit & Generation
- Use inline code edits and generation for straightforward coding tasks that the AI can likely handle accurately on the first try.
- Inline actions are optimized for quickly implementing code changes without context switching.
Providing Context
- Provide the AI with the necessary context, but avoid overwhelming it with too much irrelevant information.
- If your question relates to just one or a few files, reference those specific files using the “@filename” syntax instead of the entire codebase with “@codebase”.
Crafting Prompts
- Put care into formulating clear and accurate prompts/questions for the AI. Well-crafted prompts lead to much better outputs.
- Don’t get lazy by being overly terse or vague. Provide sufficient context and specifics.
Trusting the AI
- Get accustomed to simply asking the AI for assistance on coding problems you’re stuck on. The AI can often provide insightful solutions you may not have considered.
- However, don’t blindly trust every AI output, especially for critical decisions. Verify crucial information yourself when needed.
Copilot++
- Enable the enhanced Copilot++ model for powerful inline code completion suggestions based on your recent coding context.
Codebase Indexing
- Compute an index over your codebase to vastly improve the AI’s understanding and ability to reference relevant code snippets when using “@codebase”.
Custom Documentation
- Add your own proprietary documentation sources for the AI to reference using the @docs functionality.
Shortcut Keys
- Learn and make use of Cursor’s extensive shortcut keys for quickly triggering AI actions and inputs.
Feedback & Reporting
- Provide feedback to the Cursor team on what worked well, what didn’t, and any issues you encountered.
- Check the Common Issues section for resolutions to known problems.
Conclusion
Cursor is undoubtedly a game-changer in the world of software development, bridging the gap between human ingenuity and artificial intelligence. By harnessing the power of advanced language models like GPT-4 and GPT-3.5, Cursor empowers developers with an unprecedented level of assistance, streamlining the coding process and fostering a more efficient and enjoyable workflow.
The seamless integration of AI into the development environment not only enhances productivity but also encourages innovation and creativity. With Cursor’s ability to learn and adapt to individual coding styles, developers can focus on the conceptual and problem-solving aspects of their projects, leaving the tedious and repetitive tasks to their AI co-pilot.
However, it’s crucial to approach Cursor and other AI-powered tools with a balanced mindset. While these technologies can significantly augment human capabilities, they should be viewed as aids rather than replacements for human expertise.
Developers must exercise critical thinking and maintain a healthy degree of skepticism, verifying crucial information and not blindly relying on AI outputs, especially in critical decision-making processes.
Cursor is a significant step forward in the pursuit of enhancing developer productivity and unlocking new realms of innovation.