MyTE (rhymes with byte) is My Text Editor. It is a small graphical text editor written in C. It was originally created as a learning exercise and was inspired by ded.
MyTE is currently a work in progress and missing some crucial features (clipboard manipulation, multiple buffers/panes/tabs). Despite this, MyTE still has some advanced features that some more basic text editors lack:
- Syntax highlighting support for various languages (and a straight-forward means of adding more)
- Rudimentary user theming/color schemes (also pretty straight-forward to create)
- User configuration/theme hot reloading
- Smooth animations
- Mouse controls
- Text selection
MyTE currently has two modes - an editor mode and a file browsing mode. The editor mode is default and works mostly how one would expect. File browsing mode presents a simple file browser in the vein of vim or emacs.
- Editor Mode
- typing inserts characters into the buffer
- arrow keys move the cursor around the buffer
CTRL + left/right
move the cursor back/forward one whole word.CTRL + BACKSPACE/DELETE
backspaces/deletes a whole word.CTRL + O
opens file browsing modeCTRL + S
saves the current file to diskCTRL + SHIFT + S
opens a save dialog to save a new file.MOUSE LEFT
moves to the cursor to the position you clicked in the bufferMOUSE SCROLL
scrolls the bufferSHIFT + arrows/mouse
selects text
- File Browsing Mode
up/down
moves the selection up and down the directory listing.ENTER
opens the selected directory/fileESCAPE
closes the file browser and goes back to editor mode.
- Special global shortcuts
F5
completely hot reloads the application (user configs, themes, and the current file)
All configuration - including user settings, highlighting rules, and colorschemes - are done via TOML files. These are loaded into the program at startup and can be changed and hot-reloaded while the program is running. The formats for them are pretty self-explanatory and it should be easy to edit them.
MyTE currently only builds on Linux and has 3 dependencies.
To build MyTE just clone this repo, install the dependencies via your package manager (glew glfw3 freetype2
), and run make all
. The program should be built in the newly created build
folder.
- easy-renderer: a basic OpenGL renderer by PixelRifts. Used as the basis for the renderer for this project.
- tomlc99: a TOML file loading library written in C by cktan. Used for loading syntax highlighting configs.
- TOML v1.0.0 standard: the TOML standard for the tomlc99 library.
- ded: a text editor by tsoding. An inspiration for this project; YouTube Playlist
- Pico: editor by John Lipstate. Helpful during the starting phases of this project; YouTube Playlist; Video on Ropes vs Gap Buffers
- Programming a text editor from scratch: by Bitwise; Part 2; Part 3: helpful during the starting phases of this project.
- Space Duck Color Theme: the colorscheme for this editor.
- Gruvbox: another colorscheme used in this editor.
- Iosevka: the default font for this editor.
- GNU Free Mono: another font used in this editor.