A vim plugin for Flow.
- Adds completions to
omnifunc - Checks JavaScript files for type errors on save
- 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
cd ~/.vim/bundle
git clone git://github.com/flowtype/vim-flow.git
Add this to your ~/.vimrc
NeoBundleLazy 'flowtype/vim-flow', {
\ 'autoload': {
\ 'filetypes': 'javascript'
\ }} NeoBundleLazy 'flowtype/vim-flow', {
\ 'autoload': {
\ 'filetypes': 'javascript'
\ },
\ 'build': {
\ 'mac': 'npm install -g flow-bin',
\ 'unix': 'npm install -g flow-bin'
\ }}Unless disabled manually, vim-flow will check JavaScript and JSX files on save.
Triggers a type check for the current file.
Turns automatic checks on save on or off.
Display the type of the variable under the cursor.
If this is set to 1, the |quickfix| window opened when the plugin finds an error
will close automatically.
Default is 0.
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 = 0Default is 1.
Jump to errors after typechecking if set to 1.
Default is 0.
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/flowBy 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 = 0By default timeout will be set to 2 seconds. If you are working on a larger
codebase, you may want to increase this to avoid errors when Flow initializes.
let g:flow#timeout = 4Leave this as default to let the plugin decide on the quickfix window size.
By default a file is always checked when it's saved. If disabled, any type checks are not performed. Use in order to avoid conflicts with other syntax checker reporters like syntastic.