-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Templates plugin on Neovim #140
Comments
That plugin is not working for me, I just put this code to my lua vim config, it force nvim think .stpl is .html file local autocmd = vim.api.nvim_create_autocmd
autocmd({
"BufNewFile",
"BufRead",
}, {
pattern = "*.stpl",
callback = function()
if vim.fn.search("{{.\\+}}", "nw") ~= 0 then
local buf = vim.api.nvim_get_current_buf()
vim.api.nvim_buf_set_option(buf, "filetype", "html")
end
end,
}) |
@gengjun thanks for your answer I have no problem with Neovim detecting the HTML part, I think, with my setup, if it doesn't know the extension it looks inside and infers the language. And if you want to enforce it, you can do something simpler : vim.filetype.add({
extension = {
stpl = 'html',
}
}) My problem is that the Rust part of my templates is not detected as Rust code. |
I stumbled upon this video from TJ DeVries So I tried the Tree Sitter Playground. |
apologies I'm a neovim newbie. |
I have troubles using the "rust-sailfish/sailfish" plugin.
I’m using Packer on Neovim :
use 'rust-sailfish/sailfish'
I checked and the package is installed
but when I access a .stpl file, my :LspInfo doesn’t recognize the filetype.
So the plugin is not loaded.
My LSP plugins are 'VonHeikemen/lsp-zero.nvim' with 'neovim/nvim-lspconfig'
I’m pretty sure I miss a step, can someone help me ?
The text was updated successfully, but these errors were encountered: