ONI is a NeoVim front-end UI with rich IDE-like UI integration points, drawing inspiration from VSCode, Atom, and LightTable
This repository is under active development, and until 1.0 please consider everything unstable.
Check out Releases for the latest binaries, or Build Oni from source.
ONI brings several IDE-like integrations to NeoVim:
- Syntax / Compilation Errors
- Live Evaluation
- Status Bar
Check out Releases for the latest binary.
Windows & OSX releases come with a bundled Neovim release.
- Download the Oni installer for Windows
- Once it is downloaded, run the installer. This will only take a minute.
- By default, Oni is installed under
C:\Program Files (x86)\Oni
for a 64-bit machine.
You can also find install via a zip archive
You may want to add Oni to your
%PATH%
, so that from the console, you can open Oni viaoni
- Download Oni for Mac
- Double-click on the archive to expand
- Drag
Oni.app
to theApplications
folder
If you do not have Neovim, follow the instructions to Install Neovim and ensure the 'nvim' binary is available. Version
0.2.0
is required..
- Download the .deb package (64-bit)
- Install the package with
sudo dpkg -i <file>.deb
A tar.gz is also available.
If you do not have Neovim, follow the instructions to Install Neovim and ensure the 'nvim' binary is available. Version
0.2.0
is required..
- Download the .rpm package
- Install the package with
sudo dnf install <file>.rpm
A tar.gz is also available.
-
Clone the repository:
git clone https://github.com/extr0py/oni.git
-
Install dependencies by running
npm install
from the root -
Build using
npm run build
from the root -
Run
npm link
to register the ONI command -
Run
oni
at the command line
The goal of this project is to provide both the full-fledged VIM experience, with no compromises, while pushing forward to enable new scenarios.
- Modern UX - The VIM experience should not be compromised with poor user experiences that stem from terminal limitations.
- Rich plugin development - using JavaScript, instead of VimL, allowing deep-language integration.
- Cross-platform support - across Windows, OS X, and Linux.
- Batteries included - rich features are available out of the box - minimal setup needed to be productive. TypeScript development is the canonical example, but the hope is that other language providers will be included. Later, an included package manager will make it simple to find and install plugins.
- Performance - no compromises, VIM is fast, and ONI should be fast too.
- Ease Learning Curve - without sacrificing the VIM experience
VIM is an incredible tool for manipulating text at the speed of thought. With a composable, modal command language, it is no wonder that VIM usage is still prevalent today even in the realm of modern editors.
However, going from thought to code has some different challenges than going from thought to text. IDEs today provide several benefits that help to reduce cognitive load when writing code, and that benefit is tremendously important - not only in terms of pure coding efficiency and productivity, but also in making the process of writing code enjoyable and fun.
In my journey of learning VIM and increasing proficiency in other editors, I've found there is always a trade-off - either enjoy the autocompletion and IDE features, and compromise on the experience and muscle memory I've built with VIM, or work in VIM and compromise on the rich language functionality we have in an IDE.
The goal of this project is to give an editor that gives the best of both worlds - the power, speed, and flexibility of using VIM for manipulating text, as well as the rich tooling that comes with an IDE.
Code completion is a commonly requested add-on to Vim, and the most common solutions are to use a plugin like YouCompleteMe, deoplete, or AutoComplPop.
These are all great plugins - but they all have the same fundamental issue that they are bounded by the limitations of the Vim terminal UI, and as such, can never be quite up-to-par with new editors that do not have such limitations. In addition, some require an involved installation process. The goal of code completion in ONI is to be able to break free of these restrictions, and provide the same richness that modern editors like Atom or VSCode provide for completion.
If a language extension is available for a language, then that language service will be queried as you type, and if there are completions available, those will be presented automatically.
Out of the box, the only supported languages for rich completion are JavaScript, TypeScript, and C#. JavaScript and TypeScript Language Service which requires either a tsconfig.json or a jsconfig.json at the root of the project. You can use an empty json file with
{}
to get the rich completion. C# uses the omnisharp service for completion, and will work wherever there is a .csproj file.
<C-n>
- navigate to next entry in the completion menu<C-p>
- navigate to previous entry in the completion menu<Enter>
- selected completion item<Esc>
- close the completion menu
oni.useExternalPopupMenu
- if set to true, will render the Vim popupmenu in the same UI as the language extension menu, so that it has a consistent look and feel. If set to false, will fallback to allow Neovim to render the menu.
Fuzzy Finder is a quick and easy way to switch between files. It's similiar in goal to the Ctrl-P plugin, and the built-in functionality editors like VSCode and Atom provide.
<C-p>
- show the Fuzzy Finder menu
<C-n>
- navigate to next entry in the Fuzzy Finder menu<C-p>
- navigate to previous entry in the Fuzzy Finder menu<Enter>
- select a Fuzzy Finder item<Esc>
- close the Fuzzy Finder menu
By default, Fuzzy Finder uses git ls-files
to get the available files in the directory, but if git is not present, it will fallback to a non-git strategy.
The Fuzzy Finder strategy can be configured by the editor.quickOpen.execCommand
, and must be a shell command that returns a list of files, separated by newlines.
The Command Palette offers another command-line based interface to Oni.
<C-P>
<C-n>
- navigate to next entry in the Command Palette menu<C-p>
- navigate to previous entry in the Command Palette menu<Enter>
- select a Command Palette item<Esc>
- close the Command Palette menu
Currently, the Command Palette includes items from:
- a few commonly used menu items
- NPM package.json
scripts
- Plugin commands
- Launch parameters from the
.oni
folder
Quick Info gives a quick summary of an identifier when the cursor is held on it. JavaScript and TypeScript is supported out of the box.
Leave the cursor hovering over an identifier.
oni.quickInfo.enabled
- If set totrue
, the Quick Info feature is enabled. (Default:true
)oni.quickInfo.delay
- Delay in milliseconds for the Quick Info window to show. (Default:500
)
Oni features a rich status bar, designed as a replacement for vim-powerline and vim-airline.
Oni provides a StatusBar
API for adding new items to the status bar.
oni.statusbar.enabled
- If set totrue
, the status bar feature is enabled. (Default:true
)
Users that are coming from Neovim and have highly customized status bars may want to set
oni.statusbar.enabled
to false, along with setting theoni.loadInitVim
totrue
andoni.useDefaultConfig
tofalse
.
Configuration
JavaScript and TypeScript support is enabled out-of-the-box using the TypeScript Standalone Server. No setup and configuration is necessary, however, you will get better results if you use a tsconfig.json
or a jsconfig.json
to structure your project.
Supported Language features
Completion | Goto Definition | Formatting | Enhanced Syntax Highlighting | Quick Info | Signature Help | Live Evaluation | Debugging |
---|---|---|---|---|---|---|---|
Y | Y | Y | Y | Y | Y | Y | N |
Configuration
C# completion uses the OmniSharp Node Client which provides language capabilities for both .NET and Mono. For it to work correctly, you need to have a valid .csproj
file with any dependent packages (ie, Nuget) installed. The project should also build and compile for the language service to work correctly.
If you are using the .NET Core CLI, make sure to run
dotnet restore
on your project.
Supported Language features
Completion | Goto Definition | Formatting | Enhanced Syntax Highlighting | Quick Info | Signature Help | Live Evaluation | Debugging |
---|---|---|---|---|---|---|---|
Y | Y | N | N | Y | N | N | N |
Known Issues
- On Windows, you must run Oni as an administrator the first time using the C# language service. This is tracked by issue #423.
- On all platforms, the C# language service takes time to start up, especially the first time as it is downloading the appropriate runtime environment. You can open up the developer tools (Help -> Developer Tools) to see the logging from the language service. #424 tracks making this logging more visible.
Configuration
Go language support depends on the go-langserver by SourceGraph, which provides language support for Go. Follow their installation instructions as this language server is not bundled out-of-the-box with Oni.
go-langserver
must be available in your PATH. You can override this by setting thegolang.langServerCommand
configuration value.
Supported Language features
Completion | Goto Definition | Formatting | Enhanced Syntax Highlighting | Quick Info | Signature Help | Live Evaluation | Debugging |
---|---|---|---|---|---|---|---|
N | Y | N | N | Y | N | N | N |
Known Issues
- There is no Windows support at the moment - this is being tracked by sourcegraph/go-langserver#113.
Configuration
Python language support depends on pyls by Palantir, which provides language support for Python. Follow their installation instructions as this language server is not bundled out-of-the-box with Oni.
pyls
must be available in your PATH. You can override this by setting thepython.langServerCommand
configuration value.
Supported Language features
Completion | Goto Definition | Formatting | Enhanced Syntax Highlighting | Quick Info | Signature Help | Live Evaluation | Debugging |
---|---|---|---|---|---|---|---|
Y | Y | N | N | Y | N | N | N |
Known Issues
- Windows support is blocked by this issue: palantir/python-language-server#53.
Configuration
Reason and OCaml support depends on ocaml-language-server by @freebroccolo.
You will need to build the language server locally, as the currently published NPM package is out-of-date:
- Install requirements
git clone https://github.com/freebroccolo/ocaml-language-server.git
cd ocaml-language-server
yarn install
yarn run compile
npm link
NOTE: Once the NPM package is updated with a fix for #22, steps 2-6 can be replaced with
npm install -g ocaml-language-server
.
Supported Language features
Completion | Goto Definition | Formatting | Enhanced Syntax Highlighting | Quick Info | Signature Help | Live Evaluation | Debugging |
---|---|---|---|---|---|---|---|
Y | Y | N | Y | Y | N | N | N |
ONI is configurable via a 'config.js' located in $HOME/.oni
Here's an example config.js:
module.exports = {
"oni.useDefaultConfig": true,
"oni.loadInitVim": true,
"editor.fontSize": "14px",
"editor.fontFamily": "Monaco",
"editor.completions.enabled": true
}
A few interesting configuration options to set:
oni.audio.bellUrl
- Set a custom sound effect for thebell
(:help bell
). The value should be an absolute path to a supported audio file, such as a WAV file.oni.useDefaultConfig
- ONI comes with an opinionated default set of plugins for a predictable out-of-box experience. This will be great for newcomes to ONI or Vim, but for Vim/Neovim veterans, this will likely conflict. Set this tofalse
to avoid loading the default config, and to load settings frominit.vim
instead (If this is false, it impliesoni.loadInitVim
is true)oni.loadInitVim
- This determines whether the user'sinit.vim
is loaded. Use caution when setting this totrue
and settingoni.useDefaultConfig
to true, as there could be conflicts with the default configuration.oni.exclude
- Glob pattern of files to exclude from Fuzzy Finder (Ctrl-P). Defaults to["**/node_modules/**"]
oni.hideMenu
- (default:false
) If true, hide menu bar. When hidden, menu bar can still be displayed withAlt
.editor.fontSize
- Font sizeeditor.fontFamily
- Font familyeditor.fontLigatures
- (default:true
). If true, ligatures are enabled.editor.backgroundImageUrl
- specific a custom background imageeditor.backgroundImageSize
- specific a custom background size (cover, contain)editor.scrollBar.visible
- (default:true
) sets whether the buffer scrollbar is visible
See the Config.ts
file for other interesting values to set.
In VimL, the g:gui_oni
variable will be set to 1
, and can be validated with if exists("g:gui_oni")
in VimL.
ONI offers several rich extensibility points, with the focus being on various UI integrations as well as IDE-like capabilities.
Language extenders given ONI rich integration with languages, offering services like:
- Code Completion
- Quick Info
- Goto Definition
- Formatting
- Live code evaluation
- Unit test integration
- Enhanced syntax highlighting
To see the in-progress API, check out the Oni.d.ts definition file as well as the typescript language plugin, which demonstrates several of these features:
ONI currently supports the setting of a background image as well as background opacity.
TL;DR - Set the
oni.useDefaultConfig
configuration value to false
By default, Oni has an opinionated, prescribed set of plugins, in order to facilitate a predictable out-of-box experience that highlights the additional UI integration points. However, this will likely have conflicts with a Vim/Neovim veteran's finely-honed configuration.
To avoid loading the Oni defaults, and instead use your init.vim
, set this configuration value to false in $HOME/.oni/config.json.
This distribution contains several VIM plugins that enhance the VIM experience.
These are:
As well as some color-schemes:
See roadmap
MIT License. Copyright (c) extropygames
There are a few image and audio assets bundled with Oni - see ASSETS.md for attribution.
Windows and OSX have a bundled version of Neovim, which is covered under Neovim's license
Bundled plugins have their own license terms. These include:
- typescript-vim (
oni/vim/core/typescript.vim
) - targets.vim (
oni/vim/default/bundle/targets.vim
) - vim-commentary (
oni/vim/default/bundle/vim-commentary
) - vim-unimpaired (
oni/vim/default/bundle/vim-unimpaired
) - vim-reasonml (
.vim
files inoni/vim/core/oni-plugin-reasonml
)
Contributions are very much welcome :)
If you're interested in helping out, check out CONTRIBUTING.md for tips and tricks for working with ONI.
Big thanks to the NeoVim team - without their work, this project would not be possible. The deep integration with VIM would not be possible without the incredible work that was done to enable the msgpack-RPC interface. Thanks!
A big THANK YOU to our current monthly sponsors. Your contributions help keep this project alive!
In addition, there are several other great NeoVim front-end UIs here that served as great reference points and learning opportunities.
Also, thanks to our contributors for helping out!
Special thanks to Till Arnold for handing over the oni
NPM package name.