Essential Keyboard Shortcuts in Cursor Editor

2024-03-20By Cursor Team

Introduction

Mastering keyboard shortcuts is essential for maximizing your productivity in Cursor Editor. This guide covers the most important shortcuts you need to know, organized by category.

Note: On macOS, replace Ctrl with Cmd for most shortcuts.

AI Feature Shortcuts

Cursor's AI features are at your fingertips with these shortcuts:

Chat Interface

  • Ctrl+K - Open chat window
  • Ctrl+L - Focus chat input
  • Esc - Close chat window

Code Operations

  • Ctrl+Shift+I - Explain code
  • Alt+/ - AI code completion
  • Ctrl+Shift+R - Refactor code

Editing Shortcuts

Essential shortcuts for code editing:

Basic Editing

  • Ctrl+X - Cut line
  • Ctrl+C - Copy line
  • Ctrl+V - Paste
  • Ctrl+/ - Toggle comment

Advanced Editing

  • Alt+↑/↓ - Move line up/down
  • Ctrl+Shift+K - Delete line
  • Ctrl+Enter - Insert line below
  • Ctrl+Shift+Enter - Insert line above

Selection Shortcuts

Efficiently select and manipulate code:

Basic Selection

  • Ctrl+L - Select current line
  • Ctrl+D - Select next occurrence
  • Ctrl+U - Undo last selection

Advanced Selection

  • Alt+Click - Add cursor
  • Ctrl+Alt+↑/↓ - Add cursor above/below
  • Ctrl+Shift+L - Select all occurrences

Terminal Shortcuts

Control the integrated terminal:

Terminal Control

  • Ctrl+` - Toggle terminal
  • Ctrl+Shift+` - New terminal
  • Ctrl+Shift+5 - Split terminal

Terminal Navigation

  • Alt+←/→ - Switch terminal tabs
  • Ctrl+PageUp/Down - Scroll terminal
  • Ctrl+Home/End - Scroll to top/bottom

Customizing Shortcuts

Make Cursor work your way:

  1. Open Command Palette (Ctrl+Shift+P)
  2. Type "Keyboard Shortcuts"
  3. Find the command you want to customize
  4. Click the edit icon
  5. Press your desired key combination

Tip: You can also edit the keybindings.json file directly for more advanced customization.