changes idk

This commit is contained in:
Lorenz Hohermuth 2024-04-29 20:11:36 +02:00
parent edec371d61
commit 889f687a68
3 changed files with 37 additions and 3 deletions

View File

@ -25,6 +25,7 @@
"plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" },
"telescope.nvim": { "branch": "0.1.x", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, "telescope.nvim": { "branch": "0.1.x", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" },
"templ.vim": { "branch": "main", "commit": "5cc48b93a4538adca0003c4bc27af844bb16ba24" },
"undotree": { "branch": "master", "commit": "a1758ba9990b7189f601a3a5acdfc8ca3907a700" }, "undotree": { "branch": "master", "commit": "a1758ba9990b7189f601a3a5acdfc8ca3907a700" },
"vim-devicons": { "branch": "master", "commit": "71f239af28b7214eebb60d4ea5bd040291fb7e33" }, "vim-devicons": { "branch": "master", "commit": "71f239af28b7214eebb60d4ea5bd040291fb7e33" },
"vim-fugitive": { "branch": "master", "commit": "f116dcc8e21021e6fbfb6b0a9f8f7b9566d933f4" }, "vim-fugitive": { "branch": "master", "commit": "f116dcc8e21021e6fbfb6b0a9f8f7b9566d933f4" },

View File

@ -1,17 +1,47 @@
local nvim_lsp = require('lspconfig') local lspconfig = require('lspconfig')
local lastRootPath = nil local lastRootPath = nil
local gomodpath = vim.trim(vim.fn.system("go env GOPATH")) .. "/pkg/mod" local gomodpath = vim.trim(vim.fn.system("go env GOPATH")) .. "/pkg/mod"
nvim_lsp.gopls.setup({ lspconfig.gopls.setup({
root_dir = function(fname) root_dir = function(fname)
local fullpath = vim.fn.expand(fname, ":p") local fullpath = vim.fn.expand(fname, ":p")
if string.find(fullpath, gomodpath) and lastRootPath ~= nil then if string.find(fullpath, gomodpath) and lastRootPath ~= nil then
return lastRootPath return lastRootPath
end 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 if root ~= nil then
lastRootPath = root lastRootPath = root
end end
return root return root
end, 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"}
}

View File

@ -79,6 +79,9 @@ require('lazy').setup({
'tpope/vim-fugitive', 'tpope/vim-fugitive',
'tpope/vim-rhubarb', 'tpope/vim-rhubarb',
--templ
'joerdav/templ.vim',
-- vim font -- vim font
'ryanoasis/vim-devicons', 'ryanoasis/vim-devicons',