Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

would this be a possible alternative to lua for configuration? #442

Closed
erikLundstedt opened this issue Feb 15, 2022 · 5 comments
Closed

Comments

@erikLundstedt
Copy link

https://git.sr.ht/~ioiojo/include-fnl

fennel is a lisp dialect that "compiles*" to lua

*compiles in the same way as less-css,sass and scss "compiles" to css

@sayanarijit
Copy link
Owner

sayanarijit commented Feb 15, 2022

Looks interesting. Let's look into how we can leverage this without directly embedding into xplr. (E.g. browser knows only css). There's also fennel-nvim/aniseed as an inspiration.

@sayanarijit
Copy link
Owner

Found a good introduction video: https://youtu.be/VC1DhAoRSpg

@sayanarijit
Copy link
Owner

As per the video, it should be pretty easy to write xplr config in fennel, without built-in support. All it takes is the fennel compiler and a Makefile in the config/plugin directory.

@dtomvan
Copy link
Contributor

dtomvan commented Feb 21, 2022

Staying in the sass<->css example, sass has some advantages over css. What kind of advantage do you get out of using fennel over lua? Or is it just that people like writing lispy code?

@sayanarijit
Copy link
Owner

I think it has been sorted.

To add fennel support, use the following steps:

  • Get the fennel.lua library. You can get this from a release tarball or by running make in a source checkout.
  • Add fennel.lua to ~/.config/xplr/plugins/fennel.lua.
  • Add the following lines to ~/.config/xplr/init.lua.
local home = os.getenv("HOME")

-- Lua search path
package.path = home
  .. "/.config/xplr/plugins/?/init.lua;"
  .. home
  .. "/.config/xplr/plugins/?.lua;"
  .. package.path

local fennel = require("fennel")

-- Fennel search path
fennel.path = fennel.path
  .. ";"
  .. home
  .. "/.config/xplr/plugins/?/init.fnl;"
  .. home
  .. "/.config/xplr/plugins/?.fnl;"

table.insert(package.loaders or package.searchers, fennel.searcher)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants