# neovim autoload plugin directory



## Alain De Vos (Dec 4, 2021)

Where is the neovim autoload plugin directory ?
And how do i list all plugins loaded.
I found two directories via google, but don't know which one is correct:

```
~/.config/nvim/autoload/
```


```
~/.local/share/nvim/site/pack/plugins/start/
```

emacs looks like an overkill & neovim has many plugins.


----------



## any_name_you_wish (Dec 4, 2021)

Alain De Vos said:


> `~/.local/share/nvim/site/pack/plugins/start/`


This one.

In my case :
`$cd  .local/share/nvim/site/pack/my_plugins/start/
xxx@xx:~/.local/share/nvim/site/pack/my_plugins/start $ ls
formatter.nvim    nvim-lspconfig    nvim-comment`


----------



## Erichans (Dec 4, 2021)

Unfortunately, on its main website page of neovim the documentation link(*) results in a 404 but, there is documentation on its website.

Apart from a global plugin (automatically loaded) there is the filetype plugin: Adding a plugin -> FILETYPE PLUGINS. Various options for those in UNIX-like systems are:

~/.local/share/nvim/site/ftplugin/<filetype>.vim
~/.local/share/nvim/site/ftplugin/<filetype>_<name>.vim
~/.local/share/nvim/site/ftplugin/<filetype>/<name>.vim
Located at ~/.local/share/nvim/site/pack/<package-name> are packages: Adding a package

I think you want the automatically loaded global plugin Adding a plugin -> USING A GLOBAL PLUGIN facility:

```
First read the text in the plugin itself to check for any special conditions.
Then copy the file to your plugin directory:

    system        plugin directory
    Unix        ~/.local/share/nvim/site/plugin
[...]
Instead of putting plugins directly into the plugin/ directory, you may
better organize them by putting them into subdirectories under plugin/.
As an example, consider using "~/.local/share/nvim/site/plugin/perl/*.vim" for
all your Perl plugins.
```

I do not know if there is one command that shows all plugins, i.e. lists global plugins, filetype plugins and perhaps even packages; best option seems to inspect all relevant directories.

As mentioned in the release documentation of Neovim v0.5.0  here, it seems there has been a substantial growth in plugins/packages for neovim. Several plugin/package managers exist; this may also help: How to set up Neovim 0.5 + Modern plugins (LSP, Treesitter, Fuzzy finder, etc)

___
(*) Edit: the documentation link should probably be: https://neovim.io/doc/general/


----------



## any_name_you_wish (Dec 4, 2021)

I was using this description:

https://neovim.io/doc/user/repeat.html#packages

Or just call
	
	



```
:h package
```
 within nvim.


----------



## Holger (Jan 4, 2022)

Having the same issue here as OP trying to install `plug.vim`. Nothing worked:

```
~/.local/share/nvim/site/autoload/plug.vim
~/.local/share/nvim/site/pack/plugins/start/plug.vim
~/.local/share/nvim/site/plugin/plug.vim
...
```

I tested it with running `nvim` and calling

```
:PlugInstall
```
and

```
:PlugStatus
```
Both yielding an error message that these are not valid editor commands.

It's really frustrating!

Any help?


----------



## Fuzzbox (Jan 4, 2022)

Holger said:


> Having the same issue here as OP trying to install `plug.vim`.



Afaict, my plug.vim is in ~/.config/nvim/autoload/, and I've created a ~/.local/share/nvim/plugged/ directory where the plugins listed in my init.vim are installed by plug.vim using PlugInstall...


----------



## Erichans (Jan 4, 2022)

Somehow, it looks like your choosen plugin manager `plug.vim` is not functional. You could try to source it from within nvim:

```
:source ~/.config/nvim/init.vim
```
take into account which configuration file you use for your nvim installation and then try `:PlugInstall`
However, if  `plug.vim` is put at the right place it should get autoloaded when nvim is started.

For `plug.vim` to work you need three things:

plug.vim in a place where it will be autoloaded, for example ~/.local/share/nvim/site/autoload/plug.vim
in your configuration file, for example: ~/.config/nvim/init.vim, you need some code that will install plugins in a certain directory, like ~/.local/share/nvim/plugged/
specify the plugins you want to install inside the code mentioned at #2
With a clean install of nvim, I followed the instructions for the steps #1-3 as mentioned in the vim-plug Tutorial. You could make some changes to the directories named there but, try those mentioned there first. Following the instructions of the tutorial `:PlugInstall`, `:PlugStatus` and `:PlugUpdate` are all functional.


----------



## Holger (Jan 5, 2022)

Erichans said:


> Somehow, it looks like your choosen plugin manager `plug.vim` is not functional. You could try to source it from within nvim:
> 
> ```
> :source ~/.config/nvim/init.vim
> ...


Thank you! It finally worked: It did not suffice to put `plug.vim` into the appropriate directory, there has to be the basic plugin initialization code in `init.vim` (as you point out in step 2.) Otherwise `nvim` will not load the plugin altogether (some sort of lazy evaluation?) and `:PlugStatus` et al. won't work.


----------

