diff --git a/fnl/lsp/init.fnl b/fnl/lsp/init.fnl new file mode 100644 index 0000000..e7f2906 --- /dev/null +++ b/fnl/lsp/init.fnl @@ -0,0 +1,24 @@ +{:setup (fn [] + (local symbols {:Error "󰅙" :Info "󰋼" :Hint "󰌵" :Warn ""}) + (each [name icon (pairs symbols)] + (let [hl (.. :DiagnosticSign name)] + (vim.fn.sign_define hl {:text icon :numhl hl :texthl hl}))) + (let [lspconfig (require :lspconfig)] + (lspconfig.lua_ls.setup {:settings {:Lua {:runtime {:version :LuaJIT} + :diagnostics {:globals [:nixCats]} + :telemetry {:enable false}}}}) + (lspconfig.nixd.setup {}) + (lspconfig.marksman.setup {}) + (lspconfig.tinymist.setup {:offset_encoding :utf-8}) + (lspconfig.svelte.setup {}) + (lspconfig.texlab.setup {}) + (lspconfig.clangd.setup {}) + (lspconfig.mesonlsp.setup {}) + (lspconfig.nushell.setup {}) + (lspconfig.vale_ls.setup {:filetypes [:markdown + :text + :tex + :rst + :typst]}) + (lspconfig.fennel_ls.setup {})) + {})} diff --git a/lua/lsp/init.lua b/lua/lsp/init.lua index 981ca81..7fcb9a7 100644 --- a/lua/lsp/init.lua +++ b/lua/lsp/init.lua @@ -1,78 +1,24 @@ -local M = {} - -M.setup = function() - local symbols = { Error = "󰅙", Info = "󰋼", Hint = "󰌵", Warn = "" } - +-- [nfnl] Compiled from ./fnl/lsp/init.fnl by https://github.com/Olical/nfnl, do not edit. +local function _1_() + local symbols = {Error = "\243\176\133\153", Info = "\243\176\139\188", Hint = "\243\176\140\181", Warn = "\239\129\177"} for name, icon in pairs(symbols) do - local hl = "DiagnosticSign" .. name - vim.fn.sign_define(hl, { text = icon, numhl = hl, texthl = hl }) + local hl = ("DiagnosticSign" .. name) + vim.fn.sign_define(hl, {text = icon, numhl = hl, texthl = hl}) end - - local lspconfig = require("lspconfig") - - lspconfig.lua_ls.setup({ - settings = { - Lua = { - runtime = { - -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) - version = "LuaJIT", - }, - diagnostics = { - globals = { "nixCats" }, - }, - -- unfortunately we won't get nixCats autocomplete with this option - -- off, but lazydev will be much faster - -- - -- workspace = { - -- -- Make the server aware of Neovim runtime files - -- library = vim.api.nvim_get_runtime_file("", true), - -- -- library = - -- }, - -- Do not send telemetry data containing a randomized but unique identifier - telemetry = { - enable = false, - }, - }, - }, - }) - - lspconfig.nixd.setup({ - nixd = { - nixpkgs = { - expr = [[import (builtins.getFlake ")]] .. nixCats("nixdExtras.nixpkgs") .. [[") { } ]], - }, - -- options = { - -- nixos = { - -- expr = [[(builtins.getFlake "]] - -- .. nixCats("nixdExtras.flake-path") - -- .. [[").nixosConfigurations."]] - -- .. nixCats("nixdExtras.systemCFGname") - -- .. [[".options]], - -- }, - -- -- (builtins.getFlake "").homeConfigurations."".options - -- ["home-manager"] = { - -- expr = [[(builtins.getFlake "]] - -- .. nixCats("nixdExtras.flake-path") - -- .. [[").homeConfigurations."]] - -- .. nixCats("nixdExtras.homeCFGname") - -- .. [[".options]], - -- }, - -- }, - }, - }) - lspconfig.marksman.setup({}) - lspconfig.tinymist.setup({ - offset_encoding = "utf-8", - }) - lspconfig.svelte.setup({}) - lspconfig.texlab.setup({}) - lspconfig.clangd.setup({}) - lspconfig.mesonlsp.setup({}) - lspconfig.nushell.setup({}) - lspconfig.vale_ls.setup({ - filetypes = { "markdown", "text", "tex", "rst", "typst" }, - }) - lspconfig.fennel_ls.setup({}) + do + local lspconfig = require("lspconfig") + lspconfig.lua_ls.setup({settings = {Lua = {runtime = {version = "LuaJIT"}, diagnostics = {globals = {"nixCats"}}, telemetry = {enable = false}}}}) + lspconfig.nixd.setup({}) + lspconfig.marksman.setup({}) + lspconfig.tinymist.setup({offset_encoding = "utf-8"}) + lspconfig.svelte.setup({}) + lspconfig.texlab.setup({}) + lspconfig.clangd.setup({}) + lspconfig.mesonlsp.setup({}) + lspconfig.nushell.setup({}) + lspconfig.vale_ls.setup({filetypes = {"markdown", "text", "tex", "rst", "typst"}}) + lspconfig.fennel_ls.setup({}) + end + return {} end - -return M +return {setup = _1_}