-
Notifications
You must be signed in to change notification settings - Fork 298
Features
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 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
ortsconfig.json
at the root of your project.. You can use an empty json file with{}
to get the rich completion.
-
<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 similar 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
.
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.showVimTabs
setting to true
-
[b
and]b
will cycle through buffers, which has the effect of moving through the tabs.
-
tabs.enabled
- If set totrue
, the tabs are visible. (Default:true
) -
tabs.showVimTabs
- If set totrue
, shows vim tabs. Otherwise, shows open buffers. (Default:false
. Requires Neovim 0.2.1+)
This feature is automatically enabled when Oni detects a filetype supported by one of its Language Server plugins.
-
editor.errors.slideOnFocus
(default:true
)
Enables / disables showing details when cursor is over an error.