Skip to content

Commit

Permalink
simplify default config (#814)
Browse files Browse the repository at this point in the history
  • Loading branch information
filipmnowak authored Sep 11, 2024
1 parent d54920c commit a10e73e
Showing 1 changed file with 9 additions and 24 deletions.
33 changes: 9 additions & 24 deletions pages/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,30 +176,15 @@ of whether you are using mason or others, you can use this
configuration below as a reference:

```lua
local lspconfig = require("lspconfig")
local configs = require("lspconfig.configs")

local lexical_config = {
filetypes = { "elixir", "eelixir", "heex" },
cmd = { "/my/home/projects/_build/dev/package/lexical/bin/start_lexical.sh" },
settings = {},
}

if not configs.lexical then
configs.lexical = {
default_config = {
filetypes = lexical_config.filetypes,
cmd = lexical_config.cmd,
root_dir = function(fname)
return lspconfig.util.root_pattern("mix.exs", ".git")(fname) or vim.loop.os_homedir()
end,
-- optional settings
settings = lexical_config.settings,
},
}
end

lspconfig.lexical.setup({})
require('lspconfig').lexical.setup {
cmd = { "my/home/projects/_build/dev/package/lexical/bin/start_lexical.sh" },
root_dir = function(fname)
return util.root_pattern("mix.exs", ".git")(fname) or vim.loop.cwd()
end,
filetypes = { "elixir", "eelixir", "heex" },
-- optional settings
settings = {}
}
```

If the configuration above doesn't work for you, please try this minimal [neovim configuration](https://github.com/scottming/nvim-mini-for-lexical), It can eliminate other plugin factors.
Expand Down

0 comments on commit a10e73e

Please sign in to comment.