Skip to content

djwisdom/pzep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

92 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

pZep - Vim-like Code Editor with Interactive Tutorial & REPL

A lightweight, standalone code editor with full Vim keybindings, an interactive tutorial system (:tutor), and multi-language REPL integration.

πŸš€ Quick Start

# Build
mkdir build && cd build
cmake -G "Visual Studio 17 2022" -A x64 -DENABLE_LUA_REPL=ON -DENABLE_DUKTAPE_REPL=ON ..
cmake --build . --config Release

# Run (Windows GUI)
./Release/pzep-gui.exe [filename]

Keybindings:

  • i β€” Enter insert mode
  • ESC β€” Return to normal mode
  • :q β€” Quit current window; :q! β€” Force quit
  • :w β€” Save buffer
  • :tutor β€” Launch interactive tutorial
  • :lua / :duktape / :quickjs β€” Open REPL buffer (if enabled)
  • Ctrl+Q β€” Quit application (with dirty buffer check)

πŸŽ“ Interactive Tutorial (:tutor)

The built-in tutorial guides you through pZep's core features with hands-on demos:

  1. Basic Navigation & Modes β€” Normal, Insert, Visual
  2. Window Splits β€” :split / :vsplit, navigating panes
  3. Tab Management β€” :tabnew, gt / gT
  4. REPL Integration β€” Try Lua, Duktape, or QuickJS inline
  5. Buffers & Files β€” Managing multiple files
  6. Advanced Commands β€” Search, replace, macros

Each lesson opens a dedicated tutorial buffer with explanatory text and embedded demo commands. Press the suggested keys to try features live.

πŸ–₯️ REPL Integration

pZep supports multiple scripting language REPLs that run in dedicated editor buffers:

REPL CMake Flag Example Usage
Lua -DENABLE_LUA_REPL=ON :lua β†’ 1+1 β†’ Enter β†’ 2
Duktape (JS) -DENABLE_DUKTAPE_REPL=ON :duktape β†’ Math.sqrt(16) β†’ Enter
QuickJS -DENABLE_QUICKJS_REPL=ON :quickjs β†’ const x = 42; x

REPL Keybindings (inside REPL buffer):

  • Enter β€” Evaluate current line or selected expression
  • Ctrl+Enter β€” Evaluate outer expression
  • Shift+Enter β€” Evaluate and insert result

πŸ—οΈ Architecture Overview

Core Components

  • ZepEditor β€” Main editor controller, manages tab windows, buffers, and global state
  • ZepTabWindow β€” Container for editor panes (splits) and file tabs
  • ZepWindow β€” Single editor pane with text area, line numbers, minimap, and scrollbars
  • ZepBuffer β€” Text buffer with undo/redo, syntax highlighting, and file I/O
  • ZepMode β€” Input modes (Normal, Insert, Visual, Command, Ex)
  • ZepDisplay β€” Rendering and input abstraction (Raylib backend)

Layout (Four-Corner Design)

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Tab Region (top)                           β”‚ ← File tabs
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Tab Content Region (center)                β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚ β”‚Line β”‚Git β”‚     Text     β”‚ Scrollbar/β”‚   β”‚
β”‚ β”‚ numsβ”‚    β”‚              β”‚ Minimap   β”‚   β”‚
β”‚ β””β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Command Region (bottom)                   β”‚
β”‚ Vim | NORMAL | 100% | file.txt | 12:5   β”‚ ← Status bar
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Vim Mode Reference

Mode Key Description
Normal ESC Navigation, commands (:w, :q)
Insert i, a, o Text editing
Visual v Character-wise selection
Command : Ex commands and search (/pattern)

πŸ”¨ Building

Windows (MSVC)

mkdir build && cd build
cmake -G "Visual Studio 17 2022" -A x64 \
  -DENABLE_LUA_REPL=ON \
  -DENABLE_DUKTAPE_REPL=ON \
  -DENABLE_QUICKJS_REPL=ON \
  ..
cmake --build . --config Release

The main library (Zep.lib) builds by default. The GUI app (pzep-gui) and REPL plugins are built as separate targets when their respective options are enabled.

Linux / macOS (GCC/Clang)

mkdir build && cd build
cmake -DENABLE_LUA_REPL=ON -DENABLE_DUKTAPE_REPL=ON ..
make -j$(nproc)

Dependencies: Lua, Duktape development headers (or use bundled sources).

πŸ“ Repository Structure

pzep/
β”œβ”€β”€ apps/
β”‚   └── pzep-gui/         # pZep-GUI application (Raylib)
β”œβ”€β”€ include/zep/          # Public headers
β”‚   β”œβ”€β”€ mode_tutorial.h   # Tutorial mode
β”‚   β”œβ”€β”€ commands_repl.h   # REPL command wrappers
β”‚   β”œβ”€β”€ repl_plugin.h     # Plugin ABI for external REPLs
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ mode_tutorial.cpp # Tutorial implementation
β”‚   β”œβ”€β”€ commands_repl.cpp # REPL command registration
β”‚   β”œβ”€β”€ mode_lua_repl.cpp # Lua REPL provider
β”‚   β”œβ”€β”€ mode_duktape_repl.cpp # Duktape REPL
β”‚   β”œβ”€β”€ mode_quickjs_repl.cpp # QuickJS REPL
β”‚   β”œβ”€β”€ repl_plugin_loader.cpp # Dynamic plugin loading
β”‚   β”œβ”€β”€ mode_vim.cpp      # Vim keybindings & ex commands
β”‚   β”œβ”€β”€ window.cpp        # 4-corner layout, line numbers, minimap
β”‚   └── ...               # Core editor (buffer, syntax, etc.)
β”œβ”€β”€ plugins/              # Plugin build configuration
β”œβ”€β”€ tests/                # Unit tests
└── README.md

✨ Recent Features (v0.5.x)

  • :tutor command β€” Guided interactive tutorial
  • Multi-language REPLs β€” Lua, Duktape (JavaScript), QuickJS
  • Dynamic plugin system β€” Load external REPL providers at runtime
  • Vim-style tilde indicators β€” ~ for lines beyond EOF in line numbers
  • Filler line rendering β€” Correct viewport filling and minimap alignment
  • Ex command ! support β€” :q!, :w! work without space
  • Windows GUI β€” No console window, native Win32 subsystem

πŸ› Known Issues & Workarounds

  • Cursor line/column display β€” May show -1 in rare edge cases after certain edits. A defensive clamp ensures the UI remains usable. (Tracking issue: investigate stale m_windowLines after buffer modifications.)
  • REPL plugin loading β€” QuickJS plugin may require external library on Windows. Use bundled sources via CMake options.

πŸ“„ License

Fork of Zep. Originally based on nzep (Notification Editor). See repository for full license details.

About

pZep - vim-like editor. 'nuff said.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

  •  

Packages

 
 
 

Contributors