{"id":13409143,"url":"https://github.com/neovim/nvim-lspconfig","last_synced_at":"2025-05-13T18:04:54.423Z","repository":{"id":37001174,"uuid":"221512407","full_name":"neovim/nvim-lspconfig","owner":"neovim","description":"Quickstart configs for Nvim LSP","archived":false,"fork":false,"pushed_at":"2025-05-04T21:11:27.000Z","size":5894,"stargazers_count":11819,"open_issues_count":22,"forks_count":2196,"subscribers_count":78,"default_branch":"master","last_synced_at":"2025-05-06T17:13:45.693Z","etag":null,"topics":["language-server","language-server-protocol","lsp","neovim","nvim","plugin","vim"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neovim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-11-13T17:12:28.000Z","updated_at":"2025-05-06T14:40:07.000Z","dependencies_parsed_at":"2024-01-22T22:19:24.791Z","dependency_job_id":"f1ac4e4e-a3fe-474e-9839-3304768cd7ba","html_url":"https://github.com/neovim/nvim-lspconfig","commit_stats":{"total_commits":2816,"total_committers":756,"mean_commits":"3.7248677248677247","dds":0.8068181818181819,"last_synced_commit":"0d62a16429dba5fded93a076237079b81527e8f3"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neovim%2Fnvim-lspconfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neovim%2Fnvim-lspconfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neovim%2Fnvim-lspconfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neovim%2Fnvim-lspconfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neovim","download_url":"https://codeload.github.com/neovim/nvim-lspconfig/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253502802,"owners_count":21918508,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["language-server","language-server-protocol","lsp","neovim","nvim","plugin","vim"],"created_at":"2024-07-30T20:00:58.326Z","updated_at":"2025-05-13T18:04:54.410Z","avatar_url":"https://github.com/neovim.png","language":"Lua","funding_links":[],"categories":["LSP","Lua","LUA","neovim","Awesome Tools","Plugins"],"sub_categories":["(requires Neovim 0.5)","IDEs"],"readme":"# nvim-lspconfig\n\nnvim-lspconfig is a \"data only\" repo, providing basic, default [Nvim LSP client](https://neovim.io/doc/user/lsp.html)\nconfigurations for various LSP servers. View [all configs](doc/configs.md) or `:help lspconfig-all` from Nvim.\n\n## Important ⚠️\n\n* These configs are **best-effort and supported by the community (you).** See [contributions](#contributions).\n* Ask questions on [GitHub Discussions](https://github.com/neovim/neovim/discussions), not the issue tracker.\n* If you found a bug in Nvim LSP (`:help lsp`), [report it to Neovim core](https://github.com/neovim/neovim/issues/new?assignees=\u0026labels=bug%2Clsp\u0026template=lsp_bug_report.yml).\n    * **Do not** report it here. Only configuration data lives here.\n* This repo only provides *configurations*. Its programmatic API is deprecated and must not be used externally.\n    * The \"framework\" parts (*not* the configs) of nvim-lspconfig [will be upstreamed to Nvim core](https://github.com/neovim/neovim/issues/28479).\n\n## Install\n\n[![LuaRocks](https://img.shields.io/luarocks/v/neovim/nvim-lspconfig?logo=lua\u0026color=purple)](https://luarocks.org/modules/neovim/nvim-lspconfig)\n\n* Requires Nvim 0.10 above. Update Nvim and nvim-lspconfig before reporting an issue.\n* Install nvim-lspconfig using Vim's \"packages\" feature:\n  ```\n  git clone https://github.com/neovim/nvim-lspconfig ~/.config/nvim/pack/nvim/start/nvim-lspconfig\n  ```\n* Or use a 3rd-party plugin manager (consult the documentation for your plugin manager).\n\n## Quickstart\n\n1. Install a language server, e.g. [pyright](doc/configs.md#pyright)\n   ```bash\n   npm i -g pyright\n   ```\n2. Add the language server setup to your init.lua.\n    - Nvim 0.11+ (see [vim.lsp.config](#vimlspconfig))\n      ```lua\n      vim.lsp.enable('pyright')\n      ```\n    - Nvim 0.10 (legacy, **not supported**)\n      ```lua\n      require'lspconfig'.pyright.setup{}\n      ```\n3. Ensure your project/workspace contains a root marker as specified in `:help lspconfig-all`.\n4. Open a code file in Nvim. LSP will attach and provide diagnostics.\n   ```\n   nvim main.py\n   ```\n5. Run `:checkhealth lsp` to see the status or to troubleshoot.\n\nRead `:help lspconfig` for details. Read `:help lspconfig-all` for the full list of server-specific details.\nFor servers not on your `$PATH` (e.g., `jdtls`, `elixirls`), you must manually set the `cmd` parameter, see [vim.lsp.config](#vimlspconfig).\n\n## Configuration\n\nNvim sets some default options and mappings when a buffer attaches to LSP (see [`:help lsp-config`][lsp-config]). In particular:\n\n* [`'tagfunc'`][tagfunc]\n    - Enables \"go to definition\" capabilities using [`\u003cC-]\u003e`][tagjump] and other [tag commands][tag-commands].\n* [`'omnifunc'`][omnifunc]\n    - Enables (manual) omni mode completion with `\u003cC-X\u003e\u003cC-O\u003e` in Insert mode.\n* [`'formatexpr'`][formatexpr]\n    - Enables LSP formatting with [`gq`][gq].\n* `K` maps to [`vim.lsp.buf.hover()`][vim.lsp.buf.hover] in Normal mode.\n* `[d` and `]d` map to `vim.diagnostic.jump()` with `{count=-1}` and\n  `vim.diagnostic.jump()` with `{count=1}`, respectively.\n* `\u003cC-W\u003ed` maps to `vim.diagnostic.open_float()`.\n\n[lsp-config]: https://neovim.io/doc/user/lsp.html#lsp-config\n[tagfunc]: https://neovim.io/doc/user/tagsrch.html#tag-function\n[omnifunc]: https://neovim.io/doc/user/options.html#'omnifunc'\n[formatexpr]: https://neovim.io/doc/user/options.html#'formatexpr'\n[gq]: https://neovim.io/doc/user/change.html#gq\n[vim.lsp.buf.hover]: https://neovim.io/doc/user/lsp.html#vim.lsp.buf.hover()\n[tagjump]: https://neovim.io/doc/user/tagsrch.html#CTRL-%5D\n[tag-commands]: https://neovim.io/doc/user/tagsrch.html#tag-commands\n\nFurther customization can be achieved using the [`LspAttach`][LspAttach] autocommand event.\nThe [`LspDetach`][LspAttach] autocommand event can be used to \"cleanup\" mappings if a buffer becomes detached from an LSP server.\nSee [`:h LspAttach`][LspAttach] and [`:h LspDetach`][LspDetach] for details and examples.\nSee [`:h lsp-buf`][lsp-buf] for details on other LSP functions.\n\n[LspAttach]: https://neovim.io/doc/user/lsp.html#LspAttach\n[LspDetach]: https://neovim.io/doc/user/lsp.html#LspDetach\n[lsp-buf]: https://neovim.io/doc/user/lsp.html#lsp-buf\n\nExtra settings can be specified for each LSP server:\n\n- Nvim 0.11+ (see [vim.lsp.config](#vimlspconfig))\n  ```lua\n  vim.lsp.config('rust_analyzer', {\n    -- Server-specific settings. See `:help lsp-quickstart`\n    settings = {\n      ['rust-analyzer'] = {},\n    },\n  })\n  ```\n- Nvim 0.10 (legacy, **not supported**)\n  ```lua\n  local lspconfig = require('lspconfig')\n  lspconfig.rust_analyzer.setup {\n    -- Server-specific settings. See `:help lspconfig-setup`\n    settings = {\n      ['rust-analyzer'] = {},\n    },\n  }\n  ```\n\n## vim.lsp.config\n\n`nvim-lspconfig` includes configurations compatible with `vim.lsp` under [`lsp/`](./lsp/), so servers can be enabled (auto-activated when a filetype is opened) with:\n\n```lua\nvim.lsp.enable('pyright')\n```\n\nand configured with:\n\n```lua\nvim.lsp.config('pyright', {\n  cmd = { … },\n})\n```\n\nwhich extends the configuration under [`lsp/`](./lsp/). For further information see [`:help lsp-config`][lsp-config].\n\n\u003e [!WARNING]\n\u003e Some servers are [currently missing](https://github.com/neovim/nvim-lspconfig/issues/3705).\n\n## Troubleshooting\n\nThe most common reasons a language server does not start or attach are:\n\n1. Language server is not installed. nvim-lspconfig does not install language servers for you. You should be able to run the `cmd` defined in each server's Lua module from the command line and see that the language server starts. If the `cmd` is an executable name instead of an absolute path to the executable, ensure it is on your path.\n2. Missing filetype plugins. Certain languages are not detected by Vim/Nvim because they have not yet been added to the filetype detection system. Ensure `:set filetype?` shows the filetype and not an empty value.\n3. Not triggering root detection. **Some** language servers require a \"workspace\", which is found by looking for an ancestor directory that contains a \"root marker\". The most common root marker is `.git/`, but each config defines other \"root marker\" names. Root markers/directories are listed in [doc/configs.md](doc/configs.md).\n\n## Bug reports\n\nIf you found a bug with LSP functionality, [report it to Neovim core](https://github.com/neovim/neovim/issues/new?assignees=\u0026labels=bug%2Clsp\u0026template=lsp_bug_report.yml).\n\nBefore reporting a bug, check your logs and the output of `:LspInfo`. Add the following to your init.vim to enable logging:\n\n```lua\nvim.lsp.set_log_level(\"debug\")\n```\n\nAttempt to run the language server, and open the log with:\n\n```\n:LspLog\n```\nMost of the time, the reason for failure is present in the logs.\n\n## Commands\n\n* `:LspInfo` (alias to `:checkhealth vim.lsp`) shows the status of active and configured language servers.\n* `:LspStart \u003cconfig_name\u003e` Start the requested server name. Will only successfully start if the command detects a root directory matching the current config.\n* `:LspStop [\u003cclient_id_or_name\u003e ...]` Stops the given server(s). Defaults to stopping all servers active on the current buffer. To force stop add `++force`\n* `:LspRestart [\u003cclient_id_or_name\u003e ...]` Restarts the given client(s), and attempts to reattach to all previously attached buffers.\n\n## Contributions\n\nIf a language server is missing from [configs.md](doc/configs.md), contributing\na new configuration for it helps others, especially if the server requires special setup. Follow these steps:\n\n1. Read [CONTRIBUTING.md](CONTRIBUTING.md).\n2. Create a new file at `lsp/SERVER_NAME.lua`.\n    - Copy an [existing config](https://github.com/neovim/nvim-lspconfig/tree/master/lsp)\n      to get started. Most configs are simple. For an extensive example see\n      [texlab.lua](https://github.com/neovim/nvim-lspconfig/blob/master/lsp/texlab.lua).\n3. Ask questions on [GitHub Discussions](https://github.com/neovim/neovim/discussions) or in the [Neovim Matrix room](https://app.element.io/#/room/#neovim:matrix.org).\n\n## Release process\n\nTo publish a release:\n\n- Create and push a new [tag](https://github.com/neovim/nvim-lspconfig/tags).\n- After pushing the tag, a [GitHub action](./.github/workflows/release.yml)\n  will automatically package the plugin and publish the release to LuaRocks.\n\n## License\n\nCopyright Neovim contributors. All rights reserved.\n\nnvim-lspconfig is licensed under the terms of the Apache 2.0 license.\n\nSee [LICENSE.md](./LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneovim%2Fnvim-lspconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneovim%2Fnvim-lspconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneovim%2Fnvim-lspconfig/lists"}