r/neovim • u/thestoiccoder • 1d ago
Need Help Looking for an HTML template plugin (simpler solution always welcome)
So I used NvChad for what seemed like forever.
But ever since version 0.12 I've been keeping things VERY minimal. I haven't done any web dev stuff in a long time, so I guess it would make sense that something like this would go unnoticed.
I'm not the biggest Lua fan...I mean I'd like to get better at it eventually, so for the time being I just sort of tolerate it and ever since the major update things have been kind of confusing.
But to get to the main point of this post; I was curious if there was some kind of plugin that could help me create an HTML template? It would be great if I didn't need another and there was a simpler solution that I'm not seeing.
Currently the plugins I'm using that I suspect would be related to the subject are:
mason, nvim-lspconfig, mason-lspconfig, and mason-tool-installer.
I'm also using the superhtml lsp, and while the popup works, apparently I guess it doesn't have any kind of "!DOCTYPE html" selection. I even tried the emmet-language server and that didn't work either.
I've never used it but, by any chance would blink.cmp solve this?
Any advice or feedback of course would be greatly appreciated. Many thanks in advance.
7
u/trh-x 23h ago
You can use the built-in skeleton feature (
:help skeleton) to use a template every time you open a new HTML file. Add the template somewhere, e.g.~/.config/nvim/skeleton.html:Then add this to your
init.lua:Now
nvim foo.htmlor:edit foo.htmlwill inject the template into the buffer for the new file.2
u/Wonderful-Plastic316 lua 11h ago
It's funny how "minimalism" is a personal thing. I wouldn't consider mason and co to be "minimal", but if it fits your needs :p
2
u/MikeZ-FSU 6h ago
I usually just keep a template file in a directory and copy it to the new name. If it is something that I would tend to parameterize, I run it through one of the bazillion template engines, usually jinja, mustache, or gomplate with appropriate data definitions.
1
u/Intrepid_Refuse_332 1d ago edited 1d ago
Install emmet language server from Mason then type `!` to get auto complete if you have it enabled already. Or manually trigger it with C-x C-o
Then check out the emmet cheat sheet.