diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2024-11-16 14:35:09 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-16 14:35:09 +0100 |
| commit | 67001eb2427ac84dbfa8b2ce8bb5e65451fe127c (patch) | |
| tree | a759f138823203732f1d5a503a6e9eb8f44020a9 | |
| parent | 212e52c273a1004ff2081f51f54b92058e47d62c (diff) | |
| parent | f861071d3eb81aa281e00e5a610714e2dcf65446 (diff) | |
Merge pull request #544 from chillinbythetree/nvim-lspconfig-examples
Update readme with nvim-lspconfig settings example
| -rw-r--r-- | README.md | 21 |
1 files changed, 16 insertions, 5 deletions
@@ -205,14 +205,25 @@ Configuration of the LSP: Neovim has a builtin support for LSP. -There is a plugin that turns easier the setup, called [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig). You can -install it with you prefered package manager. +There is a plugin that makes the setup easier, called [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig). You can install it with your prefered package manager. -A simple configuration to use with Odin would be like this: +A simple configuration that uses the default `ols` settings would be like this: ```lua -local lspconfig = require('lspconfig') -lspconfig.ols.setup({}) +require'lspconfig'.ols.setup {} +``` + +And here is an example of a configuration with a couple of settings applied: + +```lua +require'lspconfig'.ols.setup { + init_options = { + checker_args = "-strict-style", + collections = { + { name = "shared", path = vim.fn.expand('$HOME/odin-lib') } + }, + }, +} ``` ### Emacs |