Coder Social home page Coder Social logo

Comments (19)

tjdevries avatar tjdevries commented on June 6, 2024

can you show your exact custom/plugins file? And to be clear, you put it in custom/plugins not costom/plugins right?

from kickstart.nvim.

BKDevelop avatar BKDevelop commented on June 6, 2024

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!

from kickstart.nvim.

tjdevries avatar tjdevries commented on June 6, 2024

No problem at all :) have a good day

from kickstart.nvim.

jby avatar jby commented on June 6, 2024

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
	})

from kickstart.nvim.

BKDevelop avatar BKDevelop commented on June 6, 2024

I think the file needs to be located at

$HOME/.config/nvim/lua/custom/plugins.lua

from kickstart.nvim.

jby avatar jby commented on June 6, 2024

Yes, sorry - my mistake... :(

from kickstart.nvim.

jby avatar jby commented on June 6, 2024

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
	})
end

and 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?

from kickstart.nvim.

LudoPinelli avatar LudoPinelli commented on June 6, 2024

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() whith require('luasnip.loader.from_vscode').lazy_load().

from kickstart.nvim.

jby avatar jby commented on June 6, 2024

I'd guess it's these (rather than ~/.config/cache/nvim, especially since I don't have a cache dir in ~/.config) that I should remove?
image
However a :PackerInstall does nothing...

from kickstart.nvim.

jby avatar jby commented on June 6, 2024

I'm pretty sure though, that if I were to remove the above I would no longer have the nvim-tree plugin installed...

from kickstart.nvim.

LudoPinelli avatar LudoPinelli commented on June 6, 2024

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.lua you showed is only a snippet or the entire file. If it is the entire file, a }) is missing, also nvim-web-devicons should 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
	})
end

from kickstart.nvim.

jby avatar jby commented on June 6, 2024

Ok, thanks - but still - no install of the plugins in the custom file.
I did remove ~/.local/share/nvim and when I restarted it re-installed everything again - but not the plugins in the custom file:
image

from kickstart.nvim.

jby avatar jby commented on June 6, 2024

Albeit 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 chunk

from kickstart.nvim.

jby avatar jby commented on June 6, 2024

So - the ~/.config/nvim/after/plugin/defaults.lua definitively is read, but apparently not the ~/.config/nvim/lua/custom/plugins.lua

from kickstart.nvim.

jby avatar jby commented on June 6, 2024

Hmm, my ~/.config/nvim/lua/custom/plugins.lua doesn't even seem to be read even if I ignore the logic that's supposed to look for it and manually specify it in init.lua like this:

(require 'custom.plugins')

My ~/.config/nvim/lua/custom/plugins.lua now:

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

from kickstart.nvim.

jby avatar jby commented on June 6, 2024

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 the custom.plugins rather useless?

from kickstart.nvim.

LudoPinelli avatar LudoPinelli commented on June 6, 2024

Doesn't that kind of make the custom.plugins rather useless?

Sure but it seems that you are the only one with this problem, I'm sorry, I'm running out of ideas.

from kickstart.nvim.

jby avatar jby commented on June 6, 2024

I kind of feel like I've hi-jacked someone else's, already closed, issue here. Maybe I should create my own instead?

from kickstart.nvim.

jby avatar jby commented on June 6, 2024

Created #176 instead

from kickstart.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.