filetype.nvim
filetype.nvim copied to clipboard
Unknown function: dist#ft# FTVB
i am getting this error on opening .bas
file
full error
Error detected while processing BufNewFile Autocommands for "*":
E5108: Error executing lua ...r/start/filetype.nvim/lua/filetype/mappings/function.lua:256: Vim(call):E117: Unknown function: dist#ft#
FTVB
stack traceback:
[C]: in function 'cmd'
...r/start/filetype.nvim/lua/filetype/mappings/function.lua:256: in function 'name'
...te/pack/packer/start/filetype.nvim/lua/filetype/init.lua:17: in function 'set_filetype'
...te/pack/packer/start/filetype.nvim/lua/filetype/init.lua:65: in function 'try_lookup'
...te/pack/packer/start/filetype.nvim/lua/filetype/init.lua:168: in function 'resolve'
[string ":lua"]:1: in main chunk
I've been having the same issue, this may be a rough workaround but I managed to avoid this error by using the following configuration:
local filetype_ok, filetype = pcall(require, "filetype")
if not filetype_ok then
vim.api.nvim_command([[echoerr "Error while loading filetype.nvim"]])
return
end
filetype.setup({
overrides = {
extensions = {
bas = "basic"
}
}
})
-- Do not source the default filetype.vim
vim.g.did_load_filetypes = 1
I was just coming to report the same error, since I finally took the time to figure out what was breaking.
I was able to open javascript files just fine, but typescript or .sh files were where I was getting the errors.
I did try the solution suggested by @Penaz91, and I'm not getting errors for *.ts files anymore, but I am still getting them for *.sh files
Neovim removed the flie that defined these functions in https://github.com/neovim/neovim/commit/042eb74ff1ed63d79f8a642649cd6be6ec4b0eb9. The plugin should be updated to use the new filetype detection functions.
I've got the same issue since a couple of weeks.
I've been having the same issue, this may be a rough workaround but I managed to avoid this error by using the following configuration:
local filetype_ok, filetype = pcall(require, "filetype") if not filetype_ok then vim.api.nvim_command([[echoerr "Error while loading filetype.nvim"]]) return end filetype.setup({ overrides = { extensions = { bas = "basic" } } }) -- Do not source the default filetype.vim vim.g.did_load_filetypes = 1
Is only to get rid of the error but does not solve any highlighting or code completion issues.
I've got the same issue since a couple of weeks.
I've been having the same issue, this may be a rough workaround but I managed to avoid this error by using the following configuration:
local filetype_ok, filetype = pcall(require, "filetype") if not filetype_ok then vim.api.nvim_command([[echoerr "Error while loading filetype.nvim"]]) return end filetype.setup({ overrides = { extensions = { bas = "basic" } } }) -- Do not source the default filetype.vim vim.g.did_load_filetypes = 1
Is only to get rid of the error but does not solve any highlighting or code completion issues.
especially if you pair it with auto-session plugin, you get error everytime it tries to restore session
I get the same issue trying to open .html files. I found a temporary solution to add line:
["html"] = "html",
to mappings/extensions.lua file.
This seem to work with other currently broken extensions as well. Highlighting and autocompletion works for me.
This is probably just the same answer as above, I'm not very into lua.
FWIW, newer versions of nvim have their own "filetype lua script" integrated which can be activated as follows:
vim.g.do_filetype_lua = true
vim.g.did_load_filetypes = false
You can see more here: https://neovim.discourse.group/t/introducing-filetype-lua-and-a-call-for-help/1806
Adding to @Penaz91's comment, if you're using Nvim v0.8+, filetype.lua
is already enabled by default, so there is no need to add the suggested lines to your configuration.