nathom / filetype.nvim

A faster version of filetype.vim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make this a PR to Neovim core

mrjones2014 opened this issue · comments

commented

If this is really this much better and works consistently and as well as filetype.vim then IMO it should be included in Neovim core, to outright replace filetype.vim. Just a suggestion.

Because this plugin is relatively new, there will still be edge cases that need to be sorted out. I might do this once it reaches a more stable state.

Core is well aware of this plugin, and pretty much of the same opinion: worthwhile, but should be done carefully to avoid regressions. The more people test it now, the better :)

Friction points to moving it upstream (which can all be overcome):

  1. It's quite likely that a significant number of tests would need to be adapted.
  2. It'll make it (slightly) harder to port Vim patches adding new filetypes or changing the detection.
  3. The main benefit here is not Lua but the single autocommand -- would be good to quantify this (and ideally, if Vimscript is enough, make a PR to Vim).
  4. To get the full benefit, you want this as a native Lua autocommand (i.e., without wrapping it in :lua ...), which is a non-trivial PR that is currently progressing slowly due to lack of time.

An intermediate step could be to move this into https://github.com/nvim-lua/plenary.nvim (the "Neovim nursery") -- in particular, integrating this into https://github.com/nvim-lua/plenary.nvim#plenaryfiletype.

In the meantime, it would be useful for this plugin to stay (reasonably) up-to-date with the filetype.vim updates from upstream -- I'm sure these would be welcome and straightforward PRs for anybody interested in this project.

Another very useful thing would be to test (ideally as a CI job!) whether Neovim's filetype test still passes with this plugin (and if not, ensure that it does).

I believe we can close this issue, since neovim added filetype.lua, see also the discussion on reddit

commented

merged neovim/neovim#16600

does this mean if using the nightly version, this plugin is not needed anymore?

Note that the built-in Lua filetype detection behaves somewhat differently (for the above-mentioned reasons), so you might still prefer to use this plugin.

Wow cool... so will that merge/commit be included in the 0.6.2 release?

No. Features are not backported to release branches, so this will only be in 0.7.0.

Thanks for clarifying :)

Update: filetype.lua is now the default on Neovim master (and 0.8.0, when that is released). It has full parity with filetype.vim (including scripts.vim and setf FALLBACK support), passing Vim's filetype detection test suite. It will be kept in sync with future filetype detection changes in Vim and should thus be a safe and non-breaking replacement.

I believe this issue can be closed now.

Please close the issue, the patch has landed into Neovim already. See: