4524ea5
Branches > main > 4524ea5 > files / nvim / lua / colors.lua
Make lsp config nicer
Commit: 4524ea512b7811c6c1589e350f95cde1ba28ea0e
Parent: c4543d1
1 changed file:
nvim/lua/lsp.lua view file
@@ -1,6 +1,7 @@ local lsp = vim.lsp local keymap = vim.keymap.set +-- TODO should be buffer-local? local function on_attach(client, bufnr) keymap("n", "gd", lsp.buf.definition) keymap("n", "gr", lsp.buf.references)@@ -9,8 +10,22 @@ keymap("n", "<Space>c", lsp.buf.code_action) end -lsp.config("clojure-lsp", {filetypes = {"clojure"},- cmd = {"clojure-lsp"},- on_attach = on_attach,- root_markers = {"project.clj", "deps.edn", "build.boot", "shadow-cljs.edn", ".git", "bb.edn"}})-lsp.enable("clojure-lsp")+local function config(opts)+ local name = opts.name++ opts.cmd = {name}+ opts.on_attach = on_attach++ lsp.config(name, opts)+ lsp.enable(name)+end++--- TODO hopefully this works :p+config({name = "clojure-lsp",+ filetypes = {"clojure"},+ root_markers = {"project.clj", "deps.edn", "build.boot", "shadow-cljs.edn", ".git", "bb.edn"}})++config({name = "lua-language-server",+ filetypes = {"lua"},+ settings = {Lua = {diagnostics = {globals = {"vim"}}}},+ root_markers = {".luarc.json", ".luarc.jsonc", ".luacheckrc", ".stylua.toml", "stylua.toml", "selene.toml", "selene.yml", ".git"}})