-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
.fnl files not automatically compiling on save #5
Comments
If you use |
And no option to pick a output dir yet, everything is based on a string substitution from Where would you want to send the file to instead? I need to decide if some config data or a function you can define yourself will be the best option. Shouldn't be much work really, the per-project config system makes this sort of thing kinda easy to add, just have to work out the right way to express it. |
Oh and one more question! Does writing to files under |
That fixed it! Files directly under
Tested creating both The default config ( |
I don't know the philosophies behind nfnl, but specifically for my neovim config, I would prefer a system where I can:
That way my neovim config folder just contains fennel code + bootstrapping lua code that adds Lazy + nfnl etc. that then consequently compiles all fennel code to |
Okay cool, so this issue now is to make sure the glob patterns work as expected when compiling things manually and within the autocmd. Or maybe it just won't work and I'll need to make sure users always include the middle layer of the glob like I also created #6 to track the extra config. |
And the philosophy behind nfnl needs expanding somewhere to convince people about the design. This is from years of fiddling with nvim+fnl+plugins+dotfiles, so I think I'm at a local maximum but I know it's still a sea of opinions 😄 From the readme:
I'll expand on this more at a later date but essentially I want lua+fennel committed alongside each other for startup speed, predictability and the ability to rollback / forward to any commit of your dotfiles and have everything Just Work. |
I think pushing build artifacts is just unorthodox in a lot of people's minds including mine, but I think it's a fair design choice. I believe Your solution does Just Work™2, and I'm only against it because I don't like pushing artifacts in order to keep the repo clean - which is ultimately trivial and doesn't really net you any benefits apart from a clean repo. Footnotes |
Normally, yes, but when your git repo is your source and your package registry / distribution it becomes tricky to separate them. If this were Java, of course you wouldn't commit a In a world where Source == Package (vim plugins) we have to consider the repo itself the artifact. The alternative is to bundle in enough logic and code to automatically compile everything JIT when it's first run. This means more code being loaded and run on startup with I know from experience the Neovim community tends to be deathly allergic to. So that's why I fall on this side of the fence, treat the repo as the artifact, avoid any code or compilers from running at startup, have the exact system you expect if you check out ANY commit (since the repo IS the artifact). Yes in other contexts it'd be icky, but to have a robust, fast and good system we just need to move past that thing that's yucky under different circumstances. It's a matter of pragmatism and I think I swallowed the pill so long ago I forget that most others will need convincing 😅 And like I've documented in the readme, you can tell GitHub it's compiled code and then it doesn't even include it in their analysis / summary of your repo, it still counts as a Fennel repo. Just look at the one for this repo, there's SO much more Lua in here than any other language, but it doesn't really feel like it at a glance which is nice. I'm only writing all of this as context to link to later when I get this question / point another 100 times 😬 so even if you're convinced, this may be helpful for others in the future. Now I'm going to step out for a sec then implement the "write the Lua to another directory" feature, but it'll come with a caveat of the user needs to know what they're doing. They need to then ensure the compiler is run at the right times and the Lua is written somewhere that can be loaded by Neovim easily. So it's kind of a power user thing for people who want a very specific experience. I still advice against it and think it's far more trouble than it's worth, but I'll do my best to support it. |
I've made this configurable by allowing you to override, wrap or replace the function that decides how a fnl path should be translated to a Lua one. You can do whatever you want with this. I have included an example which is almost what you need, just needs a |
Hello 👋! I'm having issues with files not being automatically compiled on save inside of my neovim directory.
# Neovim appimage through WSL NVIM v0.9.1 Build type: Release LuaJIT 2.1.0-beta3
Relevant files:
Saving does not generate the file
lua/test.lua
, howeverrequire [[nfnl]]['compile-all-files ]()
does work as expected. Lazy shows nfnl as loaded when opening a fennel file.~Also unrelated: is there a way to specify a target directory for the generated files?
The text was updated successfully, but these errors were encountered: