Git Product home page Git Product logo

vim-flow's Introduction

vim-flow

A vim plugin for Flow.

  • Adds completions to omnifunc
  • Checks JavaScript files for type errors on save

Requirements

  • Requires Flow to be installed and available on your path
  • Requires the project to be initialised with flow init
  • Requires JavaScript files to be marked with /* @flow */ or /* @flow weak */ at the top

Installation

cd ~/.vim/bundle
git clone git://github.com/facebook/vim-flow.git

Add this to your ~/.vimrc

  NeoBundleLazy 'facebook/vim-flow', {
            \ 'autoload': {
            \     'filetypes': 'javascript'
            \ }}

With Flow build step, using flow-bin

  NeoBundleLazy 'facebook/vim-flow', {
            \ 'autoload': {
            \     'filetypes': 'javascript'
            \ },
            \ 'build': {
            \     'mac': 'npm install -g flow-bin',
            \     'unix': 'npm install -g flow-bin'
            \ }}

Usage

Unless disabled manually, vim-flow will check JavaScript and JSX files on save.

Commands

FlowMake

Triggers a type check for the current file.

FlowToggle

Turns automatic checks on save on or off.

FlowType

Display the type of the variable under the cursor.

Configuration

g:flow#autoclose

If this is set to 1, the |quickfix| window opened when the plugin finds an error will close automatically.

Default is 0.

g:flow#enable

Typechecking is done automatically on :w if set to 1.

To disable this, set to 0 in your ~/.vimrc, like so:

let g:flow#enable = 0

Default is 1.

g:flow#errjmp

Jump to errors after typechecking if set to 1.

Default is 0.

g:flow#flowpath

Leave this as default to use the flow executable defined on your path. To use a custom flow executable, set this like so:

let g:flow#flowpath = /your/flow-path/flow

g:flow#omnifunc

By default omnifunc will be set to provide omni completion. To disable it (prevent overwriting an existed omnifunc), set this value to 0:

let g:flow#omnifunc = 0

g:flow#qfsize

Leave this as default to let the plugin decide on the quickfix window size.

vim-flow's People

Contributors

gabelevi avatar faceleg avatar fabiomcosta avatar mroch avatar jeffmo avatar michalwarda avatar thoradam avatar dyng avatar clns avatar

Watchers

Joe Lencioni avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.