Personal Code Editor - A lightweight, cross-platform Vim-like GUI text editor for programmers.
Built with Dear ImGui + GLFW + ImGuiColorTextEdit - one codebase, runs everywhere.
pcode-editor v0.2.95 (2026-04-19)
| Platform | Backend | Status |
|---|---|---|
| Windows | Win32 | Supported |
| Linux | Wayland | Supported |
| FreeBSD | X11 | Supported |
| OpenBSD | X11 | Supported |
| NetBSD | X11 | Supported |
| macOS | Cocoa | Supported |
- Syntax highlighting for 20+ languages (C, C++, Python, JavaScript, etc.)
- Line numbers with change history tracking
- Code folding
- Bookmarks
- Multiple tabs with split windows
- Find and replace
- Word wrap
- NORMAL mode for navigation and commands
- INSERT mode for text entry
- COMMAND mode for ex commands (
:w,:q,:sp, etc.) - Visual mode support
- Split windows (
:sphorizontal,:vspvertical) - Minimap for quick navigation
- Floating command palette (Ctrl+P)
- Sidebar with Files/Git/Symbols
- Status bar with mode, cursor position, encoding
- Gutter with line numbers and change indicators
- Built-in terminal (
:term,:shell,:sh) - Direct keyboard input to shell
- Independent font zoom for terminal (Ctrl++/-)
- Cross-platform settings file (
pcode-settings.json) - Font customization (size, family)
- Theme toggle (dark/light)
- Recent files management
- Full keyboard-first navigation
- Vim-style keybindings
- Ctrl+W for split navigation
- Command palette
# Auto-detects platform and builds accordingly
./scripts/build.sh Release# FreeBSD/OpenBSD/NetBSD (X11)
./scripts/build-freebsd.sh Release
# Linux (Wayland)
./scripts/build-linux.sh Release
# Windows (MSVC)
scripts\build-windows.bat Release
# Windows (MinGW/MSYS2 PowerShell)
.\scripts\build-windows-mingw.ps1 Release# Windows
.\build\Release\pcode-editor.exe
# Linux/macOS/BSD
./build/Release/pcode-editor
# Open a file
pcode-editor filename.cppRequirements:
- Visual Studio 2022 (or Build Tools)
- CMake 3.16+
Build:
mkdir build && cd build
cmake .. -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
.\Release\pcode-editor.exeOr use the build script:
scripts\build-windows.bat ReleaseInstall dependencies:
# Ubuntu/Debian
sudo apt install cmake build-essential libwayland-dev wayland-protocols \
libxkbcommon-dev libgtk-3-dev libgl1-mesa-dev pkg-configBuild:
mkdir -p build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DGLFW_BUILD_WAYLAND=ON
make -j$(nproc)
./pcode-editorInstall dependencies:
# FreeBSD
sudo pkg install cmake xorg-libX11 xorgproto gtk3 mesa-libs pkgconfBuild:
mkdir -p build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DGLFW_BUILD_X11=ON
make -j$(sysctl -n hw.ncpu)
./pcode-editorInstall dependencies:
brew install cmakeBuild:
mkdir -p build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(sysctl -n hw.ncpu)
./pcode-editor| Command | Action |
|---|---|
:w |
Save file |
:q |
Close tab |
:q! |
Close without saving |
:wq |
Save and close |
:e filename |
Open file |
| Command | Action |
|---|---|
:sp |
Horizontal split |
:vsp |
Vertical split |
:set nu |
Show line numbers |
:set nonu |
Hide line numbers |
:set wrap |
Enable word wrap |
:set nowrap |
Disable word wrap |
| Command | Action |
|---|---|
:term |
Open terminal |
:shell |
Open default shell |
:sh |
Open default shell |
| Command | Action |
|---|---|
Ctrl++ |
Zoom in |
Ctrl+- |
Zoom out |
Ctrl+0 |
Reset zoom |
| Shortcut | Action |
|---|---|
Ctrl+N |
New tab |
Ctrl+O |
Open file |
Ctrl+S |
Save |
Ctrl+W |
Close tab |
| Shortcut | Action |
|---|---|
Ctrl+C |
Copy |
Ctrl+V |
Paste |
Ctrl+Z |
Undo |
Ctrl+Y |
Redo |
Ctrl+F |
Find |
| Shortcut | Action |
|---|---|
Ctrl+P |
Command palette |
| `Ctrl+`` | Toggle terminal |
| Shortcut | Action |
|---|---|
Ctrl+W h |
Focus left |
Ctrl+W j |
Focus down |
Ctrl+W k |
Focus up |
Ctrl+W l |
Focus right |
Ctrl+W o |
Close others |
Settings are stored in pcode-settings.json:
{
"window_w": 1280,
"window_h": 800,
"dark_theme": true,
"font_size": 18,
"font_name": "JetBrains Mono",
"tab_size": 4,
"word_wrap": true,
"show_line_numbers": true,
"show_minimap": true
}src/
+-- main.cpp - Entry point
+-- editor_app.h - Class definitions
+-- editor_app.cpp - Main implementation
scripts/
+-- build.sh - Universal build script
+-- build-freebsd.sh - BSD (X11)
+-- build-linux.sh - Linux (Wayland)
+-- build-windows.bat - Windows (MSVC)
+-- build-windows-mingw.ps1 - Windows (MinGW)
docs/
+-- userguide.md - User documentation
+-- developer.md - Developer guide
+-- imgui_tutorial.md - Dear ImGui guide
+-- faq.md - FAQ
CMakeLists.txt - Cross-platform build config
VERSION - Version file
pcode-settings.json - User settings
All dependencies are fetched automatically via CMake FetchContent:
| Library | Purpose | License |
|---|---|---|
| Dear ImGui | Immediate mode GUI | MIT |
| GLFW | Window/input management | zlib |
| ImGuiColorTextEdit | Syntax highlighting | MIT |
| Native File Dialog | Cross-platform file dialogs | zlib |
- Keyboard-first - every action has a keybinding
- Fast - immediate mode rendering, minimal dependencies
- Minimal - no bloat, no telemetry, no auto-updates
- Portable - one codebase, Windows + Linux + BSD + macOS
Edit pcode-settings.json:
"font_size": 18Click on the terminal window to focus it before typing.
- Ensure all platform-specific dependencies are installed
- Use the provided build scripts
- See
docs/faq.mdfor detailed solutions
- User Guide - For end users
- Developer Guide - For contributors
- Dear ImGui Tutorial - ImGui learning resource
- Versioning Strategy - Release and tagging process
- FAQ - Common issues and solutions
BSD 2-Clause License - see LICENSE file.