Updated some snippets and fixed feline
This commit is contained in:
@@ -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 = {
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ return {
|
||||
{ "<leader>o", group = "Open plugin", icon = { icon = "", color = "yellow" } },
|
||||
{ "<leader>r", group = "Refactoring", mode = { "n", "x" } },
|
||||
{ "<leader>v", group = "LSP Actions", icon = { icon = "" } },
|
||||
{ "<leader>l", "<cmd>LspRestart<CR>", desc = "Restart LSP" },
|
||||
|
||||
{ "<leader><leader>", group = "Reload Plugins", icon = { icon = "" } },
|
||||
{ "<leader><leader>w", "<cmd>Lazy reload which-key.nvim<CR>", desc = "Reload Which-key" },
|
||||
@@ -26,10 +25,12 @@ return {
|
||||
"<leader><leader>s",
|
||||
"<cmd>source ~/.config/nvim/lua/haelnorr/snippets/lua.lua<CR>\
|
||||
<cmd>source ~/.config/nvim/lua/haelnorr/snippets/go.lua<CR>\
|
||||
<cmd>source ~/.config/nvim/lua/haelnorr/snippets/templ.lua<CR>\
|
||||
<cmd>Lazy reload LuaSnip<CR>",
|
||||
desc = "Reload LuaSnip",
|
||||
},
|
||||
{ "<leader><leader>l", "<cmd>Lazy reload nvim-lspconfig<CR>", desc = "Reload LSP" },
|
||||
{ "<leader><leader>l", "<cmd>LspRestart<CR>", desc = "Restart LSP" },
|
||||
{ "<leader><leader>c", "<cmd>Lazy reload conform.nvim<CR>", desc = "Reload Conform" },
|
||||
|
||||
-- Harpoon
|
||||
-- Quick jumps and show list
|
||||
|
||||
@@ -146,4 +146,22 @@ if <err_same> != nil {
|
||||
}
|
||||
)
|
||||
),
|
||||
s(
|
||||
"rh",
|
||||
fmta(
|
||||
[[
|
||||
func Handle<name>() http.Handler {
|
||||
return http.HandlerFunc(
|
||||
func(w http.ResponseWriter, r *http.Request) {
|
||||
<action>
|
||||
},
|
||||
)
|
||||
}
|
||||
]],
|
||||
{
|
||||
name = i(1),
|
||||
action = i(2),
|
||||
}
|
||||
)
|
||||
),
|
||||
})
|
||||
|
||||
35
lua/haelnorr/snippets/templ.lua
Normal file
35
lua/haelnorr/snippets/templ.lua
Normal file
@@ -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() {{
|
||||
<div class="">
|
||||
{}
|
||||
</div>
|
||||
}}
|
||||
}}
|
||||
]],
|
||||
{
|
||||
i(1, "Page"),
|
||||
i(0),
|
||||
}
|
||||
)
|
||||
),
|
||||
})
|
||||
Reference in New Issue
Block a user