Skip to content

Commit

Permalink
Merge pull request #544 from chillinbythetree/nvim-lspconfig-examples
Browse files Browse the repository at this point in the history
Update readme with nvim-lspconfig settings example
  • Loading branch information
DanielGavin authored Nov 16, 2024
2 parents 212e52c + f861071 commit 67001eb
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 67001eb

Please sign in to comment.