https://github.com/claby2/clavim
A text editor that I do not intend on using.
https://github.com/claby2/clavim
catch2 cpp sdl2 sdl2-ttf text-editor
Last synced: 8 months ago
JSON representation
A text editor that I do not intend on using.
- Host: GitHub
- URL: https://github.com/claby2/clavim
- Owner: claby2
- License: mit
- Created: 2020-06-22T12:50:04.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-25T14:54:10.000Z (almost 6 years ago)
- Last Synced: 2025-07-11T22:25:17.364Z (9 months ago)
- Topics: catch2, cpp, sdl2, sdl2-ttf, text-editor
- Language: C++
- Homepage:
- Size: 912 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# clavim
A text editor that I do not intend on using.
## Getting Started
### Prerequisites
```
SDL2
SDL2_ttf
```
### Installing
* Install [SDL2](http://libsdl.org/download-2.0.php)
* Install [SDL2_ttf](https://www.libsdl.org/projects/SDL_ttf/)
## Usage
1. Clone and compile:
```
$ git clone https://github.com/claby2/clavim.git
$ cd clavim
$ cd src
$ make compile
```
2. Run clavim by specifying the path to the file you would like to edit (a file will be created if it does not already exist):
```
$ clavim filename.txt
```
### Preferences
Optionally, you can set your own preferences to alter the way clavim looks and behaves in `src/preferences.ini`.
Simply change a certain preference in `src/preferences.ini` and save the file.
After this is done, changes should be reflected the next time clavim is run.
If an invalid value is detected (based on a custom validity check), a warning should be written to standard output.
In this case, any preference with an invalid value would be ignored and the default value would be used instead.
To change the font clavim uses, add the `.ttf` file to the `src` directory and change the `font` preference in `src/preferences.ini` to the name of the font file.
### Keybinds
| Key | Action |
|---------------------------------------------------|-------------------------------------------------------------|
| "Up" (the Up arrow key (navigation keypad)) | Move up one line |
| "Down" (the Down arrow key (navigation keypad)) | Move down one line |
| "Left" (the Left arrow key (navigation keypad)) | Move left one character |
| "Right" (the Right arrow key (navigation keypad)) | Move right one character |
| "Backspace" | Delete character to the left of cursor or remove empty line |
| "Return" (the Enter key (main keyboard)) | Create a new line after current line |
| "Tab" (the Tab key) | Create indentation of four spaces |
| "Ctrl" + "S" | Save changes to file |
| "Ctrl" + "A" | Select all text |
## Testing
Testing requires [Catch2](https://github.com/catchorg/Catch2/).
In the `tests` directory, compile with:
```
$ make compile
```
Run the tests with:
```
$ make test
```