Use the Flux LSP with Vim
- Vim 8+
- npm
Install the Flux plugin
Both methods require you to add the following to your so that Vim can recognize the .flux
file type:
Install
flux-lsp-cli
with npmnpm i -g @influxdata/flux-lsp-cli
Install vim-lsp
If it doesn’t exist yet, create a directory called
pack/$USER/start/
in your~/.vim/
and clonevim-lsp
into it:
Install with vim-coc
Install plug-vim
Install plug-vim, a plugin manager for Vim.
-
, a code-completion plugin for Vim.
Configure vim-coc
vim-coc uses a
coc-settings.json
located in your directory. To run the Flux LSP, add the Flux section underlanguageserver
:{
"languageserver": {
"flux": {
"command": "flux-lsp",
"filetypes": ["flux"]
}
}
}
To debug flux-lsp, configure it to log to
/tmp/fluxlsp
: