Yet another Vim syntax highlighting plugin for Fennel.
This is a fork from the original fennel.vim.
- 100% Vim script: Both Vim and Neovim users can enjoy this plugin.
- Attentive highlighting: Hash function literal
#(+ $1 $2)
, shebang line#!/usr/bin/env fennel
, and more. - Granular Lua version support: Depending on your Lua version, it highlights literals and keywords differently, so that you can easily find syntax errors relevant to Lua version difference 1.
It would work with any recent or even older version of Vim/Neovim.
Use any Vim/Neovim package manager. An example using Paq for Neovim:
require'paq' {
..., -- other plugins
'm15a/vim-fennel-syntax',
..., -- other plugins
}
This plugin will automatically configure most options for your environment. To configure options manually, you can use the following global/buffer-local variables.
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 |
Highlight literals and keywords for the given Lua version. It supports
5.1
, 5.2
, 5.3
, and 5.4
. Unless configured manually, it will be
inferred automatically by invoking lua -v
.
let g:fennel_lua_version = '5.4'
Override it by setting 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 your PATH
, it defaults to 5.1
.
Highlight literals and keywords extended in LuaJIT. Unless
configured manually, it will be inferred automatically by invoking
lua -v
.
let g:fennel_use_luajit = 0
Override it by setting 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 your PATH
, it defaults to 0
.
Highlight keywords provided by Lume. It defaults to 1
.
let g:fennel_use_lume = 1
Override it by setting buffer local b:fennel_use_lume
.
Footnotes
-
For example, hex numeric literal with exponent such as
0xA23p-4
is supported by Lua 5.2 or later. ↩