A vi-like editor based on Plan 9's structural regular expressions
  • C 52.5%
  • Lua 45.2%
  • Makefile 0.8%
  • Shell 0.8%
  • Roff 0.6%
Find a file
Randy Palamar 254329d9f4
core: allow cells to hold up to 6 bytes
Single unicode codepoints can only contain 4 bytes of data.
However, someone thought it was a good idea make it so that
multiple codepoints can get combined at text processing stage so
that they can make single visible glyph. This is especially
prevelant with emoji. Previously vis had a 16 byte per cell buffer
for these multi codepoint characters. This was incredibly wasteful
since the vast majority of text in a code editor is 1 byte ASCII.
Furthermore 16 bytes is not even enough, there are a number of
emoji combo characters that take up much more space than that.

I plan on doing a further refactor to allow more general handling
of those cases while keeping the common case effiecent. But for
now simply allowing for up to 6 bytes per cell by bit packing the
other data is suffiecent to partially restore the previous
functionality. See https://github.com/martanne/vis/issues/1387 for
more details.
2026-08-19 20:59:07 -07:00
.builds ci: drop unnecessary libtermkey install 2026-06-03 07:27:28 -06:00
.github ci: drop unnecessary libtermkey install 2026-06-03 07:27:28 -06:00
doc doc/Makefile: add an empty clean target... 2025-12-02 23:36:56 +01:00
external termkey: remove support for >4 byte utf-8; use our internal utf-8 conversion 2026-06-06 12:08:37 -06:00
lua ui: pack cell styles in 8 bytes; cleanup handling of unset colors 2026-06-27 06:36:40 -06:00
man man/vis: dot-register not mentioned in man page 2026-07-08 11:26:47 +02:00
test test/util: silence build warnings with vendored termkey 2026-08-17 09:37:27 +02:00
.codecov.yml ci: disable codecov commit status updates 2020-02-25 12:30:54 +01:00
.editorconfig add a basic .editorconfig file 2022-11-29 21:37:51 +01:00
.gitignore make vis a single file build 2025-12-16 11:28:44 -07:00
.luacheckrc build: add luacheck make target 2017-03-03 23:04:27 +01:00
buffer.c buffer: make 0 termination a required caller request 2026-06-12 14:52:29 -06:00
buffer.h buffer: make 0 termination a required caller request 2026-06-12 14:52:29 -06:00
CHANGELOG.md doc: fix Markdown in CHANGELOG.md 2025-06-13 08:19:26 -06:00
config.def.h implement case switching as key action 2026-08-10 09:25:18 +02:00
configure configure: fix tryflag in -Wno- case; add -Wno-override-init (GCC) 2026-07-12 16:44:04 -07:00
Dockerfile build: build with lua 5.5 in docker 2026-06-10 11:21:21 +02:00
event-basic.c move all standard library includes into util.h 2025-12-22 09:13:47 -07:00
GNUmakefile build: remove support for system termkey 2026-06-03 07:27:27 -06:00
LICENSE replace oversized libutf with smaller version 2026-01-06 16:52:56 -07:00
main.c main: ka_selections_case: precompute max length for wide char buffer 2026-08-15 19:13:33 -07:00
Makefile lua: add vis.API to make feature checks easier 2026-06-26 08:56:52 -06:00
map.c move all standard library includes into util.h 2025-12-22 09:13:47 -07:00
map.h delete functions which were exposed as unused 2025-12-16 11:28:44 -07:00
README.md build: remove support for system termkey 2026-06-03 07:27:27 -06:00
sam.c buffer: make 0 termination a required caller request 2026-06-12 14:52:29 -06:00
sam.h mark all functions in headers with VIS_EXPORT or VIS_INTERNAL 2025-12-16 11:28:44 -07:00
text-common.c vis: add basic Debug Info section to :help 2026-06-05 13:42:09 -06:00
text-io.c core: cleanup vis_file_new 2026-06-13 10:44:24 -06:00
text-iterator.c core: replace memchr with internal memory_scan_forward 2026-05-23 10:30:57 -06:00
text-motions.c core: replace memchr with internal memory_scan_forward 2026-05-23 10:30:57 -06:00
text-objects.c text: pass Fileranges by value where they are meant to be const 2026-05-09 14:30:16 -06:00
text-regex-tre.c text: merge text headers into text.h 2026-03-01 07:34:13 -07:00
text-regex.c core: replace memchr with internal memory_scan_forward 2026-05-23 10:30:57 -06:00
text-util.c text: pass Fileranges by value where they are meant to be const 2026-05-09 14:30:16 -06:00
text.c text: don't add 0 block to text block array 2026-07-05 08:15:21 -07:00
text.h core: cleanup vis_file_new 2026-06-13 10:44:24 -06:00
ui-terminal-curses.c ui: split cell style and cell data into separate arrays 2026-08-15 19:13:27 -07:00
ui-terminal-vt100.c ui: vt100: drop extra memset call 2026-08-15 19:42:55 -07:00
ui-terminal.c core: allow cells to hold up to 6 bytes 2026-08-19 20:59:07 -07:00
ui.h core: allow cells to hold up to 6 bytes 2026-08-19 20:59:07 -07:00
util.c split up calculation, fix issue on 32bit systems 2026-08-18 21:33:46 -07:00
util.h main: ka_selections_case: precompute max length for wide char buffer 2026-08-15 19:13:33 -07:00
view.c core: allow cells to hold up to 6 bytes 2026-08-19 20:59:07 -07:00
view.h core: pack cell data into 16 bytes 2026-07-01 06:16:50 -06:00
vis-clipboard vis-clipboard: add support for termux 2026-04-24 05:54:10 -06:00
vis-cmds.c core: cleanup vis_file_new 2026-06-13 10:44:24 -06:00
vis-complete scripts: make option listing more consistent 2025-01-06 07:38:01 -07:00
vis-core.h ui: remove per window styles 2026-06-27 06:36:40 -06:00
vis-digraph.c vis: fix 2 typoes 2026-05-06 09:32:51 +02:00
vis-lua.c ui: split cell style and cell data into separate arrays 2026-08-15 19:13:27 -07:00
vis-lua.h vis-lua: use str8 for path adding 2026-05-09 17:46:35 -06:00
vis-marks.c text: pass Fileranges by value where they are meant to be const 2026-05-09 14:30:16 -06:00
vis-menu.c vis-menu: replace strtoul with internal procedure 2026-05-23 10:30:24 -06:00
vis-modes.c text: merge text headers into text.h 2026-03-01 07:34:13 -07:00
vis-motions.c text: pass Fileranges by value where they are meant to be const 2026-05-09 14:30:16 -06:00
vis-open scripts: make option listing more consistent 2025-01-06 07:38:01 -07:00
vis-operators.c buffer: make 0 termination a required caller request 2026-06-12 14:52:29 -06:00
vis-options.c vis: store escape delay internally 2026-05-24 08:06:50 -06:00
vis-prompt.c ui: simplify update of cursor position 2026-06-05 06:27:31 -06:00
vis-registers.c buffer: make 0 termination a required caller request 2026-06-12 14:52:29 -06:00
vis-single.c vis-single: fix implicit declaration of 'mkdtemp' and 'setenv' 2025-12-31 05:28:03 -07:00
vis-subprocess.c move all standard library includes into util.h 2025-12-22 09:13:47 -07:00
vis-subprocess.h move all standard library includes into util.h 2025-12-22 09:13:47 -07:00
vis-text-objects.c text: merge text headers into text.h 2026-03-01 07:34:13 -07:00
vis.c vis.c: macro_replay_internal: cleanup unnecessary input writes 2026-08-16 17:31:02 -07:00
vis.h ui: pack cell styles in 8 bytes; cleanup handling of unset colors 2026-06-27 06:36:40 -06:00

Vis - Combining Modal Editing with Structural Regular Expressions

Development discussion builds.sr.ht status Coverity Scan Build Status codecov Documentation Status #vis-editor on libera

Vis aims to be a modern, legacy-free, simple yet efficient editor, combining the strengths of both vi(m) and sam.

It extends vi's modal editing with built-in support for multiple cursors/selections and combines it with sam's structural regular expression based command language.

A universal editor, it has decent Unicode support and should cope with arbitrary files, including large, binary or single-line ones.

Efficient syntax highlighting is provided using Parsing Expression Grammars, which can be conveniently expressed using Lua in the form of LPeg.

The editor core is written in a reasonable amount of clean (your mileage may vary), modern and legacy-free C code, enabling it to run in resource-constrained environments. The implementation should be easy to hack on and encourages experimentation. There is also a Lua API for in-process extensions.

Vis strives to be simple and focuses on its core task: efficient text management. Clipboard and digraph handling as well as a fuzzy file open dialog are all provided by independent utilities. There exist plans to use a client/server architecture, delegating window management to your windowing system or favorite terminal multiplexer.

The intention is not to be bug-for-bug compatible with vi(m). Instead, we aim to provide more powerful editing features based on an elegant design and clean implementation.

vis demo

Build instructions

In order to build vis you will need a C99 compiler, a POSIX.1-2008 compatible environment as well as:

  • curses (recommended)
  • Lua >= 5.2 (optional)
  • LPeg >= 0.12 (optional runtime dependency required for syntax highlighting)
  • TRE (optional for more memory efficient regex search)

Assuming these dependencies are met, execute:

$ ./configure && make && sudo make install

By default the configure script will try to auto detect support for Lua using pkg-config(1). See configure --help for a list of supported options. You can also manually tweak the generated config.mk file.

Or simply use one of the distribution provided packages.

Documentation

End user documentation can be found in the vis(1) manual page and the Wiki. Read the FAQ for common questions. Learn about some differences compared to sam(1) and vim(1), respectively.

C API as well as Lua API documentation is also available.

Non Goals

Some features which will not be implemented:

  • tabs / multiple workspaces / advanced window management
  • file and directory browser
  • support for file archives (tar, zip, ...)
  • support for network protocols (ftp, http, ssh ...)
  • encryption
  • compression
  • GUIs (neither x11, motif, gtk, win32 ...) although the codebase should make it easy to add them
  • VimL
  • right-to-left text
  • ex mode, we have more elegant structural regexp
  • diff mode
  • vimgrep
  • internal spell checker
  • lots of compile time configurable features / #ifdef mess

How to help?

There are plenty of ways to contribute, below are a few ideas:

Checkout the Developer Overview to get started and do not hesitate to ask question in the #vis-editor IRC channel on libera (join via your browser).