Skip to content
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

Neovim: How to override filetype with vim.filetype.add? #857

Open
JohnTheCoolingFan opened this issue Aug 20, 2024 · 1 comment
Open

Neovim: How to override filetype with vim.filetype.add? #857

JohnTheCoolingFan opened this issue Aug 20, 2024 · 1 comment

Comments

@JohnTheCoolingFan
Copy link

I am setting up neovim to have a custom filetype for files with a name `chaneglog.txt':

vim.filetype.add({
    filename = {
        ['changelog.txt'] = 'factorio-changelog'
    }
})

But when I open a changelog.txt file, the filetype property gets overriden to changelog by vim-polyglot. Disabling the plugin lets the above lua rule work. How can this be disabled? I've tried vim.g.polyglot_disable = {"changelog"} but it had no effect.

@JohnTheCoolingFan
Copy link
Author

I have ended up disabling this plugin in favor of tree-sitter and filetype-specific plugins, although having support for more filetypes that won't clash with custom ones would be much better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant