Just another text editor in C++
There are a lot of different text editor implementations, some of them are good enough, some of them not. Here is yet another text editor written in C++ only for studying purposes (and also for fun!).
- Simple text editor
- Font
- Use character tiles from stored PNG file as a font
- Support monospaced fonts
- Base key bindings
- Scrolling
- Mouse support
- Font
- UI
- Panels for line numbers and cursor position
- Selection using keyborad and mouse
- History for undo/redo
- Context Menu
- Command mode
- Multiple cursors
- Wrap long lines
- Tabs for editing several files simultaneously
- Tests
- gcc or clang or other c++ compiler
- cmake
- pkg-config
- libconfig
- fontconfig
- SDL2
- SDL2_ttf
- Install dependencies:
$ sudo apt-get install gcc cmake libsdl2-dev libsdl2-ttf-dev libconfig++-dev libfontconfig1
- Clone the repo:
git clone https://github.com/countMonteCristo/editor.git
- Build project
mkdir build && cd build
cmake ..
make editor
- Run (from project home folder)
./bin/editor [TEXT_FILE]
Key binding | Action |
---|---|
CTRL+S | Save file |
CTRL+Z | Undo |
CTRL+Y | Redo |
CTRL+C | Copy selected text to clipboard |
CTRL+V | Paste selected text from clipboard |
CTRL+X | Cut selected text to clipboard |
CTRL+A | Select whole text |
↑←↓→ | Navigation |
PgUp | Go up on one screen |
PgDown | Go down on one screen |
CTRL+← | Go to begin of current word |
CTRL+→ | Go to end of current word |
Home | Go to begin of current line |
End | Go to end of current line |
There is a config file editor.conf, where all configurable settings are stored.
Artem Shapovalov: artem_shapovalov@frtk.ru
Project Link: https://github.com/countMonteCristo/editor
- SDL2 wiki
- SDL2_ttf man
- libconfig wiki
- fontconfig wiki
- How to get font by name using fontconfig from stackoverflow