Yet another Vim syntax highlighting plugin for Fennel.
This is a personal 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)
is supported. - Shebang line
#!/usr/bin/env fennel
is highlighted as comment. - And more!
- Hash function literal
- 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.
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 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.
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
.
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
.
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
.
Footnotes
-
For example, hex numeric literal with exponent such as
0xA23p-4
is supported by Lua 5.2 or later. ↩