Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Features

Bryan Phelps edited this page Mar 11, 2018 · 22 revisions

Code Completion

completion-demo

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.

Entry point

If a language support 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 supported languages for rich completion are JavaScript & TypeScript. There is no special setup required for JavaScript & TypeScript language completion, but you will get best results by having a jsconfig.json or tsconfig.json at the root of your project.. You can use an empty json file with {} to get the rich completion.

Commands

  • <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

Options

  • 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

fuzzy-finder-demo

Fuzzy Finder is a quick and easy way to switch between files. It's similar in goal to the Ctrl-P plugin, and the built-in functionality editors like VSCode and Atom provide.

Entry point

  • <C-p> - show the Fuzzy Finder menu

Commands

  • <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.

Command Palette

The Command Palette offers another command-line based interface to Oni.

Entry point

  • <C-P>

Commands

  • <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

quick-info-demo

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.

Entry point

Leave the cursor hovering over an identifier.

Options

  • oni.quickInfo.enabled - If set to true, the Quick Info feature is enabled. (Default: true)
  • oni.quickInfo.delay - Delay in milliseconds for the Quick Info window to show. (Default: 500)

Status Bar

status-bar-demo

Oni features a rich status bar, designed as a replacement for vim-powerline and vim-airline.

API

Oni provides a StatusBar API for adding new items to the status bar.

Options

  • statusbar.enabled - If set to true, the status bar feature is enabled. (Default: true)

Users that are coming from Neovim and have highly customized status bars may want to set statusbar.enabled to false, along with setting the oni.loadInitVim to true and oni.useDefaultConfig to false.

Tabs

Oni features a buffer tab bar, like many common IDEs. VIM has its own definition of a "Tab", which is really a set of windows and buffers. By default, the tabs in Oni correspond to open files (buffers). You can override this, and show vim-defined tabs, by setting the tabs.mode setting to tabs

Commands

  • [b and ]b will cycle through buffers, which has the effect of moving through the tabs.

Options

  • tabs.mode - If set to tabs, shows vim tabs. If set to buffers, shows open buffers. If set to native show the native vim tab bar. Finally, if set to hidden, show no tab bar at all. (Default: buffers. Requires Neovim 0.2.1+)

Syntax / Compilation Errors

syntax-error-demo

Entry point

This feature is automatically enabled when Oni detects a filetype supported by one of its Language Server plugins.

Options

  • editor.errors.slideOnFocus (default: true)
    Enables / disables showing details when cursor is over an error.
Clone this wiki locally