nvim-local-fennel
nvim-local-fennel copied to clipboard
Execute local Fennel Lisp files in Neovim upon startup
= nvim-local-fennel
Run https://github.com/bakpakin/Fennel[Fennel] inside Neovim on startup with https://github.com/Olical/aniseed[Aniseed].
Add some Fennel code such as (print "Hello, World!")
to a file named .lnvim.fnl
in your current directory or anywhere above it such as your home directory. A file will be created beside the .fnl
called .lnvim.lua
which will be executed upon startup. Files higher up in your directory hierarchy, such as the home directory, will be executed before those found lower down, such as in a project.
Be sure to git ignore .lnvim.fnl
and .lnvim.lua
if you don't want to share your local configuration with others. If you do want to share a .lnvim.fnl
I'd recommend you ignore the .lua
file to prevent duplicated changes in git commits.
Aniseed will only re-compile the Fennel code if it's changed since last time you opened Neovim. If you delete the .lnvim.fnl
file then the .lnvim.lua
file will be deleted automatically next time you launch Neovim to ensure you don't accidentally leave Lua files laying around.
== Installation
If you want interactive evaluation of the forms in your .lnvim.fnl
file you can install https://github.com/Olical/conjure[Conjure] too.
=== https://github.com/wbthomason/packer.nvim[packer.nvim]
[source,lua]
use 'Olical/nvim-local-fennel' use 'Olical/aniseed'
=== https://github.com/junegunn/vim-plug[vim-plug]
[source,viml]
Plug 'Olical/nvim-local-fennel' Plug 'Olical/aniseed'
== Access to Aniseed
Aniseed is embedded under the nvim-local-fennel.aniseed.*
module prefix, this means you can use Aniseed's macros and functions in your .lnvim.fnl
files!
[source,clojure]
;; .lnvim.fnl ;; You can give the module any name you want. (module my-local-fennel {autoload {a nvim-local-fennel.aniseed.core str nvim-local-fennel.aniseed.string nvim nvim-local-fennel.aniseed.nvim}})
;; A hyphen suffix denotes a private function. (defn- do-some-things [numbers] (a.println (nvim.fn.getcwd) (a.map a.inc numbers) {:Hello :Fennel!}))
;; Public value. ;; You could require this module and access it. (def counting [1 2 3])
;; Executed as the file is loaded. (do-some-things counting)
== Unlicenced
Find the full http://unlicense.org/[unlicense] in the UNLICENSE
file, but here's a snippet.
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.