A lightweight text editor built using C++ and SFML (Simple and Fast Multimedia Library). This project demonstrates how to create a basic text editor with features like line numbers, undo/redo functionality, and file handling.
- Basic text editing functionality
- Line numbering
- Undo/Redo operations
- File saving/loading
- Customizable font size (Ctrl+Plus/Ctrl+Minus)
- Tab support
- Multiple file support (Ctrl+Alt+Left/Right to switch)
- Cross-platform (Linux, Windows)
- C++17 compatible compiler
- CMake (>= 3.10)
- SFML 2.5.x (included as static libraries)
- System dependencies:
- OpenGL
- Freetype
- X11 (Linux)
- OpenAL (for audio if needed)
- Install dependencies:
sudo apt-get install build-essential cmake libfreetype6-dev libgl1-mesa-dev \
libx11-dev libxrandr-dev libxcursor-dev libxi-dev libudev-dev
- Clone the repository:
git clone https://github.com/Hassan-ach/text_editor.git
cd text-editor- Build the project:
mkdir build && cd build
cmake ..
make- Install CMake and MinGW
- Clone the repository
- Open CMake GUI and configure the project
- Generate Makefiles and build
Run the executable:
./text-editor| Shortcut | Action |
|---|---|
| Ctrl+Z | Undo |
| Ctrl+Y | Redo |
| Ctrl+Plus | Increase font size |
| Ctrl+Minus | Decrease font size |
| Ctrl+Alt+Left/Right | Switch between files |
| Ctrl+S | Save file |
text-editor/
├── assets/ # Font files and resources
├── libs/ # SFML static libraries
├── src/ # Source code
│ ├── button.cpp # Button implementation
│ ├── file.cpp # File handling
│ ├── Window.cpp # Main window logic
│ └── main.cpp # Entry point
├── include/ # Header files
├── thirdparty/ # Third-party libraries
├── CMakeLists.txt # Build configuration
└── README.md # This file
You can customize the editor by:
- Changing fonts in the
assets/directory - Modifying key bindings in
Window.cpp - Adjusting default font size in
Window.hpp
Contributions are welcome! Please open an issue or submit a pull request.
