Yeah, I’d write this as a single update
script with options to update vimplugins
or update pkg
or update all
.
I see that you want it to be a function so you can get the chdir as a side effect, but mixing that with updating doesn’t make sense to me.
Yeah, most distros will set up
source
chains to make things nicer for users.