Giter VIP home page Giter VIP logo

Comments (8)

aileot avatar aileot commented on May 28, 2024

Thank you for the kind comment :)

To use macros before registering it with plugin manager, we have to add the root paths of macros to 'runtimepath' manually.

It is common to do that when we write our config on some features of such plugins as runtime compiler, macros, any other Lua/Vimscript functions, or plugin manager itself.

In most cases, plugin manager should only manage the versions for such plugins.

Thus, lazy.nvim can support nvim-laurel on version control, but we need another script to make sure nvim-laurel macros are ready in 'runtimepath' before. For example,

-- In init.lua or somewhere else

local function prerequisites(name, url)
  -- To manage the version of repo, the path should be where your plugin manager will download it.
  -- In this example, I use lazy.nvim because it specifies its default download path and it manages plugins without 'packpath'.
  -- Adjust `dir` if you prefer another plugin manager.
	local dir = vim.fn.stdpath("data") .. "/lazy"
	local path = dir .. "/" .. name
	if not vim.loop.fs_stat(path) then
		vim.fn.system({
			"git",
			"clone",
			"--filter=blob:none",
			"--single-branch",
			url,
			path,
		})
	end
	vim.opt.runtimepath:prepend(path)
end

-- Install your favorite plugin manager.
prerequisites("lazy.nvim", "https://github.com/folke/lazy.nvim")
-- prerequisites("packer.nvim", "https://github.com/wbthomason/packer.nvim")
-- prerequisites("dein.vim", "https://github.com/Shougo/dein.vim")

-- Install macros like nvim-laurel
prerequisites("nvim-laurel", "https://github.com/aileot/nvim-laurel")

-- Install a runtime compiler if you feel like
prerequisites("hotpot.nvim", "https://github.com/rktjmp/hotpot.nvim")

require("hotpot").setup({
	compiler = {
		macros = {
			env = "_COMPILER",
			allowedGlobals = false,
		},
	},
})

require("load-plugins-by-lazy")
;; In ~/.config/nvim/fnl/load-plugins-by-lazy.fnl

(local lazy (require :lazy))
(local opts {:defaults {:lazy true}})

;; Just manage their versions
(lazy.setup [:rktjmp/hotpot.nvim
             :aileot/nvim-laurel
             ...]
            opts)

P.S. I have updated nvim-fnl, a part of my private dotfiles. I hope it can be of some help to you ;)

from nvim-laurel.

luxus avatar luxus commented on May 28, 2024

i guess the files are ~/.config/nvim/init.lua ~/.config/nvim/fnl/load-plugins-by-lazy.fnl ?
i tried different versions.. but lazy try to download it from git?
Screenshot 2022-12-21 at 16 03 33

from nvim-laurel.

aileot avatar aileot commented on May 28, 2024

Yes, you are right. The path was wrong. I fixed the path in the snippet above.
I mean it as a sample local module to manage plugins with lazy.nvim in Fennel.

from nvim-laurel.

luxus avatar luxus commented on May 28, 2024

Ah, okay, my bad; I thought this was a working example; I think I was too tired to realize this.
my fennel game is still very weak, I tried to make it work and failed. I will take a look on it tomorrow after some sleep. :D

from nvim-laurel.

luxus avatar luxus commented on May 28, 2024

okay, i think i need to wait until you have time for more instructions.
i forked your config and tried.
https://github.com/luxus/nvim-fnl

thanks for all your answers so far, keep up the good work. and maybe post it on reddit if you want some traction

from nvim-laurel.

aileot avatar aileot commented on May 28, 2024

I have to say ... in the snippets just represents ellipsis, not varargs (Variadic Arguments). You should simply remove it or replace it with other plugins like :folke/tokyonight.nvim.

from nvim-laurel.

luxus avatar luxus commented on May 28, 2024

great :D haha i thought that the ... is some fennel magic its working now .. wonderful

from nvim-laurel.

aileot avatar aileot commented on May 28, 2024

Good. I hope you enjoy Neovim, and sleep tight 👍

from nvim-laurel.

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.