Closed cuducos closed 1 year ago
In v2 this should be achievable via custom loaders (see #1162).
I think this would already possible with autocmd on BufEnter
inside setup
and if not vim.tbl_contains({"filetype2","filetype1"},vim.bo[args.buf]) load....
100% agree, @lewis6991! Once #1162 is merged, I think we can close this issue. Thank you so much.
Closed by #1162
Describe the feature
I love the
ft
config, as inuse {'FooBar/Baz', ft = 'bax'}
but sometimes I want a certain plugin to be available in everyft
but one or two.Use case
My use case is that a lot of treesitter + virualtext plugins do not make sense in languages that differ considerably in syntax from others, for example:
I would like to do, for example
use {'FooBar/Baz', exclude_ft = 'bax'}
and have this plugin working in everyft
butbax
.Concrete example
haringsrob/nvim_context_vt
makes a lot of sense for almost all languages I use in my routine, but Python. In Python, it just pollutes the buffer. This plugin in particular has an exclusion list byft
and my idea came from there: why not bring this option to all Packer-managed plugins?Possible implementation
I see that
ft
becomesfts
and then we create auto commands from them:https://github.com/wbthomason/packer.nvim/blob/d3ecfb4c8a33b46ea79356ef20b6a9e7789c86a2/lua/packer/compile.lua#L504-L514
We could do an extra check on that
for
loop to skipft
inexlude_fts
, e.g.:If that makes sense I am happy to open a PR, but as I have little experience with Lua I might need an bit of support and a few rounds of code reviews to make the PR production ready : )