-
Notifications
You must be signed in to change notification settings - Fork 268
Developer Overview
Feel free to join #vis-editor
on freenode to discuss development related issues.
We use a handwritten, POSIX shell compliant configure
script based on the one used by
musl which generates a config.mk
file with all detected compiler flags.
The main Makefile
strives to be POSIX compliant in order to support BSD make
(on Linux this can be tested by installing bmake(1)
).
GNU make specific features
can be used in the GNUmakefile
used to implement the developer oriented make standalone
target.
During development it is recommended to build the project using make debug
which
uses stricter compiler flags and enables debugging.
To make sure your modifications do not break existing functionality, you should
run the test suite by executing make test
.
The test suite is currently located in a separate repository included as a git submodule.
Testing infrastructure for the [low level core data structures] (https://github.com/martanne/vis-test/tree/master/core), [vim compatibility] (https://github.com/martanne/vis-test/tree/master/vim), [sam compatibility] (https://github.com/martanne/vis-test/tree/master/sam), [vis specific features] (https://github.com/martanne/vis-test/tree/master/vis) and the [Lua API] (https://github.com/martanne/vis-test/tree/master/lua) is in place, but lacks proper test cases.
A quick overview over the code structure to get you started:
File(s) | Description |
---|---|
configure |
Handwritten, POSIX shell compliant configure script derived from musl |
Makefile |
Standard make targets, BSD make(1) compatible |
GNUmakefile |
Developer targets (e.g. for standalone builds) |
config.def.h |
definition of default key bindings, will be copied to config.h
|
array.[ch] |
dynamically growing array, can store arbitrarily sized objects |
buffer.[ch] |
dynamically growing buffer used for registers and macros |
ring-buffer.[ch] |
fixed size ring buffer used for the jump list |
map.[ch] |
crit-bit tree based map supporting unique prefix lookups and ordered iteration |
register.[ch] |
register implementation, system clipboard integration via vis-clipboard
|
text.[ch] |
low level text / marks / {un,re}do tree / piece table implementation |
text-motions.[ch] |
movement functions take a file position and return a new one |
text-objects.[ch] |
functions take a file position and return a file range |
text-regex.[ch] |
text regex search functionality, based on libc regex(3)
|
text-regex-tre.c |
text regex search functionality, based on libtre |
text-util.[ch] |
text related utility functions mostly dealing with file ranges |
ui.h |
abstract interface which has to be implemented by ui backends |
ui-curses.[ch] |
a terminal / curses based user interface implementation |
view.[ch] |
ui-independent viewport, shows part of a file, cursor placement, selection handling |
sam.[ch] |
structural regular expression based command language |
vis-cmds.c |
vi(m) : -command implementation, #included from sam.c |
vis-core.h |
internal header file, various structs for core editor primitives |
vis.c |
vi(m) specific editor frontend implementation |
vis.h |
vi(m) specific editor frontend library public API |
vis-lua.[ch] |
Lua bindings, exposing core vis APIs for in process extension |
vis-modes.c |
vi(m) mode switching, enter/leave event handling |
vis-motions.c |
vi(m) cursor motion implementations, uses text-motions.h internally |
vis-operators.c |
vi(m) operator implementation |
vis-prompt.c |
: , / and ? prompt implemented as a regular file/window with custom key bindings |
vis-text-objects.c |
vi(m) text object implementations, uses text-objects.h internally |
main.c |
Key action definitions, program entry point |
lua/ |
Lua runtime files |
lua/visrc.lua |
Lua startup and configuration script |
lua/*.lua |
Lua library for vis, providing parts of the exposed API, syntax highlighting, status bar |
lua/lexers/ |
Lua LPeg based lexers used for syntax highlighting |
lua/themes/ |
Color themes as used by the lexers |
lua/plugins/ |
Non-essential functionality extending core editor primitives |
lua/doc/ |
LDoc generated Lua API documentation |
man/ |
Manual pages in mdoc(7) format |
vis-menu.c |
Interactive menu utility used for file and word completion |
vis-open |
Simple directory browser based on vis-menu
|
vis-complete |
Simple file and word completion wrapper based on vis-menu
|
vis-digraph.c |
Utility to print Unicode characters using mnemonics |
vis-clipboard |
Shell script to abstract system clibpoard handling for X, macOS and Cygwin |
vis-single.sh |
Shell script used to produce a self-extracting executable |