Skip to content

Instantly share code, notes, and snippets.

@mhartington
Created December 4, 2020 15:59
Show Gist options
  • Select an option

  • Save mhartington/4428764d2bea38d09e0c0c1093d371b0 to your computer and use it in GitHub Desktop.

Select an option

Save mhartington/4428764d2bea38d09e0c0c1093d371b0 to your computer and use it in GitHub Desktop.

Revisions

  1. mhartington created this gist Dec 4, 2020.
    34 changes: 34 additions & 0 deletions lsp.lua
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,34 @@
    lspconfig.sumneko_lua.setup {
    cmd = {
    string.format(
    "%s/nvim/nvim_lsp/sumneko_lua/lua-language-server/bin/macOS/lua-language-server",
    "-E",
    "%s/nvim/nvim_lsp/sumneko_lua/lua-language-server/main.lua",
    cache_dir,
    cache_dir
    )
    },
    capabilities = capabilities,
    install_dir = string.format("%s/nvim/nvim_lsp/sumneko_lua", cache_dir),
    is_installed = true,
    on_attach = on_attach,
    settings = {
    Lua = {
    diagnostics = {
    enable = true,
    globals = {"vim"}
    },
    filetypes = {"lua"},
    runtime = {
    path = vim.split(package.path, ";"),
    version = "LuaJIT"
    }
    },
    workspace = {
    library = {
    [vim.fn.expand("$VIMRUNTIME/lua")] = true,
    [vim.fn.expand("~/Github/neovim-org/neovim/src/nvim/lua")] = true
    }
    }
    }
    }