Using Cursor - the AI powered VS Code alt for the first time…
Science & Technology
Using Cursor - the AI Powered VS Code Alternative for the First Time
I thought it'd be kind of fun to try out a new IDE - a Next Generation code editor called Cursor. This IDE is powered by GPT-4 and GPT-3.5 and is essentially a fork of VS Code that's been modified to implement AI into everything you do.
Setup and First Impressions
After the installation, the first screen invited me to launch Cursor from the command line. I chose "cursor" (though “code” is also an option) to keep it distinct from my regular VS Code setup. Once launched, it quickly synchronized my VS Code settings, including my preferred theme. I even noticed that it had GitLens and Spotify integrations right from the get-go. A subsequent setup required me to log in and re-authenticate for some extensions like GitHub Copilot.
Integrating OpenAI and Embeddings
One of the core features is codebase understanding through OpenAI embeddings. This means Cursor processes your entire code repository, embedding it into numerical representations that the AI can use to answer queries like "Show me all the functions that do X" or "Find variables similar to Y". Naturally, this requires running AI services on the backend, thereby making a login mandatory.
Using AI Features within Cursor
After having logged in and completed the setup, including integrating my own OpenAI key, I could begin exploring Cursor. I imported my VS Code settings, and the editor already had my theme set up.
Hotkeys and Navigation
Cursor offers hotkeys like Command-L to open the chat panel and Command-K to prompt the AI with code-specific tasks. For example, I could ask it to "clean up this code". By choosing different models (GPT-3.5 or GPT-4), I found that GPT-4 performed superior in programming tasks.
Working with the Code
To dive deeper, I loaded an old, public repository and prompted and refactored code using the AI. The GPT-4 model was particularly impressive. When I asked it to clean up a function in a file, it identified redundant code, proposed optimizations, and even refactored the code, making the whole file more organized. The changes included removing unused imports, restructuring functions, and maintaining necessary analytics integrations.
AI Guidance and Inline Snippets
One notable functionality is using the AI to answer questions about the codebase. For instance, querying "where can I find my Google Analytics ID in this app" yielded instantaneous, accurate results complete with inline code snippets. This level of interaction dramatically streamlines understanding and navigating the code.
Final Thoughts
Cursor delivers an experience that feels very much like VS Code but with the added advantage of AI. The interface is intuitive, and UI modifications such as the top-placed sidebar are thoughtfully designed. My first impressions are highly positive, and I am excited to explore Cursor further. There’s potential for this tool to redefine coding workflows, potentially elevating developers to more strategic roles as product managers.
Keywords
- AI-powered IDE
- Cursor
- GPT-4
- VS Code alternative
- OpenAI embeddings
- GitHub Copilot
- Codebase understanding
- Refactoring code
- AI in development
- Code editor
- Product management
FAQs
Q1: What is Cursor?
A1: Cursor is an AI-powered, next-generation code editor, a fork of VS Code, designed to integrate AI into the coding workflow using models like GPT-4 and GPT-3.5.
Q2: How does Cursor use AI?
A2: Cursor employs AI for codebase understanding by embedding the entire code repository into numerical representations. This allows the AI to assist with tasks like refactoring code, finding functions, and answering code-specific queries.
Q3: Is Cursor different from VS Code?
A3: While Cursor feels very similar to VS Code in terms of the interface and usability, it offers added AI-powered features that provide enhanced code understanding and productivity.
Q4: What kind of AI models does Cursor support?
A4: Cursor supports AI models like GPT-4 and GPT-3.5 for various AI-driven functionalities within the code editor.
Q5: Do I need an OpenAI key to use Cursor?
A5: Yes, you need to set up an OpenAI key and log in to access the AI features within Cursor.
Q6: Can Cursor refactor code for me?
A6: Yes, Cursor can refactor code by understanding the codebase and suggesting or implementing optimizations and restructures aimed at cleaner, more efficient code.
Q7: How does the AI answer code-specific questions?
A7: You can use hotkeys to ask the AI questions about your code, such as locating certain variables or functions, and it will provide answers often with inline code snippets.