Skip to content

wkz/kg

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2 4 6

Light Weight UTF-8 Terminal Text Editor

kg is a small, fast terminal text editor with pure Emacs keybindings. Suitable for editing system files or quick fixes on remote systems where a full GUI editor is not available.

With syntax highlighting for many languages, multiple buffers, split windows, incremental search, and multi-level undo, kg punches above its weight while staying dependency-free — no curses, just standard VT100 escape sequences.

Features

  • Pure Emacs-style keybindings
  • Syntax highlighting for many programming languages
  • Multiple buffers with shared kill ring
  • Split-window support
  • Incremental search
  • Auto-indent and bracket autocomplete
  • Built-in help screen (C-h)
  • No dependencies (not even curses)
  • Uses standard VT100 escape sequences
  • Graceful terminal resize handling

Usage

kg [-RVh] [file ...]
Option Description
-R Open file(s) read-only
-V Print version and exit
-h Print this help and exit

Multiple files can be opened at once, each in its own buffer. See the man page for more in-depth information as well as the full key binding reference.

Building and Installing

make
sudo make install          # installs to /usr/local/bin and /usr/local/share/man/man1

Override the prefix or use DESTDIR for staged installs:

make install prefix=/usr
make install DESTDIR=/tmp/pkg

To uninstall:

sudo make uninstall

Origin & References

kg is based on kilo by Salvatore Sanfilippo (antirez), the original minimal text editor that demonstrates how to build a functional editor without dependencies in about 1000 lines of C code.

The name "kg" is a nod to "mg" (Micro Emacs), suggesting "kilo-gram" - a minimal implementation with Emacs keybindings.

About

Light Weight UTF-8 Text Editor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C 96.8%
  • Shell 2.4%
  • Makefile 0.8%