What You’ll Build
A simple text editor window with:- Syntax highlighting
- Vim or Standard editing mode
- Line numbers
- Full keyboard support
Prerequisites
- Zep installed (see Installation)
- ImGui set up in your project
- SDL2 and OpenGL context (for this example)
Creating Your First Editor
Create the editor instance
Initialize the Zep editor with ImGui display:
The config path is where Zep looks for configuration files. Pass an empty string or your app’s config directory.
Complete Minimal Example
Here’s a complete minimal example based on the demo:Switching Editor Modes
Zep supports both Standard (notepad-style) and Vim modes:Working with Buffers
Open a file
Get the active buffer
Create an empty buffer
Customizing Themes
Switch between light and dark themes:Common Operations
Check if refresh needed
Handle clipboard
Zep uses callbacks for clipboard operations. ImplementIZepComponent interface:
Next Steps
API Reference
Explore the full API documentation
Examples
See more advanced usage examples
For a complete working example with SDL2 and OpenGL setup, check out the demo_imgui in the Zep repository.
