Skip to content

m15a/vim-fennel-syntax

 
 

Repository files navigation

vim-fennel-syntax

Vim CI Release Fennel

Yet another Vim syntax highlighting plugin for Fennel.

screenshot

This is a personal fork from the original fennel.vim.

Features

  • 100% Vim script
    • Both Vim and Neovim users can enjoy this plugin.
  • Attentive highlighting
    • Hash function literal #(+ $1 $2) is supported.
    • Shebang line #!/usr/bin/env fennel is highlighted as comment.
    • And more!
  • Granular Lua version support
    • Depending on your Lua version, it differently highlights literals and keywords, so that you can easily find syntax errors relevant to Lua version difference 1.

Requirements

It would work with any recent or even older version of Vim/Neovim.

Installation

Use any Vim/Neovim package manager. An example using Paq for Neovim:

require'paq' {
  ..., -- other plugins
  'm15a/vim-fennel-syntax',
  ..., -- other plugins
}

Configuration

This plugin will automatically configure most options for your environment. To configure manually, you can use the following global/buffer-local variables.

Options

Option Description Type Default value
fennel_lua_version Lua version to highlight literals. string auto-detected
fennel_use_luajit Highlight LuaJIT extentions. bool auto-detected
fennel_use_lume Highlight Lume keywords. bool 1

fennel_lua_version

Highlight literals and keywords for the given Lua version. Supports 5.1, 5.2, 5.3, and 5.4. If this variable is not set, the plugin automatically infers it by invoking lua -v command.

let g:fennel_lua_version = '5.4'

Override it by defining buffer local b:fennel_lua_version.

Note

If neither g:fennel_lua_version nor b:fennel_lua_version is set and lua is not found in path, it defaults to 5.1.

fennel_use_luajit

Highlight literals and keywords extended in LuaJIT. If this variable is not set, the plugin automatically infers it by invoking lua -v command.

let g:fennel_use_luajit = 0

Override it by defining buffer local b:fennel_use_luajit.

Note

If neither g:fennel_use_luajit nor b:fennel_use_luajit is set and lua (LuaJIT) is not found in path, it defaults to 0.

fennel_use_lume

Highlight keywords provided by Lume. It defaults to 1.

let g:fennel_use_lume = 1

Override it by defining buffer local b:fennel_use_lume.

License

MIT

Footnotes

  1. For example, hex numeric literal with exponent such as 0xA23p-4 is supported by Lua 5.2 or later.

About

Yet another Vim syntax highlighting plugin for Fennel

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • Fennel 57.1%
  • Vim Script 39.8%
  • Nix 3.1%