Building the Editor
- Install Git
- Install Node
- Install Esy (0.6.2 or above is required, but the latest version is recommened:
npm install -g esy@latest)
- Windows-only: Run
npm install -g windows-build-tools(this installs some build tools that aren't included by default on Windows)
- Install any other system packages required by Oni2 dependencies, as outlined below.
All platforms require
esy, and the ones outlined in the
No additional requirements.
gettext from homebrew:
brew install libtool gettext.
Some Linux distributions may need other packages:
- Ubuntu :
- Fedora/CentOS :
Build and Run
Build the front-end
NOTE: On Windows, you must build from a shell running as administrator. This is a requirement of esy because creating symlinks requires administrator permissions. More info at esy/esy#389.
NOTE: On macOS, if you receive an
error: Too many open files, you can run
ulimit -Sn 4096to increase the file limit. More info at esy/esy#1057
git clone https://github.com/onivim/oni2 cd oni2 esy install esy bootstrap esy build
Install node dependencies
npm install -g node-gyp node install-node-deps.js
NOTE: The non-standard
node install-node-deps.jsstep instead of
npm installis necessary because the script picks up our vendored node binary.
--checkhealthargument validates all dependencies are available and working.
esy run -f --checkhealth
Run Onivim 2
esy '@test' install
esy '@test' build
esy '@test' run
Inline Unit Tests
esy '@test' inline
esy build dune build @check
esy '@bench' install
esy '@bench' build
esy '@bench' run
We use auto formatting tool, you might want to run it before you commit changes
To create a release build, run:
esy '@release' run -f --checkhealth
esy '@release' create
This will create a
_release folder at the root with the application bundle inside.
Once you have a release build created, you can install Oni2 in your
Run the following from the
cp -R _release/Onivim2.app $USER/Applications
If you want to open the editor from terminal with an
oni2 command, you can add Oni2 to the system PATH using a command
item within the app:
- Open Oni2 from launchpad
- Open command palette with
Cmd + Shift + P
System: Add Oni2 to System PATH
If you want to develop, or debug, an extension integration, the following tips may help:
Testing with oni-dev-extenion
There is a development extension in
src/development_extensions/oni-dev-extension which can be used to implement dummy functionality that is often easier to test and integrate with than real extensions.
To add logging, use
console.error - messages on
stderr will be shown in Onivim's log. (Make sure to turn debug logging on, via
ONI2_DEBUG=1 environment variable or the
--debug command-line arg).
Both the oni-dev-extension and any other extension can be instrumented, as they're usually included in non-minified form.
If there's a problem in-between Oni2 and the extension, it can be helpful to build and instrument your own copy of the extension host.
- Navigate to your home directory (ie,
cd ~on Linux / OSX, or
cd /on Windows)
git clone https://github.com/onivim/vscode-exthost
You can use the
yarn watch command too - this is useful for iterating quickly!
You can use the
ONI2_EXTHOST environment variable to override the default extension host with your local extension host:
- `ONI2_EXTHOST=/Users/<your-username>/vscode-exthost esy run -f --debug``
For example, adding the logging here (the
$executeContributedCommand proxy method)
Results in this debug logging:
The extension host protocol is defined in extHost.protocol.ts. Interfaces prefixed with
MainThread refer to messages sent from the extension host to the "main thread", which in our case is Oni2. While interfaces prefixed with
ExtHost refer to messages sent to the extension host.
Building the Documentation Website