asyncomplete-flow.vim


Ⅰ. 插件描述

provides javascript autocomplete for asyncomplete.vim via flow

Ⅱ. 基本信息

创建日期:  2017-04-02
使用用户:  7
Github星:  13
插件作者:  Prabir Shrestha

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'prabirshrestha/asyncomplete-flow-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

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

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'prabirshrestha/asyncomplete-flow-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'prabirshrestha/asyncomplete-flow-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/prabirshrestha/asyncomplete-flow.vim

Ⅳ. 文档说明

JavaScript source for asyncomplete.vim via Flow

Provide javascript autocompletion source for asyncomplete.vim via
Flow

Installing

Plug 'prabirshrestha/async.vim'
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/asyncomplete-flow.vim'

async.vim is required.

Registration

au User asyncomplete_setup call asyncomplete#register_source(asyncomplete#sources#flow#get_source_options({
    \ 'name': 'flow',
    \ 'whitelist': ['javascript'],
    \ 'completor': function('asyncomplete#sources#flow#completor'),
    \ 'config': {
    \    " Resolves 'flow' in the closest node_modules/.bin directory (in case
    \    " flow is installed via 'npm install flow-bin' locally). Falls back to
    \    " 'flowbin_path' (see below) if can't find it.
    \    'prefer_local': 1,
    \    " Path to 'flow' executable.
    \    'flowbin_path': expand('~/bin/flow'),
    \    " Displays additional typeinfo exposed by flow, if any is provided. 
    \    " Defaults to 0.
    \    'show_typeinfo': 1
    \  },
    \ }))

Note: config is optional. flowbin_path defaults to flow
i.e., flow binary should exist in the PATH if config is not specified.

Also make sure your javascript project is correctly initialized with .flowconfig.

添加新评论