filetype.nvim icon indicating copy to clipboard operation
filetype.nvim copied to clipboard

Make this a PR to Neovim core

Open mrjones2014 opened this issue 4 years ago • 12 comments

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.

mrjones2014 avatar Oct 20 '21 18:10 mrjones2014

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.

nathom avatar Oct 20 '21 20:10 nathom

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.

clason avatar Oct 21 '21 06:10 clason

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.

clason avatar Oct 24 '21 09:10 clason

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).

clason avatar Dec 03 '21 11:12 clason

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

syphar avatar Jan 27 '22 06:01 syphar

merged https://github.com/neovim/neovim/pull/16600

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

ttys3 avatar Feb 17 '22 02:02 ttys3

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.

clason avatar Feb 17 '22 07:02 clason

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

ahillio avatar Feb 21 '22 19:02 ahillio

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

clason avatar Feb 21 '22 19:02 clason

Thanks for clarifying :)

ahillio avatar Feb 21 '22 19:02 ahillio

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.

clason avatar Jul 08 '22 10:07 clason

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

hinell avatar Jan 13 '23 13:01 hinell