Repository navigation
Defined plugins in 'custom.plugins' are not synced #34
Description
Activity
can you show your exact
custom/pluginsfile? And to be clear, you put it incustom/pluginsnotcostom/pluginsright?Sorry for the late reply. Had the chance to try this on a different machine today... It works just fine!
I assume PEBKAC on my last attempt - sorry for the inconvinience!
No problem at all :) have a good day
I'm seeing the exact same behaviour here.
My $HOME/.config/nvim/custom/plugins.lua:return function(use) use({ 'nvim-tree/nvim-tree.lua' config = function() require("nvim-tree").setup() 'nvim-tree/nvim-web-devicons' end })I think the file needs to be located at
$HOME/.config/nvim/lua/custom/plugins.lua
Yes, sorry - my mistake... :(
However, it would seem that the custom/plugins.lua is only read for config of the plugin. Packer doesn't seem to see any plugins included in it...
I now have 3 plugins configured in it:return function(use) -- Configure nvim-tree use({ 'nvim-tree/nvim-tree.lua' config = function() require("nvim-tree").setup() 'nvim-tree/nvim-web-devicons' end -- Add friendly snippets use({ 'rafamadriz/friendly-snippets' config = function () require("friendly-snippets").setup() end }) endand it never installs 'friendly-snippets', and if I run PackerSync manually it always asks if it can remove the unused nvim-tree plugins... (which were installed when I had them in init.lua, which was when I had the wrong path to my custom/plugins.lua)
It does read the nvim-tree config though, since I can create a keymap for it in my after/plugin/defaults.lua...
What am I doing wrong?Hi @jby,
It works fine for me, have you tried:PackerInstall(before:PackerSync)?
Also, for PackerSync always asking to remove the old nvim-tree, you can try to delete this folders:
~/.config/cache/nvim
It will rebuild it the next time you launch neovim.EDIT: also for friendly-snippets to be taken into account by luasnip you have to replace the line
require('friendly-snippets').setup()whithrequire('luasnip.loader.from_vscode').lazy_load().I'm pretty sure though, that if I were to remove the above I would no longer have the nvim-tree plugin installed...
You can remove
~/.local/share/nvim, it will reset your config and reinstall everything (you may have to restart neovim a couple of time for everything to be set up).I don't knwow if the
custom/plugins.luayou showed is only a snippet or the entire file. If it is the entire file, a})is missing, alsonvim-web-deviconsshould be required. Here is the file with the corrections :return function(use) -- Configure nvim-tree use({ {'nvim-tree/nvim-tree.lua', requires = 'nvim-tree/nvim-web-devicons'}, config = function() require("nvim-tree").setup() 'nvim-tree/nvim-web-devicons' end }) -- Add friendly snippets use({ 'rafamadriz/friendly-snippets' config = function () require("luasnip.loaders.from_vscode").lazy_load() end }) endAlbeit it does look for it since I've configured it...
Error detected while processing /Users/jonasb/src/jby/nvim/after/plugin/defaults.lua: E5113: Error while calling lua chunk: /Users/jonasb/src/jby/nvim/after/plugin/defaults.lua:4: module 'nvim-tree' not found: no field package.preload['nvim-tree'] no file './nvim-tree.lua' no file '/usr/local/share/luajit-2.1.0-beta3/nvim-tree.lua' no file '/usr/local/share/lua/5.1/nvim-tree.lua' no file '/usr/local/share/lua/5.1/nvim-tree/init.lua' no file '/Users/jonasb/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/nvim-tree.lua' no file '/Users/jonasb/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/nvim-tree/init.lua' no file '/Users/jonasb/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/nvim-tree.lua' no file '/Users/jonasb/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/nvim-tree/init.lua' no file './nvim-tree.so' no file '/usr/local/lib/lua/5.1/nvim-tree.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file '/Users/jonasb/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/nvim-tree.so' stack traceback: [C]: in function 'require' /Users/jonasb/src/jby/nvim/after/plugin/defaults.lua:4: in main chunkSo - the ~/.config/nvim/after/plugin/defaults.lua definitively is read, but apparently not the ~/.config/nvim/lua/custom/plugins.lua
Hmm, my
~/.config/nvim/lua/custom/plugins.luadoesn't even seem to be read even if I ignore the logic that's supposed to look for it and manually specify it ininit.lualike this:(require 'custom.plugins')My
~/.config/nvim/lua/custom/plugins.luanow:return function(use) -- Configure nvim-tree use({ {'nvim-tree/nvim-tree.lua', requires = 'nvim-tree/nvim-web-devicons'}, config = function() require("nvim-tree").setup() 'nvim-tree/nvim-web-devicons' end }) -- Add friendly snippets use({ 'rafamadriz/friendly-snippets', config = function () require('luasnip.loader.from_vscode').lazy_load() end }) -- // Comment.nvim use { 'numToStr/Comment.nvim', config = function() require('Comment').setup() end } end
The only way, so far I get the plugins I want to add to actually be installed and used is to add them to
init.lua...
Doesn't that kind of make thecustom.pluginsrather useless?Doesn't that kind of make the
custom.pluginsrather useless?Sure but it seems that you are the only one with this problem, I'm sorry, I'm running out of ideas.
I kind of feel like I've hi-jacked someone else's, already closed, issue here. Maybe I should create my own instead?
Created #176 instead


The latest change introduced the option to use a seperate file for defining plugins ootb. At least on my machine, this does not seem to work as expected.
How to reproduce
~/.config/nvimlua/costum/plugins.lua:PackerSyncCan anybody reproduce this, or is there something wrong with my setup? Thx