It’s really easy to setup flow’s lsp mode on vim using coc.nvim.

coc.nvim is a great language client and intellisense engine for both neovim and vim. It brings almost all feature of vscode’s intellisense engine to vim.

Let’s start.

Syntax highlight

if you don’t have javascript syntax highlight simply install ‍ pangloss/vim-javascript and mxw/vim-jsx for jsx support.

note that you need to set let g:javascript_plugin_flow = 1 for flow integration.

coc.nvim

you can find installation instructions here. it’s fairly easy.

coc-flow

coc.nvim has support for language servers out of the box. you can simply add any language server to coc.nvim without extensions, there is a list of configurations here. but as described in coc.nvim repo extensions are more powerful than raw language servers. you can install coc-flow extension with the command below inside vim or neovim:

:CocInstall coc-flow

Done!

you’re ready to go, open any flow project and use lsp features like code completion and real time diagnostics report.