From 986aa13d2717036ab7c8f3672e3c518c6134788a Mon Sep 17 00:00:00 2001 From: Robert Morrison Date: Sun, 28 Sep 2025 04:37:09 +0100 Subject: [PATCH] fix(termux_language_server): fix lsp config Fix the config for termux_language_server, allowing it to fully work with all filetypes it actually supports --- lsp/termux_language_server.lua | 20 ++++++++++++++++++++ lua/core/init.lua | 4 ++++ lua/core/lspconfig.lua | 21 +++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 lsp/termux_language_server.lua create mode 100644 lua/core/lspconfig.lua diff --git a/lsp/termux_language_server.lua b/lsp/termux_language_server.lua new file mode 100644 index 0000000..9993f5a --- /dev/null +++ b/lsp/termux_language_server.lua @@ -0,0 +1,20 @@ +---@type vim.lsp.Config +return { + cmd = { "termux-language-server" }, + filetypes = { + "sh.build", + "sh.subpackage", + + "sh.PKGBUILD", + "sh.install", + "sh.makepkg.conf", + + "sh.ebuild", + "sh.eclass", + "sh.make.conf", + "sh.color.map", + + "sh.mdd", + }, + single_file_support = true, +} diff --git a/lua/core/init.lua b/lua/core/init.lua index 0c742ba..441e75a 100644 --- a/lua/core/init.lua +++ b/lua/core/init.lua @@ -3,8 +3,12 @@ local M = {} M.setup = function() require("core.options") require("core.autocommands") + require("core.filetypes") require("plugins.lazy") + -- Load this after loading plugins to ensure default lspconfig is there + require("core.lspconfig") + vim.cmd.colorscheme("gruvbox") end diff --git a/lua/core/lspconfig.lua b/lua/core/lspconfig.lua new file mode 100644 index 0000000..70c504f --- /dev/null +++ b/lua/core/lspconfig.lua @@ -0,0 +1,21 @@ +-- Manual lspconfig/changes where needed + +vim.lsp.config("termux_language_server", { + filetypes = { + -- Android Termux + "sh.build", -- build.sh + "sh.subpackage", -- *.subpackage.sh + -- ArchLinux/Windows Msys2 + "sh.PKGBUILD", -- PKGBUILD + "sh.install", -- *.install + "sh.makepkg.conf", -- makepkg.conf + -- Gentoo + "sh.ebuild", -- *.ebuild + "sh.eclass", -- *.eclass + "sh.make.conf", -- /etc/make.conf, /etc/portage/make.conf + "sh.color.map", -- /etc/portage/color.map + -- Zsh + "sh.mdd", -- *.mdd + }, +}) +vim.lsp.enable("termux_language_server") -- not enabled by default for some reason