Cursor Clone Ultimate
Command Palette
Ctrl+Shift+P
Quick Open
Ctrl+P
Search Files
Ctrl+Shift+F
Toggle Terminal
Ctrl+`
Preview
TERMINAL
PROBLEMS 0
OUTPUT
CONSOLE
API TESTER
bash
[System] Cursor Clone Ultimate Max initialized.
>
Response will appear here...
AI Chat
Cursor AI
Welcome! I can help you with your code. Use @filename to reference specific files.
main
0 0
Ln 1, Col 1
Plain Text
UTF-8
', 'lorem': 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', }; // Handle class and id syntax: div.class#id const match = abbreviation.match(/^(\w+)(\.[\w-]+)?(#[\w-]+)?$/); if (match) { const [, tag, cls, id] = match; let result = `<${tag || 'div'}`; if (id) result += ` id="${id.slice(1)}"`; if (cls) result += ` class="${cls.slice(1)}"`; result += `>`; return result; } return expansions[abbreviation] || abbreviation; } // Listen for Tab in editor to expand Emmet function initEmmet() { if (!editor) return; editor.addCommand(monaco.KeyCode.Tab, () => { const model = editor.getModel(); const position = editor.getPosition(); if (!model || !position) return; const line = model.getLineContent(position.lineNumber); const textBefore = line.substring(0, position.column - 1); // Find the abbreviation (last word) const abbrevMatch = textBefore.match(/[\w.#:*>]+$/); if (abbrevMatch && activeFile?.endsWith('.html')) { const abbrev = abbrevMatch[0]; const expanded = expandEmmet(abbrev); if (expanded !== abbrev) { const range = new monaco.Range( position.lineNumber, position.column - abbrev.length, position.lineNumber, position.column ); editor.executeEdits('emmet', [{ range, text: expanded }]); return; } } // Default tab behavior editor.trigger('keyboard', 'tab', null); }); } // ==================== SETTINGS UI ==================== let settings = { theme: localStorage.getItem('theme') || 'dark', fontSize: parseInt(localStorage.getItem('fontSize') || '14'), tabSize: parseInt(localStorage.getItem('tabSize') || '2'), wordWrap: localStorage.getItem('wordWrap') === 'true', formatOnSave: localStorage.getItem('formatOnSave') === 'true', autoSave: localStorage.getItem('autoSave') !== 'false', minimap: localStorage.getItem('minimap') !== 'false', }; function openSettings() { const modal = document.getElementById('commandModal'); modal.classList.add('active'); modal.innerHTML = `
Editor
Appearance
Keybindings
AI
${getSettingsHtml('editor')}
`; } function getSettingsHtml(section) { const sections = { editor: `
Font Size
Controls the font size in pixels
${settings.fontSize}px
Tab Size
The number of spaces a tab is equal to
Word Wrap
Controls how lines should wrap
Format On Save
Format a file on save
Auto Save
Automatically save files after changes
Minimap
Show minimap in editor
`, appearance: `
Theme
Select the color theme
`, keybindings: `
Ctrl+S
Save File
Ctrl+P
Quick Open
Ctrl+Shift+P
Command Palette
Ctrl+K
Inline Edit with AI
Ctrl+L
Focus AI Chat
Ctrl+G
Go to Line
Ctrl+Shift+O
Go to Symbol
Ctrl+/
Toggle Comment
Ctrl+D
Add Selection to Next Match
Ctrl+B
Toggle Sidebar
Ctrl+J
Toggle Panel
Ctrl+\`
Toggle Terminal
F2
Rename Symbol
F12
Go to Definition
Alt+Z
Toggle Word Wrap
`, ai: `
API Key
Your OpenRouter API key
Model
Selected AI model: ${selectedModel || 'Default'}
` }; return sections[section] || ''; } function showSettingsSection(section) { document.querySelectorAll('.settings-nav-item').forEach(i => i.classList.remove('active')); event.target.classList.add('active'); document.getElementById('settingsContent').innerHTML = getSettingsHtml(section); } function updateSetting(key, value) { settings[key] = key === 'fontSize' || key === 'tabSize' ? parseInt(value) : value; localStorage.setItem(key, value); if (editor) { if (key === 'fontSize') editor.updateOptions({ fontSize: settings.fontSize }); if (key === 'tabSize') editor.updateOptions({ tabSize: settings.tabSize }); if (key === 'wordWrap') editor.updateOptions({ wordWrap: settings.wordWrap ? 'on' : 'off' }); if (key === 'minimap') editor.updateOptions({ minimap: { enabled: settings.minimap } }); } toast(`${key} updated to ${value}`, 'success'); } function toggleSetting(key, el) { settings[key] = !settings[key]; localStorage.setItem(key, settings[key]); el.classList.toggle('on'); if (editor) { if (key === 'wordWrap') editor.updateOptions({ wordWrap: settings[key] ? 'on' : 'off' }); if (key === 'minimap') editor.updateOptions({ minimap: { enabled: settings[key] } }); } } // ==================== REGEX SEARCH ==================== function searchInFiles(query, isRegex = false, caseSensitive = false) { const results = []; for (const [path, file] of Object.entries(VFS)) { if (file.type !== 'file') continue; try { const regex = isRegex ? new RegExp(query, caseSensitive ? 'g' : 'gi') : new RegExp(query.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), caseSensitive ? 'g' : 'gi'); const lines = file.content.split('\n'); lines.forEach((line, index) => { if (regex.test(line)) { results.push({ file: path, line: index + 1, content: line.trim(), matches: line.match(regex) || [] }); } regex.lastIndex = 0; // Reset regex }); } catch (e) {} } return results; } function replaceInFiles(query, replacement, isRegex = false) { let count = 0; for (const [path, file] of Object.entries(VFS)) { if (file.type !== 'file') continue; try { const regex = isRegex ? new RegExp(query, 'g') : new RegExp(query.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'g'); const newContent = file.content.replace(regex, () => { count++; return replacement; }); if (newContent !== file.content) { VFS[path].content = newContent; VFS[path].modified = true; } } catch (e) {} } saveToLocalStorage(); renderTree(); toast(`Replaced ${count} occurrences`, 'success'); return count; } // ==================== BREAKPOINTS ==================== let breakpoints = {}; function toggleBreakpoint(line) { const file = activeFile; if (!file) return; if (!breakpoints[file]) breakpoints[file] = []; const index = breakpoints[file].indexOf(line); if (index > -1) { breakpoints[file].splice(index, 1); } else { breakpoints[file].push(line); } updateBreakpointDecorations(); } function updateBreakpointDecorations() { if (!editor || !activeFile) return; const bp = breakpoints[activeFile] || []; const decorations = bp.map(line => ({ range: new monaco.Range(line, 1, line, 1), options: { isWholeLine: true, glyphMarginClassName: 'breakpoint-decoration', glyphMarginHoverMessage: { value: 'Breakpoint' } } })); editor.deltaDecorations([], decorations); } // ==================== GIT DIFF INLINE ==================== function showGitDiff() { const modified = Object.entries(VFS).filter(([_, f]) => f.modified); if (modified.length === 0) { toast('No modified files', 'info'); return; } let html = '
'; for (const [path, file] of modified) { html += `
${path}
${escapeHtml(file.content.slice(0, 500))}${file.content.length > 500 ? '...' : ''}
`; } html += '
'; document.getElementById('gitChanges').innerHTML = html; switchView('git'); } // ==================== UTILITIES ==================== function escapeHtml(text) { return text.replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"'); } function saveToLocalStorage() { localStorage.setItem('vfs', JSON.stringify(VFS)); } // Initialize enhanced features initEnhancedShortcuts(); enableAutoSave(); // Initialize tree on first load if (Object.keys(VFS).length > 0) { setTimeout(() => renderTree(), 100); }