diff --git a/lua/haelnorr/lazy/conform.lua b/lua/haelnorr/lazy/conform.lua index ed2ffa0..a24327d 100644 --- a/lua/haelnorr/lazy/conform.lua +++ b/lua/haelnorr/lazy/conform.lua @@ -17,6 +17,7 @@ return { json = { "prettierd", "prettier", stop_after_first = true }, html = { "prettierd", "prettier", stop_after_first = true }, css = { "prettierd", "prettier", stop_after_first = true }, + templ = { "templ", stop_after_first = true }, }, -- Set default options default_format_opts = { diff --git a/lua/haelnorr/lazy/feline.lua b/lua/haelnorr/lazy/feline.lua index fb5d6ee..c941fe5 100644 --- a/lua/haelnorr/lazy/feline.lua +++ b/lua/haelnorr/lazy/feline.lua @@ -1,12 +1,12 @@ return { - 'freddiehaddad/feline.nvim', - config = function () - local ctp_feline = require('catppuccin.groups.integrations.feline') + "feline-nvim/feline.nvim", + config = function() + local ctp_feline = require("catppuccin.groups.integrations.feline") - ctp_feline.setup() + ctp_feline.setup() - require("feline").setup({ - components = ctp_feline.get(), - }) - end + require("feline").setup({ + components = ctp_feline.get(), + }) + end, } diff --git a/lua/haelnorr/lazy/lsp.lua b/lua/haelnorr/lazy/lsp.lua index bcdde89..77cc8fa 100644 --- a/lua/haelnorr/lazy/lsp.lua +++ b/lua/haelnorr/lazy/lsp.lua @@ -31,6 +31,7 @@ return { vim.lsp.protocol.make_client_capabilities(), cmp_lsp.default_capabilities() ) + require("fidget").setup({}) require("mason").setup() require("mason-lspconfig").setup({ @@ -40,13 +41,14 @@ return { "bashls", "css_variables", "cssls", - "cssmodules_ls", "docker_compose_language_service", "dockerls", "gopls", "html", "jsonls", "pyright", + "tailwindcss", + "templ", "ts_ls", }, handlers = { @@ -70,6 +72,26 @@ return { }, }) end, + + ["templ"] = function() + local lspconfig = require("lspconfig") + lspconfig.templ.setup({ + capabilities = capabilities, + }) + end, + + ["html"] = function() + local lspconfig = require("lspconfig") + lspconfig.html.setup({ + capabilities = capabilities, + }) + end, + ["tailwindcss"] = function() + local lspconfig = require("lspconfig") + lspconfig.tailwindcss.setup({ + capabilities = capabilities, + }) + end, }, }) diff --git a/lua/haelnorr/lazy/which-key.lua b/lua/haelnorr/lazy/which-key.lua index a6f6b47..eaa3000 100644 --- a/lua/haelnorr/lazy/which-key.lua +++ b/lua/haelnorr/lazy/which-key.lua @@ -18,7 +18,6 @@ return { { "o", group = "Open plugin", icon = { icon = "", color = "yellow" } }, { "r", group = "Refactoring", mode = { "n", "x" } }, { "v", group = "LSP Actions", icon = { icon = "󰅡" } }, - { "l", "LspRestart", desc = "Restart LSP" }, { "", group = "Reload Plugins", icon = { icon = "" } }, { "w", "Lazy reload which-key.nvim", desc = "Reload Which-key" }, @@ -26,10 +25,12 @@ return { "s", "source ~/.config/nvim/lua/haelnorr/snippets/lua.lua\ source ~/.config/nvim/lua/haelnorr/snippets/go.lua\ + source ~/.config/nvim/lua/haelnorr/snippets/templ.lua\ Lazy reload LuaSnip", desc = "Reload LuaSnip", }, - { "l", "Lazy reload nvim-lspconfig", desc = "Reload LSP" }, + { "l", "LspRestart", desc = "Restart LSP" }, + { "c", "Lazy reload conform.nvim", desc = "Reload Conform" }, -- Harpoon -- Quick jumps and show list diff --git a/lua/haelnorr/snippets/go.lua b/lua/haelnorr/snippets/go.lua index a5e805b..8e8c118 100644 --- a/lua/haelnorr/snippets/go.lua +++ b/lua/haelnorr/snippets/go.lua @@ -146,4 +146,22 @@ if != nil { } ) ), + s( + "rh", + fmta( + [[ +func Handle() http.Handler { + return http.HandlerFunc( + func(w http.ResponseWriter, r *http.Request) { + + }, + ) +} +]], + { + name = i(1), + action = i(2), + } + ) + ), }) diff --git a/lua/haelnorr/snippets/templ.lua b/lua/haelnorr/snippets/templ.lua new file mode 100644 index 0000000..89d1211 --- /dev/null +++ b/lua/haelnorr/snippets/templ.lua @@ -0,0 +1,35 @@ +require("luasnip.session.snippet_collection").clear_snippets("templ") +local ls = require("luasnip") +local s = ls.snippet +local c = ls.choice_node +local d = ls.dynamic_node +local i = ls.insert_node +local t = ls.text_node +local sn = ls.snippet_node +local rep = require("luasnip.extras").rep +local fmt = require("luasnip.extras.fmt").fmt + +ls.add_snippets("templ", { + s( + "layout", + fmt( + [[ +package page + +import "projectreshoot/view/layout" + +templ {}() {{ + @layout.Global() {{ +
+ {} +
+ }} +}} + ]], + { + i(1, "Page"), + i(0), + } + ) + ), +})