Skip to content

ikozyris/kri

Repository files navigation

kri

A simple, compact and fast text editor using ncurses and a gap buffer, written in C++, in ~1.5k lines of code. More information is available on the wiki.

A C++ file in kri

Install

The 0.8.1 release has been packaged for:

Build

make build
sudo make install

Or use the user-friendly dialog utility wizard.sh which also supports configuring kri

Usage

kri text.txt # open existing file or create if it doesn't exist
kri --help # show help page
kri # ask for filename on save file operation

Keybindings

  • Save: Ctrl-S
  • Exit: Ctrl-X
  • Go to start of line: Ctrl-A
  • Go to end of line: Ctrl-E
  • Open other file Alt-R
  • Delete line: Ctrl-K
  • Go to previous/next word: Shift + Left/Right arrow
  • Enter built-in terminal: Alt-C
  • Show info: Alt-I (also command stats in built-in terminal)
  • Search: command find in builtin terminal, example:
    • find_all_shw token --> search for token in all lines, highlight the occurences and show total count
    • find token --> same as above
    • find_thi_cnt --> only show count in the current line
  • Replace: command replace (parameters in seperate(\n) queries):
    • replace (\n) str1 (\n) str2 --> replace all str1 with str2
    • replace 0 20 (\n) str1 (\n) str2 (\n) --> in range [0,20]
    • replace_thi (\n) str1 (\n) str --> only in current line

How fast is it?

kri is several times faster than any other text editor at reading files, searching, and other operations. See the benchmarks for more.

License

Copyright (C) 2025 ikozyris

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.