Texterm Text Editor
A very minimal & simple text editor written in C with only Standard Library.
Syntax highlighting supported for
- C
- JavaScript
- Python
- SQL
Planned Features
- Undo & redo
- Text replace
- Colored bracket pair
- Syntax highlightng for other languages
Learn to build your own text editor: https://viewsourcecode.org/snaptoken/kilo/
Build
make texterm
Usage
texterm
For those who want to read the code
Naming conventions used:
- variable names - snake_case
- function names - snake_case
- structs & enums - CamelCase
Project's Structure
include directory - contains header files
- editor.h - declaration of type
Editor
- highlight.h - declaration of
SyntaxInfo
type & prototypes for functions in highlight.c - languages.h - contains languages' extensions, keywords & stuff
- strbuf.h - declaration of
StringBuffer
type & prototypes for functions in strbuf.c - rows.h - declaration of
EditorRow
type & prototypes for functions in rows.c - winsize.h - function prototype for
get_win_size
in winsize.c
src directory - contains source files (.c)
- main.c - main function, opening file, saving file, rendering ui, etc.
- highlight.c - syntax higlighting stuff (where
EditorRow's hl field
is processed) - strbuf.c - functions for appending & freeing
StringBuffer
- rows.c - row functions (insert/delete char, insert string, etc.)
- winsize.c - for getting window's size