Skip to content

cnebrera/cursor-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎨 Cursor Editor Configuration Backup

This repository contains a complete backup of your Cursor editor configuration, making it easy to sync settings across multiple machines or restore after a fresh install.

📦 What's Included

Configuration Files (backup/ directory)

  • settings.json - All editor settings (fonts, theme, editor preferences)
  • keybindings.json - Custom keyboard shortcuts
  • cli-config.json - Cursor AI configuration (permissions, privacy mode, default model)
  • mcp.json - MCP (Model Context Protocol) server integrations
  • extensions.txt - List of installed extensions (auto-generated by backup script)
  • .cursorrules - AI assistant rules and coding standards
  • snippets/ - Code snippets (only backed up if you have custom snippets)

Utility Files (root directory)

  • backup.sh - Script to backup current configuration to backup/
  • restore.sh - Script to restore configuration from backup/
  • README.md - This documentation

🎯 Current Configuration

  • Font: JetBrains Mono with ligatures
  • Theme: IntelliJ IDEA New UI Dark
  • Icons: VSCode Icons
  • Java Runtimes: JDK 11, 17, 21, 24 (GraalVM)
  • Features:
    • Auto-save on focus change
    • Git auto-fetch enabled
    • Smart commit enabled
    • Font ligatures enabled
  • AI Configuration:
    • Default Model: GPT-5
    • Privacy Mode: Enabled (Ghost Mode)
    • Command Permissions: Shell(ls) allowed
    • MCP Integrations: Docker support
  • AI Rules:
    • SonarQube quality standards enforced
    • Comprehensive documentation required
    • Proper error handling and logging
    • English-only code and comments
    • Git safety rules (no automatic commits)

🔄 How to Backup (Update Configuration)

When you make changes to your Cursor settings that you want to save:

cd ~/cursor-config
./backup.sh

This will:

  1. Create/update the backup/ directory
  2. Copy current settings.json from Cursor to backup/
  3. Copy current keybindings.json to backup/
  4. Copy cli-config.json (AI permissions and settings) to backup/
  5. Copy mcp.json (MCP integrations) to backup/
  6. Auto-generate extensions.txt with all installed extensions
  7. Copy any snippets (if you have custom snippets created) to backup/snippets/
  8. Verify .cursorrules is present in backup/
  9. Show you what was backed up

Committing Changes to Git

# Review what changed
git diff

# Stage and commit changes
git add .
git commit -m "Update Cursor configuration"

# Push to remote (if you have one configured)
git push

🚀 How to Restore (New Machine Setup)

On a new Mac where you want to restore your Cursor configuration:

Step 1: Install Prerequisites

# Install Homebrew (if not installed)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install JetBrains Mono font
brew install font-jetbrains-mono

# Install Cursor (if not installed)
# Download from: https://cursor.sh

Step 2: Clone This Repository

cd ~
git clone <your-repo-url> cursor-config
cd cursor-config

Step 3: Run Restore Script

chmod +x restore.sh
./restore.sh

Step 4: Verify Cursor Rules

The .cursorrules file has been copied to your home directory (~/.cursorrules) for global AI rules.

For project-specific rules:

# Copy to a specific project
cp ~/.cursorrules /path/to/your/project/

Step 5: Install Extensions

Open Cursor (Cmd + Shift + X) and search for each extension listed in extensions.txt:

Essential Extensions:

  • vscode-icons (Icon theme)
  • IntelliJ IDEA Theme (Color theme)
  • Java Language Support (redhat.java)
  • YAML Language Support (redhat.vscode-yaml)
  • Python Language Support (ms-python.python)
  • Kotlin Language Support (fwcd.kotlin)
  • And others as listed in extensions.txt

Step 6: Restart Cursor

# Quit Cursor
Cmd + Q

# Reopen Cursor
# All settings should now be applied!

⚙️ Cursor AI Configuration Files

cli-config.json

Controls Cursor AI behavior and permissions:

Permissions:

  • Defines which shell commands the AI can execute
  • Currently allowed: Shell(ls) only
  • Add more commands as needed for your workflow

Privacy Settings:

  • Ghost Mode: Enabled (enhanced privacy)
  • Privacy Mode: Level 2 (balanced privacy/functionality)

Model Configuration:

  • Default AI Model: GPT-5
  • Model preferences and fallbacks

mcp.json

Model Context Protocol server integrations:

  • Docker integration for containerized workflows
  • Can be extended with additional MCP servers
  • Enables AI to interact with external services

🤖 Cursor AI Rules

The .cursorrules file contains comprehensive guidelines for the AI assistant:

Code Quality

  • Follow SonarQube principles (avoid duplication, maintain low complexity)
  • Apply SOLID principles
  • Write production-ready, maintainable code
  • Never provide "quick and dirty" solutions

Documentation

  • Comprehensive documentation for classes, functions, and variables
  • Use language-specific standards (Javadoc, JSDoc, docstrings, etc.)
  • Include inline comments for complex logic
  • All documentation must be in English

Error Handling

  • Proper exception management with controlled propagation
  • Structured logging at appropriate levels (INFO, WARN, ERROR, DEBUG)
  • Include contextual information in logs

Naming Conventions

  • Descriptive names only (no abbreviations or short names)
  • Follow language-specific conventions (camelCase, PascalCase, snake_case)
  • Express intent clearly through naming

Version Control Safety

  • Never commit or push without explicit permission
  • Never skip git hooks
  • Never force push to main/master
  • Always provide clear commit messages

Usage

  • Global rules: Place in ~/.cursorrules (affects all projects)
  • Project-specific rules: Place in project root (overrides global rules)

🛠️ Manual Configuration

If you prefer to manually copy files:

Backup Manually

# Cursor configuration location on macOS
CURSOR_DIR="$HOME/Library/Application Support/Cursor/User"

# Copy settings
cp "$CURSOR_DIR/settings.json" ~/cursor-config/
cp "$CURSOR_DIR/keybindings.json" ~/cursor-config/
cp -r "$CURSOR_DIR/snippets/" ~/cursor-config/snippets/

# Copy Cursor AI configuration
cp ~/.cursor/cli-config.json ~/cursor-config/
cp ~/.cursor/mcp.json ~/cursor-config/

# Note: .cursorrules is maintained directly in the backup directory

Restore Manually

CURSOR_DIR="$HOME/Library/Application Support/Cursor/User"

# Copy settings back
cp ~/cursor-config/settings.json "$CURSOR_DIR/"
cp ~/cursor-config/keybindings.json "$CURSOR_DIR/"
cp -r ~/cursor-config/snippets/ "$CURSOR_DIR/"

# Copy Cursor AI configuration back
mkdir -p ~/.cursor
cp ~/cursor-config/cli-config.json ~/.cursor/
cp ~/cursor-config/mcp.json ~/.cursor/

# Copy .cursorrules to home directory (global) or project directory
cp ~/cursor-config/.cursorrules ~/
# Or to a specific project:
# cp ~/cursor-config/.cursorrules /path/to/your/project/

📝 Customization

Adding New Extensions

When you install a new extension:

  1. Add it to extensions.txt with a description
  2. Run ./backup.sh
  3. Commit the changes

Modifying Settings

  1. Change settings in Cursor (Cmd + ,)
  2. Run ./backup.sh to save changes
  3. Commit and push

🔧 Troubleshooting

Scripts Not Executable

chmod +x backup.sh restore.sh

Cursor Directory Not Found

Make sure Cursor is installed and has been opened at least once. The configuration directory is created on first launch.

Font Not Showing

If JetBrains Mono isn't showing:

# Reinstall font
brew reinstall font-jetbrains-mono

# Restart Cursor
# Cmd+Q then reopen

Theme Not Applied

  1. Open Command Palette: Cmd + Shift + P
  2. Type: "Preferences: Color Theme"
  3. Select: "IntelliJ IDEA New UI Dark"

📋 Quick Reference

Useful Cursor Commands

  • Command Palette: Cmd + Shift + P
  • Settings: Cmd + ,
  • Extensions: Cmd + Shift + X
  • Keyboard Shortcuts: Cmd + K, Cmd + S
  • Reload Window: Cmd + Shift + P → "Reload Window"

File Locations

# Cursor User Settings (macOS)
~/Library/Application Support/Cursor/User/

# Backup Location
~/cursor-config/

🎉 Configuration Highlights

Font Settings

  • Family: JetBrains Mono
  • Size: 13px
  • Ligatures: Enabled
  • Weight: 400 (Regular)
  • Line Height: 1.5

Editor Features

  • Auto-save on focus change
  • Smart Git integration
  • IntelliJ-style theme
  • VSCode modern icons

📚 Additional Resources

🤝 Contributing

This is a personal configuration backup, but feel free to fork and adapt it for your own use!

📄 License

Personal configuration - use as you wish!


Last Updated: $(date) Maintained by: Carlos Nebrera

About

Cursor configuration backup

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages