diff options
| author | 2023-04-13 00:39:31 -0400 | |
|---|---|---|
| committer | 2023-04-13 00:39:31 -0400 | |
| commit | 6273b6d43aedc6b00b82e1081db14c39194da765 (patch) | |
| tree | c6b1b1e6f9391696001375cb93ecd34449eefe0c /dot_config/nvim/lua/plugins/lsp/init.lua | |
| parent | nvim: add rudimentary treesitter folding support (diff) | |
nvim: redo the whole thing
reasons tm
Diffstat (limited to '')
| -rw-r--r-- | dot_config/nvim/lua/plugins/lsp/init.lua | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/dot_config/nvim/lua/plugins/lsp/init.lua b/dot_config/nvim/lua/plugins/lsp/init.lua new file mode 100644 index 0000000..01fb34a --- /dev/null +++ b/dot_config/nvim/lua/plugins/lsp/init.lua @@ -0,0 +1,41 @@ +local attach = require 'plugins.lsp.attach' +local caps = require 'plugins.lsp.capabilities' + +return { + { + 'neovim/nvim-lspconfig', + config = function(_, opts) + for k, v in pairs(opts) do + v.on_attach = v.on_attach or attach + if type(caps) == 'table' then + v.capabilities = v.capabilities or caps + end + local s = require 'lspconfig'[k] + local c = v.cmd or s.document_config.default_config.cmd + if vim.fn.executable(c[1]) ~= 0 then + s.setup(v) + end + end + end, + opts = function() + local plist = function(...) + local p = require 'lspconfig.util'.root_pattern(...) + return function(f) return p(f) end + end + return { + clojure_lsp = { + root_dir = plist('project.clj', 'deps.edn', 'bb.edn', 'build.boot', 'shadow-cljs.edn', '.git'), + }, + denols = { + root_dir = plist('deno.json', 'deno.jsonc'), + }, + gopls = {}, + ltex = {}, + lua_ls = {}, + tsserver = { + root_dir = plist('tsconfig.json', 'package.json'), + }, + } + end + }, +} |
