Use the Flux LSP with Vim

    Install the Flux plugin

    Both methods require you to add the following to your so that Vim can recognize the .flux file type:

    1. Install flux-lsp-cli with npm

      1. npm i -g @influxdata/flux-lsp-cli
    2. Install vim-lsp

      If it doesn’t exist yet, create a directory called pack/$USER/start/ in your ~/.vim/ and clone vim-lsp into it:

    Install with vim-coc

    1. Install plug-vim

      Install plug-vim, a plugin manager for Vim.

    2. , a code-completion plugin for Vim.

    3. Configure vim-coc

      vim-coc uses a coc-settings.json located in your directory. To run the Flux LSP, add the Flux section under languageserver:

      1. {
      2. "languageserver": {
      3. "flux": {
      4. "command": "flux-lsp",
      5. "filetypes": ["flux"]
      6. }
      7. }
      8. }

      To debug flux-lsp, configure it to log to /tmp/fluxlsp: