wbthomason / packer.nvim

A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config
MIT License
7.85k stars 265 forks source link

Question: work with native packages #1167

Closed hacker-DOM closed 1 year ago

hacker-DOM commented 1 year ago

From https://vi.stackexchange.com/questions/39517/why-doesnt-packadd-work-with-packer:

Say you have a bunch of packages installed with packer. I inspected the file structure and it seems to me they are in the format of native Vim packages. Great news! That means we should be able to:

nvim --clean
:packadd [some-package]

and get all of its commands and functionality.

But it doesn't work :( What is the technical reason for this, I feel like the above approach would be super useful for isolating the behavior of a package

wbthomason commented 1 year ago

This is due to how nvim --clean sets packpath vs a normal start. Note that from :h --clean, it "Excludes user directories from 'runtimepath'" - this extends to packpath as well. You could try manually adding your packer install location (e.g. ~/.local/share/nvim/site by default) to your packpath after starting with nvim --clean to get the desired behavior.

hacker-DOM commented 1 year ago

Indeed, this worked for me: (I am on MacOS)

:set packpath+=/Users/dteiml/.local/share/nvim/site