Cursore¶
Traduzione: Copia tutti i comandi
Traduzione: Generare PDF
< >
Cursor è un editor di codice basato su AI costruito su VS Code che integra funzionalità avanzate di AI per la generazione di codice, la modifica e il debug con il supporto per più modelli AI tra cui GPT-4 e Claude.
## Installazione e configurazione
|Command|Description|
|---------|-------------|
|Download from cursor.sh|Install Cursor from official website|
|`cursor --version`|Check installed version|
|`cursor .`|Open current directory in Cursor|
|`cursor file.py`|Open specific file|
|`cursor --help`|Display help information|
|`cursor --extensions-dir`|Show extensions directory|
## Caratteristiche di base
|Shortcut|Description|
|---------|-------------|
|`Ctrl+K` / `Cmd+K`|Open AI command palette|
|`Ctrl+L` / `Cmd+L`|Open AI chat panel|
|`Ctrl+I` / `Cmd+I`|Inline AI editing|
|`Tab`|Accept AI suggestion|
|`Escape`|Reject AI suggestion|
|`Alt+]` / `Option+]`|Next AI suggestion|
|`Alt+[` / `Option+[`|Previous AI suggestion|
## Comandi di chat AI
|Command|Description|
|---------|-------------|
|`@workspace`|Reference entire workspace|
|`@file`|Reference specific file|
|`@folder`|Reference folder contents|
|`@code`|Reference selected code|
|`@docs`|Reference documentation|
|`@web`|Search web for context|
|`@git`|Reference git history|
## Generazione di codice
### Generazione in linea
|Shortcut|Description|
|---------|-------------|
|`Ctrl+K` then type prompt|Generate code inline|
|`Ctrl+K` then `Ctrl+A`|Generate entire file|
|`Ctrl+K` then `Ctrl+D`|Generate documentation|
|`Ctrl+K` then `Ctrl+T`|Generate tests|
|`Ctrl+K` then `Ctrl+R`|Refactor code|
|`Ctrl+K` then `Ctrl+F`|Fix code issues|
### Generazione basata su Chat
|Command|Description|
|---------|-------------|
|"Create a function that..."|Generate specific function|
|"Add error handling to this code"|Improve existing code|
|"Convert this to TypeScript"|Language conversion|
|"Optimize this algorithm"|Performance optimization|
|"Add comments to explain this"|Documentation generation|
## Modifica del codice
### Modifica basata su selezione
|Shortcut|Description|
|---------|-------------|
|Select code + `Ctrl+K`|Edit selected code|
|Select code + `Ctrl+I`|Inline edit selection|
|`Ctrl+Shift+K`|Edit with context|
|`Alt+K`|Quick edit|
### Modifica multi-cursor
|Shortcut|Description|
|---------|-------------|
|`Ctrl+Alt+Down` / `Cmd+Option+Down`|Add cursor below|
|`Ctrl+Alt+Up` / `Cmd+Option+Up`|Add cursor above|
|`Ctrl+D` / `Cmd+D`|Select next occurrence|
|`Ctrl+Shift+L` / `Cmd+Shift+L`|Select all occurrences|
## Configurazione dei modelli AI
|Setting|Description|
|---------|-------------|
|GPT-4|Default model for complex tasks|
|GPT-3.5-turbo|Faster model for simple tasks|
|Claude-3|Alternative model for coding|
|Codex|Specialized for code generation|
|Custom models|Configure local or custom models|
## Caratteristiche dello spazio di lavoro
### Gestione dei file
|Shortcut|Description|
|---------|-------------|
|`Ctrl+P` / `Cmd+P`|Quick file open|
|`Ctrl+Shift+P` / `Cmd+Shift+P`|Command palette|
|`Ctrl+Shift+E` / `Cmd+Shift+E`|Explorer panel|
|`Ctrl+Shift+F` / `Cmd+Shift+F`|Search across files|
|`Ctrl+Shift+G` / `Cmd+Shift+G`|Source control|
### Ricerca avanzata
|Command|Description|
|---------|-------------|
|`@search "semantic query"`|Semantic code search|
|`@find "natural language"`|Natural language file finding|
|`@grep "pattern with AI"`|AI-enhanced grep|
## Debug con AI
|Feature|Description|
|---------|-------------|
|AI Debug Assistant|Explain debugging output|
|Error Explanation|AI explains error messages|
|Fix Suggestions|AI suggests fixes for bugs|
|Breakpoint Analysis|AI analyzes breakpoint context|
### Comandi del debito
|Shortcut|Description|
|---------|-------------|
|`F5`|Start debugging|
|`F9`|Toggle breakpoint|
|`F10`|Step over|
|`F11`|Step into|
|`Shift+F11`|Step out|
|`Ctrl+Shift+F5`|Restart debugging|
## Integrazione Git
|Command|Description|
|---------|-------------|
|`@git diff`|AI explains git differences|
|`@git commit`|Generate commit messages|
|`@git branch`|Suggest branch names|
|`@git merge`|Help with merge conflicts|
### Git Scorciatoie
|Shortcut|Description|
|---------|-------------|
|`Ctrl+Shift+G` / `Cmd+Shift+G`|Source control panel|
|`Ctrl+Enter` / `Cmd+Enter`|Commit changes|
|`Ctrl+Shift+P` then "Git"`|Git commands|
## Estensioni e personalizzazione
### Estensioni popolari
|Extension|Description|
|---------|-------------|
|Cursor AI|Core AI functionality|
|GitHub Copilot|Additional AI assistance|
|Prettier|Code formatting|
|ESLint|JavaScript linting|
|Python|Python language support|
|Live Share|Real-time collaboration|
### Configurazione delle impostazioni
|Setting|Description|
|---------|-------------|
|`cursor.ai.model`|Default AI model|
|`cursor.ai.temperature`|AI creativity level|
|`cursor.ai.maxTokens`|Maximum response length|
|`cursor.ai.autoComplete`|Enable auto-completion|
|`cursor.ai.inlineChat`|Enable inline chat|
## Caratteristiche avanzate
### Modalità Composer
|Feature|Description|
|---------|-------------|
|Multi-file editing|Edit multiple files simultaneously|
|Project-wide changes|Apply changes across entire project|
|Dependency tracking|Track file dependencies|
|Batch operations|Perform bulk operations|
### Agenti dell'AI
|Agent|Description|
|---------|-------------|
|Code Agent|Specialized for code tasks|
|Debug Agent|Focused on debugging|
|Test Agent|Generates and runs tests|
|Docs Agent|Creates documentation|
|Refactor Agent|Code refactoring specialist|
## Caratteristiche linguistiche
### Python
|Command|Description|
|---------|-------------|
|`@python "create class"`|Generate Python classes|
|`@python "add type hints"`|Add type annotations|
|`@python "create tests"`|Generate pytest tests|
|`@python "optimize"`|Performance optimization|
### JavaScript/TypeScript
|Command|Description|
|---------|-------------|
|`@js "create component"`|Generate React components|
|`@ts "add types"`|Add TypeScript types|
|`@js "async/await"`|Convert to async/await|
|`@js "error handling"`|Add error handling|
### Altre lingue
|Command|Description|
|---------|-------------|
|`@rust "safe code"`|Generate safe Rust code|
|`@go "concurrent"`|Go concurrency patterns|
|`@java "spring boot"`|Spring Boot applications|
|`@cpp "modern cpp"`|Modern C++ features|
## Consigli sulla produttività
### Modelli di codice
|Template|Description|
|---------|-------------|
|`@template api`|REST API template|
|`@template component`|UI component template|
|`@template test`|Test file template|
|`@template config`|Configuration template|
### Automazione del flusso di lavoro
|Feature|Description|
|---------|-------------|
|Auto-save|Automatic file saving|
|Format on save|Auto-format code|
|Lint on save|Auto-lint code|
|AI suggestions|Proactive suggestions|
## Caratteristiche della collaborazione
|Feature|Description|
|---------|-------------|
|Live Share|Real-time collaboration|
|AI Pair Programming|AI as coding partner|
|Code Reviews|AI-assisted reviews|
|Team Settings|Shared AI configurations|
### Comandi di condivisione
|Shortcut|Description|
|---------|-------------|
|`Ctrl+Shift+P` then "Live Share"`|Start collaboration session|
|`Ctrl+Shift+P` then "Share"`|Share workspace|
## Ottimizzazione delle prestazioni
|Setting|Description|
|---------|-------------|
|`cursor.ai.cacheSize`|AI response cache size|
|`cursor.ai.requestTimeout`|Request timeout|
|`cursor.ai.batchSize`|Batch request size|
|`cursor.ai.throttle`|Request throttling|
## Risoluzione dei problemi
|Issue|Solution|
|---------|-------------|
|AI not responding|Check internet connection|
|Slow responses|Reduce context size|
|Wrong suggestions|Provide more context|
|Model errors|Switch AI model|
|Extension conflicts|Disable conflicting extensions|
### Comandi del debito
|Command|Description|
|---------|-------------|
|`Ctrl+Shift+P` then "Developer: Reload Window"`|Reload Cursor|
|`Ctrl+Shift+P` then "Developer: Toggle Developer Tools"`|Open dev tools|
|`Help > Show All Commands`|Show all available commands|
## Integrazione API
### Modelli personalizzati
Traduzione:
### Configurazione Webhook
Traduzione:
## Tastiera Scorciatoie Sintesi
### Scorciatoie essenziali
|Shortcut|Action|
|---------|-------------|
|`Ctrl+K`|AI command|
|`Ctrl+L`|AI chat|
|`Ctrl+I`|Inline edit|
|`Tab`|Accept suggestion|
|`Escape`|Reject suggestion|
|`Ctrl+/`|Toggle comment|
|`Ctrl+S`|Save file|
|`Ctrl+Z`|Undo|
|`Ctrl+Y`|Redo|
### Navigazione
|Shortcut|Action|
|---------|-------------|
|`Ctrl+P`|Quick open|
|`Ctrl+G`|Go to line|
|`Ctrl+F`|Find|
|`Ctrl+H`|Replace|
|`F12`|Go to definition|
|`Alt+F12`|Peek definition|
## Migliori Pratiche
### Prompimento efficace
- Sii specifico e chiaro nelle richieste
- Fornire contesto per risultati migliori
- Utilizzare esempi quando possibile
- Interrompere compiti complessi in parti più piccole
- Iterate e raffinate richieste
### Codice Qualità
- Recensione codice generato dall'IA con attenzione
- Aggiungi una corretta gestione degli errori
- Includere test completi
- Seguire gli standard di codifica
- Logica complessa del documento
### Prestazioni
- Utilizzare i modelli AI appropriati per le attività
- Ottimizzare le dimensioni del contesto
- Cache risposte usate frequentemente
- Monitorare l'utilizzo API
- Configurare i timeout in modo appropriato
### Sicurezza
- Commenti suggerimenti AI per problemi di sicurezza
- Non includere dati sensibili nei prompt
- Utilizzare endpoint API sicuri
- Implementare controlli di accesso adeguati
- Controlli di sicurezza regolari
## Esempi di integrazione
### Integrazione CI/CD
Traduzione:
### Scrittori personalizzati
Traduzione:
## Casi di uso comune
### Sviluppo web
- Generazione dei componenti reattivi
- Creazione endpoint API
- Progettazione dello schema di database
- Ottimizzazione front-end
- Controllo dell'automazione
### Scienza dei dati
- script di analisi dati
- Modelli di apprendimento automatico
- Codice di visualizzazione
- Condutture di pulizia dei dati
- Analisi statistica
### DevOps
- Infrastrutture come codice
- Configurazione delle tubazioni CI/CD
- Impostazione di monitoraggio
- script di distribuzione
- Configurazioni di sicurezza