Code Monkey home page Code Monkey logo

nvim-local-fennel's Introduction

nvim-local-fennel

This has been superseded! I now recommend installing Olical/nfnl and enabling the exrc option in order to have directory local Neovim configuration in Fennel.

Once you have nfnl and a .nfnl.fnl file at the root of your project you can write to .nvim.fnl and have .nvim.lua compiled for you automatically. This file is loaded by native Neovim with zero plugins provided you have :set exrc enabled.

This means even colleagues that don’t have nfnl installed can use your directory local configuration. Consider this repo as essentially archived and superseded by this much smoother approach.

Run Fennel inside Neovim on startup with 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 Conjure too.

use 'Olical/nvim-local-fennel'
use 'Olical/aniseed'
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!

;; .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 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.

nvim-local-fennel's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

berkeleytrue

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.