sxceditor2 is a simple, terminal-based text editor written in C. It provides basic text editing functionality with a vim-like interface.
For a detailed explanation of the development process and implementation details, check out the article: テキストエディタをフルスクラッチで書いてみた #C - Qiita https://qiita.com/sxclij/items/177af8d39e18bb536b0d
- Vim-like modal editing (Normal, Insert, and Command modes)
- Basic file operations (open and save)
- Simple navigation using h, j, k, l keys
- Minimal terminal UI
- No dynamic memory allocation (
mallocnot used) - No global variables
- Rust-inspired error handling
- Lightweight and portable
- Operating System: Linux
- None (uses standard C libraries only)
To build sxceditor2, ensure you have a C compiler (like gcc) installed on your system. Then, compile the source code:
gcc -o sxceditor2 sxceditor2.c
Run the editor:
./sxceditor2
- Normal mode: Default mode for navigation
- Insert mode: For inserting text
- Command mode: For executing commands
:open <filename>- Open a file:save <filename>- Save the current file:exitor:quitor:q- Exit the editor
In normal mode:
h- Move leftj- Move downk- Move upl- Move righti- Enter insert mode:- Enter command mode
Press Esc to return to normal mode from insert or command mode.
SXCEditor is designed with the following principles in mind:
- Minimal resource usage: No dynamic memory allocation is used, making the editor lightweight and reducing the risk of memory-related errors.
- No global variables: Improves code organization and reduces potential side effects.
- Rust-inspired error handling: Provides a more robust and predictable way of handling errors throughout the application.
- This is a basic implementation and lacks many features found in full-fledged text editors
- Limited error handling and edge case management
- No syntax highlighting or advanced editing features
- Designed for Linux environments only
Contributions to improve sxceditor2 are welcome. Please feel free to submit pull requests or open issues for bugs and feature requests.
MIT License