Replies: 1 comment 1 reply
-
Awesome another fennel user! My config is at https://github.com/jaidetree/system/blob/fba37f4870577e39d5155cbaa122ee18bc160713/nix/home/wezterm.nix#L14-L24 with two distinctions: local wezterm = require 'wezterm'
local configdir = wezterm.config_dir
local homedir = wezterm.home_dir
-- Fossker's version is better, but this is for nix users
fennel = dofile('${pkgs.lua54Packages.fennel}/share/lua/5.4/fennel.lua')
wezterm.log_error('Loaded fennel')
do
local fnldir = (configdir .. "/fnl")
for _, dir in ipairs({"/?.fnl", "/?/init.fnl"}) do
fennel["path"] = (fnldir .. dir .. ";" .. fennel.path)
fennel["macro-path"] = (fnldir .. dir .. ";" .. fennel["macro-path"])
end
end
fennel.install()
_G['config-paths'] = {};
-- useful for nix users
_G['config-paths'].fish = '${pkgs.fish}/bin/fish';
local config = (require "j.wezterm.config")
return config Modifying the paths lets you require modules as a root path, so if you want to split up your config into separate files, you can write something like the following: (local some-module (require :j.config.wezterm.some-module)) Where The other is that it's geared towards nix users where the fennel path is in the nix store. Admittedly it's not very clean so open to alternatives if anyone has ideas. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Fennel is a language that compiles to Lua, and with a little bit of massaging can be used to configure Wezterm. Here is how I accomplished this.
In
~/.config/wezterm/wezterm.lua
:Note the workaround regarding
debug.traceback
.Now, in
~/.config/wezterm/config.fnl
:For example. Now continue to configure things freely in Fennel as you wish.
Note about Lua locating
fennel.lua
The
fennel
package provided by my distribution suppliesfennel.lua
at/usr/share/lua/5.4/fennel.lua
, but apparently Lua/Wezterm only wants to look into/usr/local/share/...
. I had to create a symlink in~/.config/wezterm/
that points to the real location.Beta Was this translation helpful? Give feedback.
All reactions