-
-
Notifications
You must be signed in to change notification settings - Fork 266
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
Clear definition between install and update hooks #1050
Comments
Right now, |
Thanks for the reply! For the moment, I've got around the issue by changing run to a function that only runs the command if it exists: ...
run = function()
if vim.fn.exists(':TSUpdate') == 2 then
vim.cmd(':TSUpdate')
end
end,
... |
I've done a small PR that implements a solution for this, let me know if it's what you had in mind! |
The odd thing is that: use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' } is actually given as an example in the Forgetting about the specifics of treesitter for the moment, if a plugin requires that you run some setup code once, immediately after installation, and this setup code depends on the plugin being loaded, is |
Describe the feature
I've got this minimal
init.lua
which installs packer and thennvim-treesitter
. I've gotrun = ':TSUpdate'
set but I get an error thatTSUpdate
is not an editor command. I'm not sure if this is a bug or if it's only supposed to be run on update rather than install? If it isn't a bug, how can I tell in a run function whether it's being run as part of an install or update hook?Demo
Use the
init.lua
below, remove any packer files withrm -Rf ~/.local/share/nvim/site/pack/packer ~/.config/nvim/plugin/packer_compiled.lua
, then open neoviminit.lua
The text was updated successfully, but these errors were encountered: