File Management & Navigation
Master efficient file management, advanced search, and AI-powered navigation in Cursor.
File Management Overview
Cursor's file management combines traditional VS Code features with AI-powered navigation and search capabilities.
File Explorer
- • Hierarchical file structure
- • Drag and drop support
- • Right-click context menus
- • File type icons
AI-Powered Search
- • Semantic code search
- • Natural language queries
- • Context-aware results
- • Cross-file references
Smart Navigation
- • Go to definition
- • Find references
- • Symbol navigation
- • AI-suggested files
File Explorer
The File Explorer (left sidebar) is your primary interface for navigating and managing project files.
Basic Navigation
Opening Files
- • Click to open files
- • Double-click to open in new tab
- • Right-click for context menu
- • Drag files to editor area
Folder Operations
- • Click arrow to expand/collapse
- • Right-click to create files/folders
- • Drag to move files
- • Rename with F2
File Operations
Creating Files
Right-click in Explorer → New File
# Or use Command Palette (Cmd+Shift+P)
# Type: "File: New File"
# Or use keyboard shortcut: Cmd+NCreating Folders
Right-click in Explorer → New Folder
# Or use Command Palette
# Type: "File: New Folder"
# Or use keyboard shortcut: Cmd+Shift+NRenaming Files
Select file and press F2, or right-click → Rename
# Rename with AI assistance
# Right-click → "Rename with AI"
# AI will suggest better names based on contentFile Icons and Types
Common File Types
- • .tsx - React TypeScript components
- • .ts - TypeScript files
- • .js - JavaScript files
- • .css - Stylesheets
- • .json - Configuration files
- • .md - Markdown documentation
Special Files
- • package.json - Dependencies
- • tsconfig.json - TypeScript config
- • .env - Environment variables
- • README.md - Project documentation
- • .gitignore - Git ignore rules
Advanced Search
Cursor's search capabilities go beyond simple text matching with AI-powered semantic search.
Basic Search (Cmd+Shift+F)
Text Search
Search for: "useState"
Results: All files containing "useState"Regex Search
Search for: "use[A-Z][a-z]+"
Results: All custom hooks (useAuth, useLocalStorage, etc.)File Type Filtering
Search for: "useState"
Files to include: *.tsx
Results: Only in TypeScript React filesAI-Powered Search
Semantic Search
Search for: "authentication logic"
Results: Files containing login, auth, token, session, etc.Function Search
Search for: "functions that handle user input"
Results: Event handlers, form validators, input processorsPattern Search
Search for: "error handling patterns"
Results: Try-catch blocks, error boundaries, error statesSearch in AI Chat
Natural Language Queries
"Find all components that use the useAuth hook"Code Analysis
"Show me all API calls in the project and their error handling"Dependency Analysis
"What files import the Button component and how is it used?"Quick Navigation
Navigate your codebase efficiently with keyboard shortcuts and AI-powered suggestions.
Essential Keyboard Shortcuts
File Navigation
Tab Navigation
AI-Powered Navigation
Smart File Suggestions
When you open Quick Open (Cmd+P), Cursor suggests relevant files based on:
- • Recently opened files
- • Files related to current context
- • Files you're likely to need next
- • Files with similar names or content
Context-Aware Suggestions
AI analyzes your current work and suggests:
- • Related components to edit
- • Configuration files to update
- • Test files to create
- • Documentation to update
Breadcrumb Navigation
File Path Breadcrumbs
Navigate through your file structure using breadcrumbs:
src > components > ui > Button.tsx
Click any part to navigate to that folderSymbol Breadcrumbs
Navigate through code structure:
App > UserProfile > handleSubmit > validateForm
Click to jump to any level of the call stackFile Organization
Organize your project files for better maintainability and AI understanding.
Recommended Project Structure
React/Next.js Project
src/
├── components/ # Reusable UI components
│ ├── ui/ # Basic UI components
│ ├── forms/ # Form components
│ └── layout/ # Layout components
├── pages/ # Page components (Next.js)
├── hooks/ # Custom React hooks
├── utils/ # Utility functions
├── types/ # TypeScript type definitions
├── services/ # API services
├── contexts/ # React contexts
├── styles/ # Global styles
└── __tests__/ # Test filesFile Naming Conventions
- • PascalCase for components: UserProfile.tsx
- • camelCase for utilities: formatDate.ts
- • kebab-case for pages: user-profile.tsx
- • UPPERCASE for constants: API_ENDPOINTS.ts
AI-Friendly Organization
Clear File Names
Use descriptive names that AI can understand:
✓ Good:
- • UserProfileCard.tsx
- • validateEmail.ts
- • useLocalStorage.ts
✗ Avoid:
- • Card.tsx
- • utils.ts
- • hook.ts
Logical Grouping
Group related files together for better AI context:
components/
├── auth/
│ ├── LoginForm.tsx
│ ├── RegisterForm.tsx
│ └── AuthProvider.tsx
├── dashboard/
│ ├── DashboardLayout.tsx
│ ├── StatsCard.tsx
│ └── RecentActivity.tsxFile Templates
Creating Templates
Use AI to create consistent file templates:
Create a React component template that includes:
- TypeScript interface for props
- Default export
- JSDoc comments
- Basic structureTemplate Examples
React Component:
interface ComponentNameProps {
// Define props here
}
/**
* Component description
*/
export const ComponentName: React.FC<ComponentNameProps> = ({
// Destructure props
}) => {
return (
<div>
{/* Component content */}
</div>
);
};Custom Hook:
import { useState, useEffect } from 'react';
/**
* Hook description
*/
export const useHookName = (param: string) => {
const [state, setState] = useState<string>('');
useEffect(() => {
// Effect logic
}, [param]);
return { state, setState };
};Next Steps
Now that you understand file management, learn about code generation and advanced features: