- Notifications
You must be signed in to change notification settings - Fork2
An example Neovim plugin witten in Fennel using nfnl
License
Olical/nfnl-plugin-example
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A very simple plugin to demonstrate writingNeovim plugins inFennel withnfnl.
The plugin only exposes one Lua module (nfnl-plugin-example
) which exports onefunction (setup
). When loaded and executed it'll use the notify API to display"Hello, World!" which means you'll either see it in your:messages
area or ina floating notification if you have a plugin for that.
We're embedding a copy of nfnl in this plugin to show you how that can beachieved. Here's a list of files you'll probably find interesting and worthlooking at:
script/nfnl
is responsible for cloning, updating and embedding nfnl intolua/nfnl-plugin-example/nfnl
..gitattributes
tells GitHub which files are vendored from other repos andwhich are compiler output. This ensures your language report for yourrepository is accurate and correctly ignores files you didn't write..ignore
ensures compiler output Lua files don't show up in command line andNeovim search interfaces..nfnl.fnl
enables and configures nfnl for this directory, it's just relyingon the defaults so it only contains{}
.fnl/nfnl-plugin-example/init.fnl
is the only code for this plugin and it'sthe main entry point.script/test
executes the tests underfnl/spec
withPlenary (youwill need to install that separately for this to work)..github/workflows/test.yaml
creates a GitHub workflow that automaticallyruns your test suite on push.
If you add this plugin to your plugin manager you can load it with:
:luarequire("nfnl-plugin-example").setup()
Bear in mind, some plugin managers actually call thissetup
method for youwith a configuration table.
Feel free to fork / copy / steal / borrow / modify / mutate / scramble / fry /reticulate splines / incorporate this repository in any way you see fit. It canbe an inspiration, reference or template. That's entirely up to you and what youneed right now.
If you build something with nfnl let me know and I'll link to it from here asfurther examples of how to work with it.
Have fun!
Find the fullUnlicense in theUNLICENSE
file, but here's asnippet.
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or distributethis software, either in source code form or as a compiled binary, for anypurpose, commercial or non-commercial, and by any means.