feat(nvim): add support for templ
This commit is contained in:
parent
f38b893ca9
commit
b8eb57b652
4 changed files with 15 additions and 1 deletions
|
@ -4,7 +4,7 @@ capabilities.textDocument.completion.completionItem.snippetSupport = true
|
|||
|
||||
require('lspconfig').html.setup {
|
||||
capabilities = capabilities,
|
||||
filetypes = { "html", "template", "handlebars" },
|
||||
filetypes = { "html", "template", "handlebars", "templ" },
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -11,5 +11,6 @@ require('lsp.gopls')
|
|||
require('lsp.html')
|
||||
require('lsp.jdtls')
|
||||
require('lsp.tailwindcss')
|
||||
require('lsp.templ')
|
||||
require('lsp.tsserver')
|
||||
require('lsp.v_analyzer')
|
||||
|
|
8
nvim/.config/nvim/lua/lsp/templ.lua
Normal file
8
nvim/.config/nvim/lua/lsp/templ.lua
Normal file
|
@ -0,0 +1,8 @@
|
|||
require('lspconfig').templ.setup{}
|
||||
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
pattern = "*.templ",
|
||||
callback = function()
|
||||
vim.lsp.buf.format({ async = false })
|
||||
end
|
||||
})
|
|
@ -6,3 +6,8 @@ vim.cmd [[
|
|||
autocmd FileType template setlocal ts=2 sts=2 sw=2 expandtab
|
||||
augroup END
|
||||
]]
|
||||
|
||||
vim.filetype.add({ extension = { templ = "templ" } })
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue