diff options
| author | 2024-07-24 19:19:26 +0200 | |
|---|---|---|
| committer | 2024-07-24 19:19:26 +0200 | |
| commit | 01586921b3d5f2ac1ccf8196d3ad9b4b3ddd31f3 (patch) | |
| tree | d740ac5e8943e48ee4132efc4633051d6cdf1d48 /dot_config/nvim/fnl/plugins/lsp | |
| parent | nvim: ignore lazy-lock.json (diff) | |
nvim: rewrite config in fennel
One file isn't done, and there's also the question of ftplugin and co.
One step at a time though, eh?
Diffstat (limited to '')
| -rw-r--r-- | dot_config/nvim/fnl/plugins/lsp/capabilities.fnl | 1 | ||||
| -rw-r--r-- | dot_config/nvim/fnl/plugins/lsp/init.fnl | 33 |
2 files changed, 34 insertions, 0 deletions
diff --git a/dot_config/nvim/fnl/plugins/lsp/capabilities.fnl b/dot_config/nvim/fnl/plugins/lsp/capabilities.fnl new file mode 100644 index 0000000..607602c --- /dev/null +++ b/dot_config/nvim/fnl/plugins/lsp/capabilities.fnl @@ -0,0 +1 @@ +nil diff --git a/dot_config/nvim/fnl/plugins/lsp/init.fnl b/dot_config/nvim/fnl/plugins/lsp/init.fnl new file mode 100644 index 0000000..10685d2 --- /dev/null +++ b/dot_config/nvim/fnl/plugins/lsp/init.fnl @@ -0,0 +1,33 @@ +(import-macros {: tbl : recc} :toast.macros) + +(fn gopts [plist] + {:clangd {} + :clojure_lsp {:root_dir (plist :project.clj :deps.edn :bb.edn :build.boot :shadow-cljs.edn :.git)} + :denols {:autostart false + :root_dir (plist :deno.json :deno.jsonc)} + :gopls {} + :ltex {} + :lua_ls {} + :texlab {:filetypes [:tex :plaintex :bib :latex]} + :tsserver {:autostart false + :root_dir (plist :tsconfig.json :package.json)} + :zls {}}) + +(local attach (require :plugins.lsp.attach)) +(local caps (require :plugins.lsp.capabilities)) + +[(tbl :neovim/nvim-lspconfig & + :config (fn [_ opts] + (each [k v (pairs opts)] + (set v.on_attach (or attach v.on_attach)) + (when (= :table (type caps)) + (set v.capabilities (or v.capabilities caps))) + (let [s (. (require :lspconfig) k) + c (or v.cmd s.document_config.default_config.cmd)] + (when (not= 0 (vim.fn.executable (. c 1))) + (s.setup v))))) + :opts (fn [] + (let [plist (fn [...] + (local p (recc :lspconfig.util :root_pattern ...)) + #(p $))] + (gopts plist))))] |
