From e2a6c21f810aa1e3306a4e7eb3fa77357b2bb058 Mon Sep 17 00:00:00 2001 From: Jonas Hahn Date: Mon, 1 Sep 2025 17:07:32 +0200 Subject: [PATCH] Update readme --- README.md | 11 +++-------- lua/plugins/lsp.lua | 7 ++++++- lua/utils/functions.lua | 16 +++++++++++++--- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index e0f8136..089247b 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # Neovim configuration in pure lua -You can configure the current semester that you are in for university integrations. -There are certain things required like `make` and `npm` for various plugins. +Configure the environment in `conf.lua`. +Most lsp require `npm` installed on the system. ## Dependencies -To install proper snippets and get the basic lsp the following programs are needed in path. +To install proper snippets and get lsp running install the following programs into your path ``` make @@ -14,8 +14,3 @@ gcc libc bash ``` - -## General - -This configuration is based on the lazy plugin manager. - diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index a600e2e..8a198c4 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -58,7 +58,8 @@ return { config = function() require("mason").setup() - -- Workaround for local zls + -- Workaround for local lsp only + -- does not work so nice on non nixos systems local servers_modified = servers for i, v in ipairs(servers_modified) do if v == "zls" then @@ -69,6 +70,10 @@ return { table.remove(servers_modified, i) break end + if v == "hls" then + table.remove(servers_modified, i) + break + end end require("mason-lspconfig").setup({ diff --git a/lua/utils/functions.lua b/lua/utils/functions.lua index d6c0093..a3e7280 100644 --- a/lua/utils/functions.lua +++ b/lua/utils/functions.lua @@ -51,6 +51,18 @@ function M.get_lsp_servers() warn_once("gopls", "[mason] Skipping gopls (go not found)") end + if vim.fn.executable("php") == 1 then + table.insert(servers, "intelephense") + else + warn_once("php", "[mason] Skipping intelephense (php not found)") + end + + if vim.fn.executable("hls") == 1 then + table.insert(servers, "hls") + else + warn_once("haskell", "[mason] Skipping hls (hls not found)") + end + if vim.fn.executable("npm") == 1 then if vim.fn.executable("clangd") == 1 then table.insert(servers, "clangd") @@ -61,7 +73,7 @@ function M.get_lsp_servers() table.insert(servers, "html") table.insert(servers, "jsonls") else - warn_once("npm", "[mason] Skipping pyright/clangd/bashls (npm not found)") + warn_once("npm", "[mason] Skipping npm related (npm not found)") end if vim.fn.executable("cargo") == 1 then @@ -76,13 +88,11 @@ function M.get_lsp_servers() end if vim.fn.executable("deno") == 1 then - --table.insert(servers, "denols") table.insert(servers, "ts_ls") else warn_once("deno", "[mason] Skipping denols and tsserver (deno not found)") end - -- Only configure zig when in local environment if vim.fn.executable("zls") == 1 then table.insert(servers, "zls") end