这是indexloc提供的服务,不要输入任何密码
Skip to content

Ttibsi/iris

Repository files navigation

IRIS

Yet another terminal text editor. Taking 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

asciicast

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)

How to run

Prerequisites: cmake, ninja, Python

I provide a wrapper python script to run all the required commands.

  • To build just the binary, run ./run.py
  • To also run the unit tests: ./run.py test
  • For integration tests using hecate and tmux, run ./run.py test -I

To make a release binary, run the following commands on a Fedora-based system. (Adjust as needed for your local system)

$ sudo dnf install glibc-static libstdc++-static
$ ./run.py --release

How to use

Normal mode

iris is a vim-inspired modal text editor. As with vim, any you'll need to switch to write mode to insert any characters. In read mode, you can perform the following actions (alphabetically ordered):

Key Description
a Go to write mode right of the current character
A Go to write mode at the end of the current line
b Move cursor back one word
dl Delete the current line
dw Delete the current word
f Find next entered char ahead in file
F Find next entered char back in file
g Go to top of file
G Go to bottom of file
h Move cursor left
i Go to write mode left of the current character
j Move cursor down
J Move current line down one
k Move cursor up
K Move current line up one
l Move cursor right
o Enter newline below and go to write mode
O Move cursor right
r Replace char under cursor with next entered character
R Redo
tn Go to next tab
tp Go to previous tab
tt Open new tab
u Undo
w Move cursor forward one word
x Delete character under the cursor
z Center the current line in the screen
; Go to command mode
~ Switch case of char under cursor
[ Go to beginning of paragraph (previous empty line)
] Go to end of paragraph (next empty line)
_ Go to beginning of line
$ Go to end of line

Command mode

Likewise, you can switch to command mode with the semicolon ; key. The following commands in alphabetical order are available:

Command Description
;b <int> Display the buffer at the given index
;lb List all open buffers
;ping pong (for testing purposes)
;e Open a new buffer - specify a filename to open an existing file
;q Quit
;q! Force Quit without saving
;wq Save and quit
;w Save file
;wa Save all files
;qa Quit all

CLI

The below flags are available in the CLI as well. See --help for more info.

Flag Description
-l<int> Open the named file on the given line number
--version Print the current version and exit.

About

Vim-like terminal text editor

Topics

Resources

Stars

Watchers

Forks