This repository contains configuration files for the Scintilla-based code editors used in MySQL Workbench. These XML files define syntax highlighting, color schemes, editor settings, and keyword definitions for various programming languages supported by MySQL Workbench.
The configuration files customize the appearance and behavior of code editors within MySQL Workbench, providing syntax highlighting and editor preferences for:
- MySQL SQL (various versions including 5.6, 5.7, 8.0, and 8.1)
- C/C++ programming languages
- JSON format
Main configuration file containing:
- MySQL syntax highlighting definitions for different MySQL versions (5.6, 5.7, 8.0, 8.1)
- C/C++ syntax highlighting and keyword definitions
- JSON syntax highlighting
- Color schemes with support for both light and dark themes
- Editor settings (tab width, indentation, folding options)
Alternative or backup configuration file with similar structure to the main configuration.
- Comprehensive keyword highlighting for MySQL statements, functions, and operators
- Version-specific keywords for MySQL 5.6, 5.7, 8.0, and 8.1
- Syntax elements including:
- Keywords and reserved words
- String literals (single and double quoted)
- Numeric values
- Comments (line and block)
- Variables (user and system)
- Functions and procedures
- Identifiers and quoted identifiers
- Dark theme with modern color palette
- Light theme compatibility
- Customizable colors for different syntax elements
- Smart Indentation: Automatic indentation with 2-space tabs for better code readability
- Brace Matching: Automatic highlighting of matching brackets and braces
- Code Folding: Advanced folding support for functions, comments, and control structures
- Current Line Highlighting: Visual indication of the active line
- Improved Line Numbers: Enhanced visibility with better contrast
- Word Wrapping: Configurable word wrapping for JSON files
- MySQL 8.1 Support: Latest MySQL features including vector functions, JSON enhancements
- Window Functions: Complete support for OVER, PARTITION BY, ROW_NUMBER, RANK, etc.
- JSON Functions: Full coverage of JSON manipulation and validation functions
- Spatial Functions: ST_* functions for geometric operations
- Regular Expression Functions: REGEXP_* functions for pattern matching
- Common Table Expressions: WITH and RECURSIVE support
- Storage Engines: InnoDB, MyISAM, Memory, Archive, CSV recognition
- System Variables: Distinct highlighting for @@global and @@session variables
- Procedure Keywords: Complete stored procedure and function syntax support
- Error Handling: SIGNAL, RESIGNAL, and condition handling keywords
- Dual Theme Support: Optimized colors for both light and dark themes
- High Contrast: Improved readability with better color contrast ratios
- Semantic Coloring: Different colors for keywords, functions, variables, and data types
- Error Highlighting: Special styling for string end-of-line errors
- Latest Keywords:
concept
,requires
,co_await
,co_return
,co_yield
- Modules:
import
andmodule
keyword support - Coroutines: Full coroutine syntax highlighting
- Constraints: Concept and constraint syntax support
- STL Types: Comprehensive coverage of standard library types
- Smart Pointers:
shared_ptr
,unique_ptr
,weak_ptr
recognition - Containers: Vector, map, set, unordered containers
- Ranges and Views: C++20 ranges library support
- Concepts: Standard concepts like
same_as
,convertible_to
- Doxygen Support: Complete Doxygen comment keyword highlighting
- Code Folding: Advanced folding for classes, functions, and namespaces
- Preprocessor: Enhanced preprocessor directive support
- Schema Keywords: Support for JSON Schema validation keywords
- Type System: Recognition of schema type definitions
- Validation: Keywords for validation rules and constraints
- Modern Formatting: Optimized for 2-space indentation
- Property Highlighting: Enhanced highlighting for object properties
- Backquoted Identifiers: MySQL backtick identifier support
- Escape Sequences: Proper handling of escape sequences in strings
- Dotted Words: Support for qualified identifiers (database.table.column)
- Number Sign Comments: MySQL-style # comments
- Backslash Escapes: SQL backslash escape sequence support
- Comment Folding: Fold multi-line comments and documentation blocks
- Explicit Folding: Custom fold markers with //{ and //}
- Syntax-Based Folding: Intelligent folding based on language syntax
- Compact Folding: Optimized folding display
- Incremental Parsing: Faster syntax highlighting for large files
- Memory Efficiency: Optimized keyword tables and style definitions
- Real-time Updates: Immediate syntax highlighting as you type
- Lightweight Themes: Minimal resource usage for color schemes
- Fast Rendering: Optimized style calculations
- Smooth Scrolling: Improved editor performance for large documents
The configuration uses a modern dark theme with the following color palette:
- Background:
#232729
- Text:
#abb2bf
- Comments:
#5c6370
- Strings:
#98c379
- Numbers:
#d19a66
- Keywords:
#61afef
/#56b6c2
- Functions:
#c678dd
- Variables:
#e06c75
- MySQL Workbench 8.0 or higher (recommended)
- Administrative privileges to modify MySQL Workbench configuration files
- Text editor for manual configuration editing (optional)
- Close MySQL Workbench completely
- Navigate to the MySQL Workbench data directory:
Or the installation directory:
%APPDATA%\MySQL\Workbench\
C:\Program Files\MySQL\MySQL Workbench 8.0\data\
- Backup existing configuration: Copy
code_editor.xml
tocode_editor.xml.backup
- Replace
code_editor.xml
with the enhanced configuration - Restart MySQL Workbench
- Close MySQL Workbench completely
- Navigate to the MySQL Workbench configuration directory:
~/Library/Application Support/MySQL/Workbench/
- Backup existing configuration: Copy
code_editor.xml
tocode_editor.xml.backup
- Replace
code_editor.xml
with the enhanced configuration - Restart MySQL Workbench
- Close MySQL Workbench completely
- Navigate to the MySQL Workbench configuration directory:
Or:
~/.mysql/workbench/
/usr/share/mysql-workbench/data/
- Backup existing configuration: Copy
code_editor.xml
tocode_editor.xml.backup
- Replace
code_editor.xml
with the enhanced configuration - Restart MySQL Workbench
After installation, verify the configuration is working:
- Open MySQL Workbench
- Create a new SQL script or open an existing one
- Check that syntax highlighting is applied correctly
- Verify that keywords are highlighted in the new color scheme
- Test code folding functionality
If you encounter issues:
- Close MySQL Workbench
- Restore the backup:
code_editor.xml.backup
→code_editor.xml
- Restart MySQL Workbench
<!-- High contrast theme for better accessibility -->
<style id="8" bold="yes" fore-color-light="#000080" fore-color-dark="#00FFFF" /> <!-- Keywords -->
<style id="15" fore-color-light="#800080" fore-color-dark="#FF80FF" bold="yes" /> <!-- Functions -->
<style id="12" fore-color-light="#008000" fore-color-dark="#80FF80" /> <!-- Strings -->
<!-- Monochrome theme for focused coding -->
<style id="8" bold="yes" fore-color-light="#000000" fore-color-dark="#FFFFFF" />
<style id="15" fore-color-light="#404040" fore-color-dark="#C0C0C0" bold="yes" />
<style id="1" fore-color-light="#808080" fore-color-dark="#808080" italic="yes" />
<setting name="auto.indent" value="1" />
<setting name="brace.matching" value="1" />
<setting name="word.wrap" value="0" />
<setting name="line.numbers" value="1" />
<setting name="folding" value="1" />
<setting name="highlight.current.line" value="1" />
<setting name="show.whitespace" value="0" />
<setting name="caret.line.back" value="#2C323C" />
<setting name="selection.back" value="#3E4451" />
<!-- Enhanced MySQL lexer configuration -->
<property name="lexer.mysql.backticks.identifier" value="1" />
<property name="sql.backslash.escapes" value="1" />
<property name="lexer.sql.numbersign.comment" value="1" />
<property name="lexer.sql.allow.dotted.word" value="1" />
<property name="fold.at.else" value="1" />
<keywords name="Performance Keywords">
explain analyze optimize index cache buffer_pool
query_cache innodb_buffer_pool_size key_buffer_size
sort_buffer_size read_buffer_size join_buffer_size
max_connections thread_cache_size table_cache
</keywords>
<keywords name="C++23 Features">
concept requires co_await co_return co_yield
import module consteval constinit
atomic_cancel atomic_commit atomic_noexcept
synchronized reflexpr
</keywords>
Windows:
- User-specific:
%APPDATA%\MySQL\Workbench\
- System-wide:
C:\Program Files\MySQL\MySQL Workbench 8.0\data\
- Portable:
[MySQL Workbench Installation]\data\
macOS:
- User-specific:
~/Library/Application Support/MySQL/Workbench/
- System-wide:
/Applications/MySQLWorkbench.app/Contents/Resources/data/
Linux:
- User-specific:
~/.mysql/workbench/
- System-wide:
/usr/share/mysql-workbench/data/
- Snap package:
~/snap/mysql-workbench-community/current/.mysql/workbench/
Before applying the configuration, validate the XML structure:
Windows PowerShell:
[xml](Get-Content 'code_editor.xml') | Out-Null
Linux/macOS:
xmllint --noout code_editor.xml
MySQL Workbench reads configuration in this order:
- System-wide configuration (read-only)
- User-specific configuration (recommended for custom themes)
- Workspace-specific settings (overrides user settings)
Create Backup:
# Windows
copy "%APPDATA%\MySQL\Workbench\code_editor.xml" "%APPDATA%\MySQL\Workbench\code_editor.xml.backup"
# Linux/macOS
cp ~/.mysql/workbench/code_editor.xml ~/.mysql/workbench/code_editor.xml.backup
Restore Backup:
# Windows
copy "%APPDATA%\MySQL\Workbench\code_editor.xml.backup" "%APPDATA%\MySQL\Workbench\code_editor.xml"
# Linux/macOS
cp ~/.mysql/workbench/code_editor.xml.backup ~/.mysql/workbench/code_editor.xml
- Check XML Syntax: Ensure all XML tags are properly closed
- Verify Style IDs: Make sure style IDs match Scintilla constants
- Keyword Conflicts: Check for duplicate or conflicting keyword definitions
- File Encoding: Ensure the XML file is saved in UTF-8 encoding
- Reduce Keyword Lists: Large keyword lists can slow down highlighting
- Optimize Regex: Complex regular expressions in lexer properties
- Limit Style Complexity: Too many style variations can impact performance
- Check Memory Usage: Monitor MySQL Workbench memory consumption
- Contrast Issues: Ensure sufficient contrast between foreground and background
- Missing Dark/Light Variants: Define both light and dark theme colors
- Accessibility: Test with high contrast system settings
- Color Blindness: Consider color-blind friendly palettes
<!-- Enable debug mode for lexer testing -->
<property name="lexer.debug" value="1" />
<property name="lexer.trace" value="1" />
- Use Scintilla's style inspector tools
- Test with various file sizes and complexity
- Validate against different MySQL versions
- Check performance with large result sets
- Version Control: Keep configuration files in version control
- Backup Before Changes: Always backup working configurations
- Test Incrementally: Make small changes and test thoroughly
- Document Changes: Comment your customizations in the XML
- User Preferences: Provide multiple theme options for users
- Minimize Keywords: Only include necessary keywords
- Efficient Styles: Use simple color definitions
- Lexer Properties: Enable only needed lexer features
- Memory Management: Monitor resource usage during editing
Edit the <style>
elements in the XML files to change colors:
<style id="8" bold="Yes" fore-color-light="#61afef" />
Add new keywords to the appropriate <keywords>
section:
<keywords name="Keywords">
your_custom_keyword another_keyword
</keywords>
Modify editor behavior by changing <setting>
elements:
<setting name="tabwidth" value="4" />
<setting name="indentation" value="4" />
The configuration is designed to work with Scintilla lexers:
SCLEX_MYSQL
for MySQL syntaxSCLEX_CPP
for C/C++ syntaxSCLEX_CPP_JSON
for JSON syntax
Style IDs correspond to Scintilla's lexer constants (see SciLexer.h
):
SCE_MYSQL_DEFAULT
(0)SCE_MYSQL_COMMENT
(1)SCE_MYSQL_KEYWORD
(8)- And many more...
When modifying the configuration:
- Test changes with different MySQL versions
- Verify both light and dark theme compatibility
- Ensure keyword lists are complete and accurate
- Validate XML syntax
- MySQL Workbench: 6.0+
- MySQL Versions: 5.6, 5.7, 8.0, 8.1
- Platforms: Windows, macOS, Linux
This configuration file is provided under the MIT License for the configuration portions and respects the MySQL Workbench licensing terms for integration purposes.
MIT License
Copyright (c) 2025 MySQL Workbench Code Editor Configuration
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
This configuration is designed to be compatible with MySQL Workbench, which is licensed under the GPL v2 license. The configuration files do not modify MySQL Workbench's core functionality but provide enhanced syntax highlighting and editor settings.
- Scintilla Editor: This configuration works with the Scintilla editing component used by MySQL Workbench
- MySQL Keywords: MySQL-specific keywords and functions are referenced according to MySQL documentation
- C++ Standards: C++ keywords follow the ISO C++ standard specifications
- This configuration is not officially endorsed by Oracle Corporation or the MySQL team
- Use at your own risk; always backup existing configuration files
- No warranty is provided for compatibility with future MySQL Workbench versions
- The authors are not responsible for any data loss or system issues
If you distribute this configuration or create derivative works:
- Include this license notice
- Credit the original authors
- Maintain compatibility with MySQL Workbench licensing terms
- Minimum: MySQL Workbench 6.0
- Recommended: MySQL Workbench 8.0 or higher
- Tested: MySQL Workbench 8.0.35, 8.0.36, 8.1.0
- MySQL 5.6: Basic syntax highlighting
- MySQL 5.7: Enhanced features and functions
- MySQL 8.0: Full feature support including JSON, window functions
- MySQL 8.1: Latest features including vector functions
- Windows: Windows 10, Windows 11, Windows Server 2016+
- macOS: macOS 10.14 (Mojave) or higher
- Linux: Ubuntu 18.04+, CentOS 7+, RHEL 7+, openSUSE 15+
- Memory: Additional 50-100 MB for enhanced keyword tables
- Storage: 2-5 MB for configuration files
- Processor: No additional requirements
- Large Files: Performance may degrade with SQL files larger than 10 MB
- Complex Queries: Very complex nested queries may have slower highlighting
- Custom Functions: User-defined functions require manual keyword addition
- Legacy Syntax: Some deprecated MySQL syntax may not be highlighted
- Added: MySQL 8.1 support with vector functions
- Added: Enhanced JSON schema support
- Added: C++23 keyword support
- Added: Advanced code folding
- Added: Dual theme optimization
- Improved: Performance optimizations
- Improved: Color contrast and accessibility
- Fixed: Lexer property conflicts
- Added: MySQL 8.0 comprehensive support
- Added: Window functions highlighting
- Added: Spatial functions support
- Improved: C++ modern standard support
- Initial: Basic MySQL syntax highlighting
- Initial: C/C++ support
- Initial: JSON formatting
- MySQL Workbench Manual: dev.mysql.com/doc/workbench/en/
- MySQL 8.1 Reference: dev.mysql.com/doc/refman/8.1/en/
- Scintilla Documentation: scintilla.org/ScintillaDoc.html
- Check Prerequisites: Ensure you have the correct MySQL Workbench version
- Validate XML: Use an XML validator to check file syntax
- Test Incrementally: Apply changes step by step
- Review Logs: Check MySQL Workbench error logs
- Verify Keywords: Ensure keywords are in the correct sections
- Check Style IDs: Confirm style IDs match Scintilla constants
- Test File Size: Large files may cause performance issues
- Update Configuration: Ensure you have the latest version
- Reduce Complexity: Minimize keyword lists if experiencing slowdowns
- Check Memory: Monitor MySQL Workbench memory usage
- Optimize Queries: Large result sets may affect editor performance
- Restart Application: Sometimes a simple restart resolves issues
When reporting issues, please include:
- MySQL Workbench Version: Help → About MySQL Workbench
- Operating System: Version and architecture
- Configuration File: Which version you're using
- Error Description: Detailed description of the problem
- Steps to Reproduce: How to recreate the issue
- Screenshots: Visual examples of the problem (if applicable)
We welcome contributions! Please:
- Fork the Repository: Create your own copy
- Test Changes: Verify your modifications work correctly
- Follow Standards: Maintain XML formatting and style consistency
- Document Changes: Update README and comments
- Submit Pull Request: Provide clear description of improvements
If you discover any security-related issues with the configuration:
- Do Not create public issues
- Contact maintainers privately
- Provide detailed information about the vulnerability
- Allow time for investigation and resolution
Note: This configuration enhances MySQL Workbench's built-in editor but does not modify core functionality. Always maintain backups of your original configuration files and test changes in a development environment before applying to production systems.