CosmicNvim / CosmicNvim

CosmicNvim is a lightweight and opinionated Neovim config for web development, specifically designed to provide a 💫 COSMIC programming experience!

Home Page:https://cosmicnvim.vercel.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to autostart `yamlls`?

JJGadgets opened this issue · comments

I'm using CosmicNvim for editing Kubernetes and generally YAML manifests, so I'd like to have yamlls (or yaml-language-server) working with CosmicNvim.

Here's my very minimal config, however I have to manually run :LspStart on every launch of Nvim for the yamlls LSP to actually do anything.

local config = {
  lsp = {
    format_on_save = true,
    ensure_installed = {
      'yamlls',
    },
    servers = {
      yamlls = true,
    },
  },
  disable_builtin_plugins = {
    'null_ls',
  },
}

return config

How should I approach this?

Silly first question, but did you ensure that you installed the language server globally or via Mason?

@mattleong silly question for silly user haha, it's all good, ask away!

Mason installed it for me via that config snippet I provided above in Cosmic's config.lua file. I didn't do anything otherwise. Should I have installed it differently?

I added a janky autocmd to the end of init.lua after the default Cosmic init.lua code, and that somehow worked to solve the issue but feels bandaid-y, I'll grab it and post it here. Would like to learn the proper way to do things.

(might take a little bit because my laptop where the config was stored had the NVMe controller of the SSD (where /home was in) malfunction since the issue was created :( data's extracted but inconvenient to access)