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