Currently, packer puts the compiled loader script in stdpath('config')/plugins. Since I sync stdpath('config') across multiple machines, this often leads to conflicts on :PackerSync.
Since the script is generated from user config, I believe it would be more appropriate to put it in stdpath('cache') or stdpath('data') (where rplugin.vim is placed, for example). In particular, the latter would be easy to handle without new logic by just putting it in, say .local/share/nvim/site/pack/loader/start/packer/plugin/ instead of .config/nvim/plugin. (I tested this.)
(Vim packages allow multiple parallel pack/**/start directories, all of which are automatically visible to vim. In fact, I believe the original idea for packages was that each package would have its own pack/<package>/start and pack/<package>/opt directory, where start serves as a replacement for autoload.)
@clason I believe changing compile_path in packer setup function is all you need todo. But I agree the default should be out of user config
I'm happy to make this change, but I need to think about/figure out the right way to change over from the old default. In particular, we don't want two packer_compiled files; we need to either move or delete the old file. This should probably happen via a shim that checks if there's a file in the old location and, if so, prints a warning and deletes the file. We can remove this shim after a month or two.
Agreed, but I don't see the need to be particularly clever about it -- it's not that the old location is not working. Wouldn't it be enough for PackerCompile to check if packer_compiled exists in the old location; if so, delete it; and then write it in the new location? (This check can be removed after a while, of course.) Or is that what you meant by "shim"?
That is exactly what I was suggesting with the "shim", yes. Sorry, that comment was >50% me thinking aloud about the right way to do this.
Most helpful comment
@clason I believe changing
compile_pathin packer setup function is all you need todo. But I agree the default should be out of user config