FishEdit is a minimalist, fast, and dependency-free text editor that runs directly in the Windows Console. It's built entirely on top of the native Windows Console API (WriteConsoleOutputA, CHAR_INFO screen buffers, raw input mode) with no external libraries — just plain C.
It was built as a personal project to explore low-level text buffer management, undo/redo systems, and direct console rendering, resulting in a small, snappy editor that starts instantly and gets out of your way.
- 📝 Full text editing — insert, delete, and navigate through multi-line text with a dynamic row/column buffer.
- ↩️ Undo / Redo — snapshot-based undo history (up to 200 states) with smart action grouping (consecutive inserts/deletes are grouped into a single undo step).
- 💾 File I/O — open a file directly from the command line or save to a new file, with automatic
.txtextension handling. - 🔢 Line numbers — always-visible gutter showing the current line number.
- 📊 Status bar — live cursor position, total line count, and contextual messages (e.g.
Saved,Undo,No redo). - 🖱️ Smooth scrolling — both vertical and horizontal viewport scrolling for long lines and large files.
- ⌨️ Keyboard-first navigation — arrow keys,
Home/End,Page Up/Page Down, andTab(expanded to spaces). ⚠️ Unsaved changes protection — confirmation prompt before quitting with unsaved edits.- 🪶 Zero dependencies — pure C using only the Win32 API, no third-party libraries required.
| Key | Action |
|---|---|
Ctrl + S |
Save file (prompts for a name if none is set) |
Ctrl + Z |
Undo |
Ctrl + Y |
Redo |
Ctrl + X |
Quit (asks for confirmation if there are unsaved changes) |
Arrow Keys |
Move the cursor |
Home / End |
Jump to the start / end of the line |
Page Up / Page Down |
Scroll a full page up / down |
Tab |
Insert 4 spaces |
Backspace / Delete |
Delete the previous / next character |
Enter |
Insert a new line |
- Windows OS
- A C compiler:
- MinGW-w64 (
gcc), or - Microsoft Visual C++ Build Tools (
cl)
- MinGW-w64 (
Using MinGW (gcc):
gcc fishedit.c -o fishedit.exeUsing MSVC (Developer Command Prompt):
cl fishedit.c /Fe:fishedit.exeOpen a new, empty file:
fishedit.exeOpen an existing file (or create it if it doesn't exist yet):
fishedit.exe notes.txt💡 If the filename doesn't end in
.txt, FishEdit automatically appends the extension for you.
FishEdit/
├── fishedit.c # Main source file (editor logic, buffer, rendering, input)
├── images/
│ └── screenshot.png
└── README.md
FishEdit keeps the document in memory as a dynamic array of Row structures, each holding a growable character buffer. Every edit (insert or delete) is tracked by an action-run system: consecutive edits of the same type are treated as a single logical change, and a full-buffer snapshot is pushed onto the undo stack only when the action type changes — keeping undo/redo both simple and efficient for a small-to-medium sized editor.
Rendering is done through the Windows Console screen buffer API: the entire visible area (text, line numbers, title bar, and status bar) is composed into an off-screen CHAR_INFO grid and flushed to the console in a single WriteConsoleOutputA call per frame, avoiding flicker.
Contributions, bug reports, and feature suggestions are welcome!
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License — see the LICENSE file for details.
Adem Mzoughi Software Developer
