Essential Cursor Keyboard Shortcuts
Cursor is a powerful AI-powered code editor that becomes even more efficient when you master its keyboard shortcuts. Here’s a comprehensive list of essential shortcuts to supercharge your development workflow:
File Navigation
Cmd/Ctrl + P: Quick file search and navigationCmd/Ctrl + Shift + P: Command paletteCmd/Ctrl + B: Toggle sidebarCmd/Ctrl + \: Split editorCmd/Ctrl + W: Close current fileCmd/Ctrl + Tab: Switch between open filesCmd/Ctrl + Shift + T: Reopen closed file
Code Navigation
Cmd/Ctrl + Click: Go to definitionCmd/Ctrl + Shift + F: Search across filesCmd/Ctrl + F: Search in current fileCmd/Ctrl + G: Go to lineCmd/Ctrl + Shift + O: Navigate to symbolsAlt + Left/Right: Navigate back/forwardCmd/Ctrl + Home/End: Go to start/end of file
Code Editing
Cmd/Ctrl + X: Cut lineCmd/Ctrl + C: Copy lineAlt + Up/Down: Move line up/downCmd/Ctrl + /: Toggle line commentCmd/Ctrl + ]: Indent lineCmd/Ctrl + [: Outdent lineCmd/Ctrl + Enter: Insert line belowCmd/Ctrl + Shift + Enter: Insert line aboveCmd/Ctrl + Shift + K: Delete line
Multi-Cursor and Selection
Cmd/Ctrl + D: Select next occurrenceCmd/Ctrl + Shift + L: Select all occurrencesAlt + Click: Add cursorCmd/Ctrl + U: Undo last cursor operationCmd/Ctrl + L: Select current lineCmd/Ctrl + Shift + Up/Down: Column selectionAlt + Shift + Drag: Column selection with mouse
AI Features
Cmd/Ctrl + K: Open AI chatCmd/Ctrl + Shift + I: AI inline chatCmd/Ctrl + Shift + L: AI explain codeCmd/Ctrl + Shift + R: AI refactor codeCmd/Ctrl + Shift + D: AI debug code
Code Folding
Cmd/Ctrl + Shift + [: Fold regionCmd/Ctrl + Shift + ]: Unfold regionCmd/Ctrl + K Cmd/Ctrl + 0: Fold allCmd/Ctrl + K Cmd/Ctrl + J: Unfold all
Terminal
Cmd/Ctrl +`: Toggle integrated terminalCmd/Ctrl + Shift +`: Create new terminalCmd/Ctrl + Alt + Up/Down: Switch between terminals
Git Integration
Cmd/Ctrl + Shift + G: Open source controlCmd/Ctrl + Enter: Stage changes (in diff view)Cmd/Ctrl + Shift + M: Show problems panel
Editor Management
Cmd/Ctrl + 1/2/3: Focus editor groupCmd/Ctrl + K Cmd/Ctrl + Left/Right: Move editor left/rightCmd/Ctrl + W: Close editorCmd/Ctrl + K F: Close folder
Pro Tips
- Chain commands together for complex operations
- Customize these shortcuts in Settings > Keyboard Shortcuts
- Use the Command Palette to discover more commands
- Remember that Mac uses Cmd while Windows/Linux uses Ctrl
Read more about Cursor’s features and shortcuts here