14
14
15
15
## Install
16
16
17
- Requires 0.8.
17
+ Requires 0.8
18
18
19
19
### lazy.nvim
20
20
@@ -24,20 +24,23 @@ Requires 0.8.
24
24
ft = { " elixir" , " eex" , " heex" , " surface" },
25
25
config = function ()
26
26
local elixir = require (" elixir" )
27
+ local elixirls = require (" elixir.elixirls" )
27
28
28
29
elixir .setup {
29
- settings = elixir .settings {
30
- dialyzerEnabled = false ,
31
- enableTestLenses = false ,
32
- },
33
- log_level = vim .lsp .protocol .MessageType .Log ,
34
- message_level = vim .lsp .protocol .MessageType .Log ,
35
- on_attach = function (client , bufnr )
36
- -- whatever keybinds you want, see below for more suggestions
37
- vim .keymap .set (" n" , " <space>fp" , " :ElixirFromPipe<cr>" , { buffer = true , noremap = true })
38
- vim .keymap .set (" n" , " <space>tp" , " :ElixirToPipe<cr>" , { buffer = true , noremap = true })
39
- vim .keymap .set (" v" , " <space>em" , " :ElixirExpandMacro<cr>" , { buffer = true , noremap = true })
40
- end ,
30
+ elixirls = {
31
+ settings = elixirls .settings {
32
+ dialyzerEnabled = false ,
33
+ enableTestLenses = false ,
34
+ },
35
+ log_level = vim .lsp .protocol .MessageType .Log ,
36
+ message_level = vim .lsp .protocol .MessageType .Log ,
37
+ on_attach = function (client , bufnr )
38
+ -- whatever keybinds you want, see below for more suggestions
39
+ vim .keymap .set (" n" , " <space>fp" , " :ElixirFromPipe<cr>" , { buffer = true , noremap = true })
40
+ vim .keymap .set (" n" , " <space>tp" , " :ElixirToPipe<cr>" , { buffer = true , noremap = true })
41
+ vim .keymap .set (" v" , " <space>em" , " :ElixirExpandMacro<cr>" , { buffer = true , noremap = true })
42
+ end ,
43
+ }
41
44
}
42
45
end ,
43
46
dependencies = {
@@ -68,60 +71,55 @@ Note: Not specifying the `repo`, `branch`, or `tag` options will default to the
68
71
69
72
``` lua
70
73
local elixir = require (" elixir" )
71
-
72
- elixir .setup ({
73
- -- specify a repository and branch
74
- repo = " mhanberg/elixir-ls" , -- defaults to elixir-lsp/elixir-ls
75
- branch = " mh/all-workspace-symbols" , -- defaults to nil, just checkouts out the default branch, mutually exclusive with the `tag` option
76
- tag = " v0.13.0" , -- defaults to nil, mutually exclusive with the `branch` option
77
-
78
- -- alternatively, point to an existing elixir-ls installation (optional)
79
- -- not currently supported by elixirls, but can be a table if you wish to pass other args `{"path/to/elixirls", "--foo"}`
80
- cmd = " /usr/local/bin/elixir-ls.sh" ,
81
-
82
- -- default settings, use the `settings` function to override settings
83
- settings = elixir .settings ({
84
- dialyzerEnabled = true ,
85
- fetchDeps = false ,
86
- enableTestLenses = false ,
87
- suggestSpecs = false ,
88
- }),
89
-
90
- on_attach = function (client , bufnr )
91
- local map_opts = { buffer = true , noremap = true }
92
-
93
- -- run the codelens under the cursor
94
- vim .keymap .set (" n" , " <space>r" , vim .lsp .codelens .run , map_opts )
95
- -- remove the pipe operator
96
- vim .keymap .set (" n" , " <space>fp" , " :ElixirFromPipe<cr>" , map_opts )
97
- -- add the pipe operator
98
- vim .keymap .set (" n" , " <space>tp" , " :ElixirToPipe<cr>" , map_opts )
99
- vim .keymap .set (" v" , " <space>em" , " :ElixirExpandMacro<cr>" , map_opts )
100
-
101
- -- bindings for standard LSP functions.
102
- vim .keymap .set (" n" , " <space>df" , " <cmd>lua vim.lsp.buf.format()<cr>" , map_opts )
103
- vim .keymap .set (" n" , " <space>gd" , " <cmd>lua vim.diagnostic.open_float()<cr>" , map_opts )
104
- vim .keymap .set (" n" , " <space>dt" , " <cmd>lua vim.lsp.buf.definition()<cr>" , map_opts )
105
- vim .keymap .set (" n" , " <space>K" , " <cmd>lua vim.lsp.buf.hover()<cr>" , map_opts )
106
- vim .keymap .set (" n" , " <space>gD" ," <cmd>lua vim.lsp.buf.implementation()<cr>" , map_opts )
107
- vim .keymap .set (" n" , " <space>1gD" ," <cmd>lua vim.lsp.buf.type_definition()<cr>" , map_opts )
108
- -- keybinds for fzf-lsp.nvim: https://github.com/gfanto/fzf-lsp.nvim
109
- -- you could also use telescope.nvim: https://github.com/nvim-telescope/telescope.nvim
110
- -- there are also core vim.lsp functions that put the same data in the loclist
111
- vim .keymap .set (" n" , " <space>gr" , " :References<cr>" , map_opts )
112
- vim .keymap .set (" n" , " <space>g0" , " :DocumentSymbols<cr>" , map_opts )
113
- vim .keymap .set (" n" , " <space>gW" , " :WorkspaceSymbols<cr>" , map_opts )
114
- vim .keymap .set (" n" , " <leader>d" , " :Diagnostics<cr>" , map_opts )
115
-
116
-
117
- -- keybinds for vim-vsnip: https://github.com/hrsh7th/vim-vsnip
118
- vim .cmd ([[ imap <expr> <C-l> vsnip#available(1) ? '<Plug>(vsnip-expand-or-jump)' : '<C-l>']] )
119
- vim .cmd ([[ smap <expr> <C-l> vsnip#available(1) ? '<Plug>(vsnip-expand-or-jump)' : '<C-l>']] )
120
-
121
- -- update capabilities for nvim-cmp: https://github.com/hrsh7th/nvim-cmp
122
- require (" cmp_nvim_lsp" ).update_capabilities (capabilities )
123
- end
124
- })
74
+ local elixirls = require (" elixir.elixirls" )
75
+
76
+ elixir .setup {
77
+ elixirls = {
78
+ -- specify a repository and branch
79
+ repo = " mhanberg/elixir-ls" , -- defaults to elixir-lsp/elixir-ls
80
+ branch = " mh/all-workspace-symbols" , -- defaults to nil, just checkouts out the default branch, mutually exclusive with the `tag` option
81
+ tag = " v0.13.0" , -- defaults to nil, mutually exclusive with the `branch` option
82
+
83
+ -- alternatively, point to an existing elixir-ls installation (optional)
84
+ -- not currently supported by elixirls, but can be a table if you wish to pass other args `{"path/to/elixirls", "--foo"}`
85
+ cmd = " /usr/local/bin/elixir-ls.sh" ,
86
+
87
+ -- default settings, use the `settings` function to override settings
88
+ settings = elixirls .settings {
89
+ dialyzerEnabled = true ,
90
+ fetchDeps = false ,
91
+ enableTestLenses = false ,
92
+ suggestSpecs = false ,
93
+ },
94
+
95
+ on_attach = function (client , bufnr )
96
+ local map_opts = { buffer = true , noremap = true }
97
+
98
+ -- run the codelens under the cursor
99
+ vim .keymap .set (" n" , " <space>r" , vim .lsp .codelens .run , map_opts )
100
+ -- remove the pipe operator
101
+ vim .keymap .set (" n" , " <space>fp" , " :ElixirFromPipe<cr>" , map_opts )
102
+ -- add the pipe operator
103
+ vim .keymap .set (" n" , " <space>tp" , " :ElixirToPipe<cr>" , map_opts )
104
+ vim .keymap .set (" v" , " <space>em" , " :ElixirExpandMacro<cr>" , map_opts )
105
+
106
+ -- bindings for standard LSP functions.
107
+ vim .keymap .set (" n" , " <space>df" , " <cmd>lua vim.lsp.buf.format()<cr>" , map_opts )
108
+ vim .keymap .set (" n" , " <space>gd" , " <cmd>lua vim.diagnostic.open_float()<cr>" , map_opts )
109
+ vim .keymap .set (" n" , " <space>dt" , " <cmd>lua vim.lsp.buf.definition()<cr>" , map_opts )
110
+ vim .keymap .set (" n" , " <space>K" , " <cmd>lua vim.lsp.buf.hover()<cr>" , map_opts )
111
+ vim .keymap .set (" n" , " <space>gD" ," <cmd>lua vim.lsp.buf.implementation()<cr>" , map_opts )
112
+ vim .keymap .set (" n" , " <space>1gD" ," <cmd>lua vim.lsp.buf.type_definition()<cr>" , map_opts )
113
+ -- keybinds for fzf-lsp.nvim: https://github.com/gfanto/fzf-lsp.nvim
114
+ -- you could also use telescope.nvim: https://github.com/nvim-telescope/telescope.nvim
115
+ -- there are also core vim.lsp functions that put the same data in the loclist
116
+ vim .keymap .set (" n" , " <space>gr" , " :References<cr>" , map_opts )
117
+ vim .keymap .set (" n" , " <space>g0" , " :DocumentSymbols<cr>" , map_opts )
118
+ vim .keymap .set (" n" , " <space>gW" , " :WorkspaceSymbols<cr>" , map_opts )
119
+ vim .keymap .set (" n" , " <leader>d" , " :Diagnostics<cr>" , map_opts )
120
+ end
121
+ }
122
+ }
125
123
```
126
124
127
125
## Features
0 commit comments