Skip to content

Ttibsi/iris

Repository files navigation

IRIS

Yet another terminal text editor. Taking a ton of inspiration from vim and friends as well as other popular text editors (nano, emacs, VScode) to a lesser extent. This only currently is designed to work in macOS and Linux.

All PRs are welcome

Why "Iris"?

  • it's an easy combination of letters to type on an ascii keyboard without being uncomfortable on the fingers
  • The Iris is part of the eye, the "window to the soul" -- your text editor is usually the window into your code
  • Iris is the greek goddess of the rainbow, represents a bridge between different aspects, much like your editor bridges text and code. (Thanks ChatGPT)

CONTROLS

Just like vim, Iris has a few modes: read, write, and command. You can switch to write mode by pressing i, then back to read with the esc key. Likewise, you can switch to command with the ; (semicolon) key.

Read mode

Key Description
h Move cursor left
j Move cursor down
k Move cursor up
l Move cursor right
[ Move cursor to top of file
] Move cursor to bottom of file
{ Move to previous empty line
} Move to next empty line
; Go to command mode
i Go to insert mode left of the current character
a Go to insert mode right of the current character
A Go to insert mode at the end of the current line
w Move cursor forward one word
b Move cursor back one word
z Center the current line in the screen
x Delete character under the cursor
dl Delete entire line
dw Delete current word (between whitespace)
da Delete from beginning of line to cursor
de Delete to end of line
f Find string ahead in file
r Replace until next whitespace

Command mode

All commands start with a semicolon

Command Description
;w Save current file
;w foo.txt Save current file to foo.txt
;q Quit
;q! Quit without saving
;wq Write and quit
;1 Jump to the given line number

HOW TO RUN

Prerequisites: cmake

cmake -S . -B build/ && cmake --build build/
./build/src/iris

Add the -DRUN-TESTS=OFF flag to cmake to disable the tests being included.

To run unit tests, simply run ctest in the build/directory.

ctest --test-dir build/tests

Releases

No releases published

Languages