nim.nvim


Ⅰ. 插件描述

Nim plugin for NeoVim

Ⅱ. 基本信息

创建日期:  2019-01-19
使用用户:  3
Github星:  69
插件作者:  alaviss

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'alaviss/nim-nvim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'alaviss/nim-nvim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'alaviss/nim-nvim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/alaviss/nim.nvim

Ⅳ. 文档说明

### Nim language plugin for NeoVim

This plugin is still pretty much a work-in-progress.

Test Status

asciicast

Requirements

  • neovim >= 0.3.0 (nimsuggest integration requires TCP byte sockets)
  • nim >= 0.20 ([choosenim] can be used to install this version)

Installation

  • [vim-plug]:

    Plug 'alaviss/nim.nvim'

  • [vim-packager]:

    call packager#add('alaviss/nim.nvim')

Features

  • Semantic highlighting with nimsuggest. Highlight as you type (experimental)
  • "Go to Definition" support using nimsuggest.
  • Autocompletion using nimsuggest.
  • Find references to a symbol.
  • Get signature and documentation of a symbol.
  • Section movements!
  • NEP-1 style indentation!
  • And more...

Auto completion

Install prabirshrestha/asyncomplete.vim and configure it to your liking.

Add this to your configuration file to register the autocomplete source:

au User asyncomplete_setup call asyncomplete#register_source({
    \ 'name': 'nim',
    \ 'whitelist': ['nim'],
    \ 'completor': {opt, ctx -> nim#suggest#sug#GetAllCandidates({start, candidates -> asyncomplete#complete(opt['name'], ctx, start, candidates)})}
    \ })
Support for different completion plugins

While prabirshrestha/asyncomplete.vim is the most tested plugin for use
with nim.nvim, it's worth noting that this plugin was made to support a wide
range of completion plugins.

If your favorite completion plugin supports asynchronous completion sources in
vimscript, the functions in autoload/nim/suggest/sug.vim can be used to
integrate nim.nvim with it. Details on how to do so differs between plugins, so
please refer to your completion plugin's documentations.

Usage

See the project's wiki for more information.

添加新评论