From 889f687a68d53e989b8004db8cb4f615a99971a9 Mon Sep 17 00:00:00 2001 From: lorenzhohermuth Date: Mon, 29 Apr 2024 20:11:36 +0200 Subject: [PATCH] changes idk --- lazy-lock.json | 1 + lua/lorenz/golsp-config.lua | 36 +++++++++++++++++++++++++++++++++--- lua/lorenz/kickstart.lua | 3 +++ 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 429c616..0adff07 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -25,6 +25,7 @@ "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, "telescope.nvim": { "branch": "0.1.x", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, + "templ.vim": { "branch": "main", "commit": "5cc48b93a4538adca0003c4bc27af844bb16ba24" }, "undotree": { "branch": "master", "commit": "a1758ba9990b7189f601a3a5acdfc8ca3907a700" }, "vim-devicons": { "branch": "master", "commit": "71f239af28b7214eebb60d4ea5bd040291fb7e33" }, "vim-fugitive": { "branch": "master", "commit": "f116dcc8e21021e6fbfb6b0a9f8f7b9566d933f4" }, diff --git a/lua/lorenz/golsp-config.lua b/lua/lorenz/golsp-config.lua index 63af22a..5cb2447 100644 --- a/lua/lorenz/golsp-config.lua +++ b/lua/lorenz/golsp-config.lua @@ -1,17 +1,47 @@ -local nvim_lsp = require('lspconfig') +local lspconfig = require('lspconfig') local lastRootPath = nil local gomodpath = vim.trim(vim.fn.system("go env GOPATH")) .. "/pkg/mod" -nvim_lsp.gopls.setup({ +lspconfig.gopls.setup({ root_dir = function(fname) local fullpath = vim.fn.expand(fname, ":p") if string.find(fullpath, gomodpath) and lastRootPath ~= nil then return lastRootPath end - local root = nvim_lsp.util.root_pattern("go.mod", ".git")(fname) + local root = lspconfig.util.root_pattern("go.mod", ".git")(fname) if root ~= nil then lastRootPath = root end return root end, }) + +lspconfig.templ.setup{ + on_attach = on_attach, + capabilities = capabilities, +} + +lspconfig.tailwindcss.setup({ + on_attach = on_attach, + capabilities = capabilities, + filetypes = { "templ", "astro", "javascript", "typescript", "react" }, + init_options = { userLanguages = { templ = "html" } }, +}) + +lspconfig.html.setup({ + on_attach = on_attach, + capabilities = capabilities, + filetypes = { "html", "templ" }, +}) + +lspconfig.htmx.setup({ + on_attach = on_attach, + capabilities = capabilities, + filetypes = { "html", "templ" }, +}) + +lspconfig.unocss.setup{ + on_attach = on_attach, + capabilities = capabilities, + filetypes = { "html", "javascriptreact", "rescript", "typescriptreact", "vue", "svelte", "templ"} +} diff --git a/lua/lorenz/kickstart.lua b/lua/lorenz/kickstart.lua index 44d0e4b..4a4f66c 100644 --- a/lua/lorenz/kickstart.lua +++ b/lua/lorenz/kickstart.lua @@ -79,6 +79,9 @@ require('lazy').setup({ 'tpope/vim-fugitive', 'tpope/vim-rhubarb', + --templ + 'joerdav/templ.vim', + -- vim font 'ryanoasis/vim-devicons',