feat: generate plugins/init.lua using fnl

This commit is contained in:
Youwen Wu 2025-02-01 02:35:39 -08:00
parent 8ff882a903
commit 8689c11dd0
Signed by: youwen5
GPG key ID: 865658ED1FE61EC3
3 changed files with 7 additions and 5 deletions

View file

@ -24,7 +24,7 @@
;; autocmd, so it'll only apply to buffers you're interested in. ;; autocmd, so it'll only apply to buffers you're interested in.
;; Will use backslashes on Windows. ;; Will use backslashes on Windows.
;; Defaults to compiling all .fnl files, you may want to limit it to your fnl/ directory. ;; Defaults to compiling all .fnl files, you may want to limit it to your fnl/ directory.
:source-file-patterns [:./fnl/.*.fnl :./fnl/*.fnl :./fnl/**/*.fnl :init.fnl] :source-file-patterns [:./fnl/.*.fnl :./fnl/*.fnl :./fnl/**/*.fnl :./init.fnl]
;; A function that is given the absolute path of a Fennel file and should return ;; A function that is given the absolute path of a Fennel file and should return
;; the equivalent Lua path, by default this will translate `fnl/foo/bar.fnl` to `lua/foo/bar.lua`. ;; the equivalent Lua path, by default this will translate `fnl/foo/bar.fnl` to `lua/foo/bar.lua`.
;; See the "Writing Lua elsewhere" tip below for an example function that writes to a sub directory. ;; See the "Writing Lua elsewhere" tip below for an example function that writes to a sub directory.

3
fnl/plugins/init.fnl Normal file
View file

@ -0,0 +1,3 @@
(vim.loader.enable)
(let [plugins (require :plugins.lz-spec)]
((. (require :lz.n) :load) plugins))

View file

@ -1,5 +1,4 @@
-- Experimental Neovim byte-compiled module loader -- [nfnl] Compiled from ./fnl/plugins/init.fnl by https://github.com/Olical/nfnl, do not edit.
vim.loader.enable() vim.loader.enable()
local plugins = require("plugins.lz-spec")
local pluginSpec = require("plugins.lz-spec") return require("lz.n").load(plugins)
require("lz.n").load(pluginSpec)