-
Notifications
You must be signed in to change notification settings - Fork 36
filetype.nvim breaks ftdetect #9
Comments
I think adding support for user defined filetypes is a good idea. However, I won't include sourcing other |
Also there should be a way to override default mappings. What to you think? |
Oh dang, yeah. Just realized this. I have a few custom ftdetect autocommands and I would love to replace them with additional configuration for this plugin. I moved them to a file that I know will be sourced for now. |
@nathom Just checking out your dev branch. Looking good, thanks lot! One problem I am seeing is my custom literal override: require('filetype').setup {
overrides = {
literal = {
['something.log'] = 'somethinglog',
},
complex = {
['.*zsh/fpath/'] = 'zsh',
['.*ssh/config'] = 'sshconfig',
},
},
} When I open |
This issue is one of the things that was stopping me from using the otherwise great plugin. I have one question regarding the fix, how does it help a plugin developer? If I install a plugin, and it has its own file type detection, do I have to manually enter the filetypes in to the new setup function call? |
I personally just have this at the top of my vim.g.did_load_filetypes = 1
vim.cmd([[ runtime! ftdetect/*.vim]])
vim.cmd([[runtime! ftdetect/*.lua]]) I know the point of the plugin is to avoid loading more than 1 filetype setting autocmd, but the vast majority is still in I can't imagine legacy filetype plugin authors ever catering to |
It seems that this is an ordering issue. The regexes always run after the extension and literal tables, so they will get overridden. Maybe I'll need to keep a separate overrides table that has precedence over the rest. |
It seems to be fixed in main now. And since there is a way to provide overrides (no need for ftdetect, unless some other plugins/etc need it) I will close that issue as it's all working for me now. Can you see any issues with not having those |
Reopening as per #41 (comment) |
While the current state is fine for personal |
I strongly agree with @clason , this has broken the many filetype plugins that I use, and I think the general assumption would be that these would still work. I think a mention of this issue in the README in the meantime would also be useful. |
Unfortunately it also break https://github.com/kassio/neoterm, because it relies on 'ftdetect' folder for its core logic. |
PSA: That means this plugin is free to take a more opinionated approach without concern for backward compatibility, if desired. (Although it would be good to keep |
The plugin is no longer necessary in neovim 0.8 See: nathom/filetype.nvim#9 (comment)
Nice plugin, thanks!
Given
/usr/local/Cellar/neovim/<ver>/share/nvim/runtime/filetype.vim
is not fully loaded because ofvim.g.did_load_filetypes = 1
it also does not loadwhich is part of it. This breaks user's custom filetypes specs from
ftdetect/
directory.Do you think that
Thanks!
Edit: since that only invokes autocmds specified in those files feel free to ignore that question/request as it's easy to just move those autocmds to some other sourced file.
The text was updated successfully, but these errors were encountered: