wi

command module
v0.0.0-...-b1976e4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

README

wi - right after vi

The project was put on ice because it failed to attract interest and was mostly done for research purpose. Please look at xi which has similar design goals and is written in Rust instead.

Experimental, do not look into.

Experimental, do not look into.

Experimental, do not look into.

Bringing text based editor technology past 1200 bauds.

GoDoc Build Status Coverage Status

Features

  • Editor for the 19.2kbps connected world.
  • Out of process plugins for today's 2Mb RAM systems.
  • Go for both program and macros.
  • Fully asynchronous processing. No hang due to I/O ever.
  • Extremely extensible. Everything can be overriden.
  • i18n ready.
  • Auto-generated help.
  • go get (Go's native distribution mechanism) for both the editor and plugins.
  • Integrated debugging and good test coverage.

Setup

Prerequisites
Installation or updating
go get -u github.com/wi-ed/wi
Installing or updating a plugin

Plugins are standalone executables or source files that are loaded by wi. wi discovers plugins on startup by looking for wi-plugin-* / wi-plugin-*.exe and wi-plugin-*.go in the same directory ($GOPATH/bin) as the wi executable.

go get -u github.com/someone/wi-plugin-awesome

*.go files are sent to go run for on-the-fly compilation at the cost of slower startup time so there's no native updating support.

Vision

  • No I/O done in the UI thread. UI must always be responsive even on a I/O saturated system.
  • Very extensible editor with sane default settings.
    • Historical reasons are not good reasons.
  • Out of process plugins. If a web browser can render web pages out of process, an editor can do the same.
  • Plugins written in the same language as the editor itself. No need to learn yet another language (vimscript? lisp? python? javascript?).
    • The only text editor with statically compiled macros!
  • Use instrinsic Go distribution mechanism to distribute plugins. Stable release is go1 branch.
  • Broad OS support, including seamless Windows support.
  • Unicode used internally.

Contributing

First make sure test-only dependencies are installed with the flag -t then fetch and install pre-commit-go:

cd github.com/<you>/wi
go get -t ./...
go get github.com/maruel/pre-commit-go
pre-commit-go

Once done, you can send pull requests.

A CLA (form to be determined) may eventually be required for contribution.

Documentation

Overview

Package wi brings text based editor technology past 1200 bauds.

This package contains only the non-unit-testable part of the editor.

  • editor/ contains the editor logic itself. It is terminal-agnostic.
  • wicore/ contains the plugin glue. This module is shared by both the editor itself and any wi-plugin-* for RPC.
  • wi-plugin-sample/ is a sample plugin executable to `go install`. It is both meant as a reusable skeleton to write a new plugin and as a way to ensure the plugin system works.

This project supports 'Debug' and 'Release' builds. The Release build is the default, the Debug build has to be built explicitly. Use the following command to generate a Debug build:

go build -tags debug

A debug build has additional functionalities:

  • Logs to wi.log.
  • Has additional flags, for example it can create cpu profiles via -cpuprofile and optionally serve profiling data over a builtin web server at http://localhost:6060/debug/pprof via net/http/pprof with flag -http=:6060.
  • Has additional commands defined, see editor/debug.go for the list.

Run "wi -h" for help about the additional flags after doing a Debug build.

See README.md for more details.

Directories

Path Synopsis
Package editor contains the UI toolkit agnostic unit-testable part of the wi editor.
Package editor contains the UI toolkit agnostic unit-testable part of the wi editor.
Package internal contains the symbols that need to be exported so it can be used in RPC via net/rpc but is not meant to be an API for end user plugins.
Package internal contains the symbols that need to be exported so it can be used in RPC via net/rpc but is not meant to be an API for end user plugins.
tools
wi-event-generator
Generates editor/event_registry.go from wicore/events.go.
Generates editor/event_registry.go from wicore/events.go.
wi-event-generator/parse
Package parse contains simple go parser code to be used to generate code from interfaces.
Package parse contains simple go parser code to be used to generate code from interfaces.
wi-plugin-sample is an example plugin for wi.
wi-plugin-sample is an example plugin for wi.
Package wicore implements all the interfaces to be shared between the wi editor process and its plugins.
Package wicore implements all the interfaces to be shared between the wi editor process and its plugins.
colors
Package colors declare constants and functions to simplify color management.
Package colors declare constants and functions to simplify color management.
key
Package key implements generic key definition.
Package key implements generic key definition.
lang
Package lang handles localization of language UI.
Package lang handles localization of language UI.
plugin
Package plugin implements the common code to implement a wi plugin.
Package plugin implements the common code to implement a wi plugin.
raster
Package raster implements text buffering.
Package raster implements text buffering.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL