local configs = require 'nvim_lsp/configs' local util = require 'nvim_lsp/util' configs.nimls = { default_config = { cmd = {"nimlsp",}; filetypes = {'nim'}; root_dir = function(fname) return util.find_git_ancestor(fname) or vim.loop.os_homedir() end; }; docs = { vscode = "kosz78.nim"; description = [[ https://github.com/PMunch/nimlsp `nimlsp` can be installed via `:LspInstall nimls` or by yourself the `nimble` package manager: ```sh nimble install nimlsp ``` ]]; default_config = { root_dir = [[root_pattern(".git") or os_homedir]]; }; }; } configs.nimls.install = function() local script = [[ nimble install nimlsp ]] util.sh(script, vim.loop.os_homedir()) end configs.nimls.install_info = function() local script = [[ nimlsp --version ]] local status = pcall(vim.fn.system, script) return { is_installed = status and vim.v.shell_error == 0; } end