Closed katawful closed 11 months ago
Your macro path is all relative, so it's all using ./
and is only looking in the CWD. You'll need to add relative or absolute paths that point to your other directory.
When setting :fennel-macro-path
in the .nfnl.fnl
file you're overriding the default (which you can access by requiring nfnl.config
and calling the default
function in there). The default behaviour is actually mapping items from your run time path (list of plugin dirs) into the fennel module and macro search paths for you.
So setting this might help:
(local core (require :nfnl.core)
(local config (require :nfnl.config))
(local default (config.default {})
{:rtp-patterns (core.concat default.rtp-patterns ["/nvim-anisole-macros$"])}
Which should then include your other plugin in the Fennel + Neovim RTP integration. It's an allowlist based on Lua patterns so you could just set the list to [".*"]
to add ALL of your plugin dirs to your Fennel search paths, it just might slow things down.
This doesn't allow you to add custom dirs within each of the RTP dirs though, like your /macros
dir, that's non standard so nfnl doesn't add that to the path for you. You'd have to append to the path yourself somehow I think.
The gist of this though is that you should add your plugin to the allow list and then it should be integrated into the path automatically with the normal set of paths.
The confusing thing here is that Aniseed added your WHOLE runtimepath into the Fennel search paths by default and gave you no power over what is added. Now I keep that list smaller to keep things efficient and let you opt into making it more inclusive where required. This should help remove any chance of accidental module naming clashes across plugins etc.
(local core (require :nfnl.core))
(local config (require :nfnl.config))
(local fs (require :nfnl.fs))
(local default (config.default {}))
{:rtp-patterns (core.concat default.rtp-patterns ["/nvim-anisole-macros$"])
:fennel-macro-path (.. default.fennel-macro-path ";" vim.env.HOME "/Repos/NEOVIM/nvim-anisole-macros/fnl/nvim-anisole/macros/?.fnl;")}
i can't seem to find a way to get it to compile still (i added in the :fennel-macro-path
call after what you suggested didn't work)
I think I found a way to add the macros to the path appropiately:
(local core (require :nfnl.core))
(local config (require :nfnl.config))
(local fs (require :nfnl.fs))
(local default (config.default {}))
(tset default :rtp-patterns [(.. (fs.path-sep) "nfnl$")])
(tset default :rtp-patterns (core.concat default.rtp-patterns ["/nvim-anisole-macros$"]))
(tset default :fennel-macro-path (.. default.fennel-macro-path ";" vim.env.HOME "/Repos/NEOVIM/nvim-anisole-macros/fnl/?.fnl"))
(tset default :compiler-options {:compilerEnv _G})
default
It lets me add the macros i need with (import-macros sym nvim-anisole.macros.the_macro)
Ah! Sorry I gave you the wrong code, the way to generate the default config with more runtimepath directories included is with this:
(local config (require :nfnl.config))
(config.default {:rtp-patterns ["/nfnl$" "/nvim-anisole-macros$"]})
With that config.default
call returning your new config and that is returned from you .nfnl.fnl
file. Sorry I didn't test what I sent you before because I was travelling, I've actually checked this one.
The difference is rtp-patterns
are an option provided to config.default
, they are not in themselves a config value, they're an option used when building the default table.
I'm glad you found a solution, but yeah, rtp-patterns
is an input to the function, not a part of the config itself. I was misremembering and didn't take the time to check, sorry for misleading.
I'm updating the readme on this.
I'm starting to rewrite my config with nfnl, and I have a repo of macros (here) that I want so use from my local git repo of it. I have added the package to my runtime, and also installed with lazy.nvim afterwards, but nfnl just can't find them:
File I am compiling:
.nfnl.fnl