[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-70823":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":33,"readmeContent":34,"aiSummary":35,"trendingCount":16,"starSnapshotCount":16,"syncStatus":36,"lastSyncTime":37,"discoverSource":38},70823,"nvim-lspconfig","neovim\u002Fnvim-lspconfig","neovim","Quickstart configs for Nvim LSP","",null,"Lua",13710,2456,76,26,0,9,17,83,27,45,"Apache License 2.0",false,"master",true,[27,28,29,7,30,31,32],"language-server","language-server-protocol","lsp","nvim","plugin","vim","2026-06-12 02:02:43","# nvim-lspconfig\n\nnvim-lspconfig is a collection of LSP server configurations for the [Nvim LSP client](https:\u002F\u002Fneovim.io\u002Fdoc\u002Fuser\u002Flsp.html).\n\nView [all configs](doc\u002Fconfigs.md), or run `:help lspconfig-all` from Nvim.\n\n## Important ⚠️\n\n* `require('lspconfig')` (the legacy \"framework\" of nvim-lspconfig) [is **deprecated**](https:\u002F\u002Fgithub.com\u002Fneovim\u002Fnvim-lspconfig\u002Fissues\u002F3693) in favor of [vim.lsp.config](https:\u002F\u002Fneovim.io\u002Fdoc\u002Fuser\u002Flsp.html#lsp-config) (Nvim 0.11+).\n    * The [lspconfig.lua](.\u002Flua\u002Flspconfig.lua) *module* will be dropped. Calls to `require('lspconfig')` will show a warning, which will later become an error.\n* nvim-lspconfig itself is **NOT deprecated**. It provides server-specific configs.\n    * The configs live in the [lsp\u002F](.\u002Flsp\u002F) directory. `vim.lsp.config` automatically finds them and merges them with any local `lsp\u002F*.lua` configs defined by you or a plugin.\n    * The old configs in [lua\u002Flspconfig\u002F](.\u002Flua\u002Flspconfig\u002F) are **deprecated** and will be removed.\n\n### Migration instructions\n\n1. Upgrade to Nvim 0.11+\n2. (Optional) Use `vim.lsp.config('…')` (not `require'lspconfig'.….setup{}`) to *customize* or *define* a config.\n3. Use `vim.lsp.enable('…')` (not `require'lspconfig'.….setup{}`) to *enable* a config, so that it activates for its `filetypes`.\n\n## Support\n\nThese configs are **best-effort and supported by the community (you).** See [contributions](#contributions).\n\n* Ask questions on [GitHub Discussions](https:\u002F\u002Fgithub.com\u002Fneovim\u002Fneovim\u002Fdiscussions), not the issue tracker.\n* If you found a bug in Nvim LSP (`:help lsp`), [report it to Neovim core](https:\u002F\u002Fgithub.com\u002Fneovim\u002Fneovim\u002Fissues\u002Fnew?assignees=&labels=bug%2Clsp&template=lsp_bug_report.yml).\n    * **Do not** report it here. Only configuration data lives here.\n\n## Install\n\n[![LuaRocks](https:\u002F\u002Fimg.shields.io\u002Fluarocks\u002Fv\u002Fneovim\u002Fnvim-lspconfig?logo=lua&color=purple)](https:\u002F\u002Fluarocks.org\u002Fmodules\u002Fneovim\u002Fnvim-lspconfig)\n\n* Requires Nvim 0.11.3+.\n    * Support for Nvim 0.10 [will be removed](https:\u002F\u002Fgithub.com\u002Fneovim\u002Fnvim-lspconfig\u002Fissues\u002F3693). Upgrade Nvim and nvim-lspconfig before reporting an issue.\n* With Nvim 0.12+, you can use the builtin `vim.pack` plugin manager:\n  ```lua\n  vim.pack.add{\n    { src = 'https:\u002F\u002Fgithub.com\u002Fneovim\u002Fnvim-lspconfig' },\n  }\n  ```\n* Or install nvim-lspconfig using Vim's \"packages\" feature:\n  ```\n  git clone https:\u002F\u002Fgithub.com\u002Fneovim\u002Fnvim-lspconfig ~\u002F.config\u002Fnvim\u002Fpack\u002Fnvim\u002Fstart\u002Fnvim-lspconfig\n  ```\n* Or use a 3rd-party plugin manager.\n\n## Quickstart\n\n1. Install a language server, e.g. [pyright](doc\u002Fconfigs.md#pyright)\n   ```bash\n   npm i -g pyright\n   ```\n2. Enable its config in your init.lua ([:help lsp-quickstart](https:\u002F\u002Fneovim.io\u002Fdoc\u002Fuser\u002Flsp.html#lsp-quickstart)).\n   ```lua\n   vim.lsp.enable('pyright')\n   ```\n3. Ensure your project\u002Fworkspace 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 vim.lsp` to see the status or to troubleshoot.\n\nSee `:help lspconfig-all` for the full list of server-specific details. For\nservers not on your `$PATH` (e.g., `jdtls`, `elixirls`), you must manually set\nthe `cmd` parameter:\n\n```lua\nvim.lsp.config('jdtls', {\n  cmd = { '\u002Fpath\u002Fto\u002Fjdtls' },\n})\n```\n\n## Commands\n\n* `:LspInfo` (alias to `:checkhealth vim.lsp`) shows the status of active and configured language servers.\n* `:lsp enable [\u003Cconfig_name>]` (`:LspStart` for Nvim 0.11 or older) Start the requested server name. Will only successfully start if the command detects a root directory matching the current config.\n* `:lsp disable [\u003Cconfig_name>]` (`:LspStop` for Nvim 0.11 or older) Stops the given server. Defaults to stopping all servers active on the current buffer. To force stop use `:LspStop!`\n* `:lsp restart [\u003Cclient_name>]` (`:LspRestart` for Nvim 0.11 or older) Restarts the given client, and attempts to reattach to all previously attached buffers. Defaults to restarting all active servers.\n\n## Configuration\n\nNvim sets default options and mappings when LSP is active in a buffer:\n* [:help lsp-defaults](https:\u002F\u002Fneovim.io\u002Fdoc\u002Fuser\u002Flsp.html#lsp-defaults)\n* [:help diagnostic-defaults](https:\u002F\u002Fneovim.io\u002Fdoc\u002Fuser\u002Fdiagnostic.html#diagnostic-defaults)\n\nTo customize, see:\n* [:help lsp-attach](https:\u002F\u002Fneovim.io\u002Fdoc\u002Fuser\u002Flsp.html#lsp-attach)\n* [:help lsp-buf](https:\u002F\u002Fneovim.io\u002Fdoc\u002Fuser\u002Flsp.html#lsp-buf)\n\nExtra settings can be specified for each LSP server. With Nvim 0.11+ you can\n[extend a config](https:\u002F\u002Fneovim.io\u002Fdoc\u002Fuser\u002Flsp.html#lsp-config) by calling\n`vim.lsp.config('…', {…})`.\n\n```lua\nvim.lsp.config('rust_analyzer', {\n  -- Server-specific settings. See `:help lsp-quickstart`\n  settings = {\n    ['rust-analyzer'] = {},\n  },\n})\n```\n\n### Config priority\n\nConfigs are sourced in this order:\n\n1. `lsp\u002F` in 'runtimepath'\n2. `after\u002Flsp\u002F` in 'runtimepath'\n3. `vim.lsp.config()`\n\nIf you install nvim-lspconfig or similar plugins, the order that configs are applied depends on the load order. To ensure that your own config \"wins\" and overrides the others, use `after\u002Flsp\u002F` and\u002For `vim.lsp.config()` to override\u002Fextend the defaults.\n\n## Creating a config\n\n### As code\n\n1. Run `:lua vim.lsp.config('foo', {cmd={'true'}})`\n2. Run `:lua vim.lsp.enable('foo')`\n3. Run `:checkhealth vim.lsp`, the new config is listed under \"Enabled Configurations\". 😎\n\n### As a file\n\n1. Create a file `after\u002Flsp\u002Ffoo.lua` somewhere on your 'runtimepath'.\n   ```\n   :exe 'edit' stdpath('config') .. '\u002Fafter\u002Flsp\u002Ffoo.lua'\n   ```\n2. Add this code to the file (or copy any of the examples from the [lsp\u002F directory](.\u002Flsp\u002F) in this repo):\n   ```\n   return {\n     cmd = { 'true' },\n   }\n   ```\n3. Save the file (with `++p` to ensure its parent directory is created).\n   ```\n   :write ++p\n   ```\n4. Enable the config.\n   ```\n   :lua vim.lsp.enable('foo')\n   ```\n5. Run `:checkhealth vim.lsp`, the new config is listed under \"Enabled Configurations\". 🌈\n\n## LSP Settings Type Annotations\n\n`nvim-lspconfig` generates Lua type definitions for each supported LSP server.\nBy manually adding annotations (e.g., `---@type lspconfig.settings.server_name`),\nyou enable auto-completion and diagnostics for your server settings.\n\n**Example:**\n\n```lua\n---@type vim.lsp.Config\nlocal config = {\n  ---@type lspconfig.settings.lua_ls\n  settings = {\n    Lua = {\n      runtime = {\n        version = 'LuaJIT',\n      },\n      workspace = {\n        preloadFileSize = 10000,\n        library = {\n          vim.env.VIMRUNTIME,\n        }\n      },\n    },\n  },\n}\n\nvim.lsp.config('lua_ls', config)\n```\n\n## Troubleshooting\n\nStart with `:checkhealth vim.lsp` to troubleshoot. The 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 the config from the command line and see that the language server starts. If the `cmd` is a name instead of an absolute path, ensure it is on your `$PATH`.\n2. Missing filetype plugins. Some languages are not detected by 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\u002F`, but each config defines other \"root marker\" names. Root markers\u002Fdirectories are listed in `:help lspconfig-all`.\n\n   You can also explicitly set a root instead of relying on automatic detection by enabling `'exrc'` and adding an `.nvim.lua` at the desired root dir with the following code:\n   ```lua\n   vim.lsp.config('\u003Cclient name>', {\n     root_dir = vim.fn.fnamemodify(debug.getinfo(1, 'S').source:sub(2), ':p:h'),\n   })\n   ```\n   Note that prior to nvim 0.12 `exrc` file is executed only if it's inside of a cwd where you start `nvim`.\n\n## Bug reports\n\nIf you found a bug with LSP functionality, [report it to Neovim core](https:\u002F\u002Fgithub.com\u002Fneovim\u002Fneovim\u002Fissues\u002Fnew?assignees=&labels=bug%2Clsp&template=lsp_bug_report.yml).\n\nBefore reporting a bug, check your logs and the output of `:checkhealth vim.lsp`. Add this to your init.lua to enable verbose logging:\n\n```lua\nvim.lsp.log.set_level('debug')\n```\n\nAttempt to run the language server, then run `:LspLog` to open the log.\nMost of the time, the reason for failure is present in the logs.\n\n## Contributions\n\nIf a language server is missing from [configs.md](doc\u002Fconfigs.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\u002F\u003Cserver_name>.lua`.\n    - Copy an [existing config](https:\u002F\u002Fgithub.com\u002Fneovim\u002Fnvim-lspconfig\u002Ftree\u002Fmaster\u002Flsp)\n      to get started. Most configs are simple. For an extensive example see\n      [texlab.lua](https:\u002F\u002Fgithub.com\u002Fneovim\u002Fnvim-lspconfig\u002Fblob\u002Fmaster\u002Flsp\u002Ftexlab.lua).\n3. Ask questions on [GitHub Discussions](https:\u002F\u002Fgithub.com\u002Fneovim\u002Fneovim\u002Fdiscussions) or in the [Neovim Matrix room](https:\u002F\u002Fapp.element.io\u002F#\u002Froom\u002F#neovim:matrix.org).\n\n## Release process\n\nTo publish a release:\n\n- Create and push a new [tag](https:\u002F\u002Fgithub.com\u002Fneovim\u002Fnvim-lspconfig\u002Ftags).\n- After pushing the tag, a [GitHub action](.\u002F.github\u002Fworkflows\u002Frelease.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](.\u002FLICENSE.md)\n","nvim-lspconfig 是为 Neovim LSP 客户端提供的一系列语言服务器配置的集合。该项目使用 Lua 语言编写，核心功能包括快速启动和配置多种语言服务器，支持自动补全、代码跳转、错误提示等 LSP 标准特性。它适用于需要集成语言服务器以提升开发效率的 Neovim 用户场景中，如 Python 开发者可以轻松启用 pyright 作为其 LSP 服务器。通过简单的配置步骤，用户能够享受到丰富的 LSP 功能支持，同时保持高度可定制性。需要注意的是，部分旧版配置已被弃用，请根据官方指南迁移到最新版本。",2,"2026-06-11 03:34:23","high_star"]