Skip to content

Commit

Permalink
docs(readme): refactor sections
Browse files Browse the repository at this point in the history
- Move changelog to another file.
- Prepare for Panvimdoc vimdoc generation.
- Tweak some texts.
  • Loading branch information
mnacamura committed Feb 6, 2024
1 parent 973ef5f commit d0e2648
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 41 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/panvimdoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Generate help

on: [push, pull_request]

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: kdheepak/panvimdoc@main
with:
vimdoc: fennel-syntax
description: Yet another syntax highlighting plugin for Fennel.
toc: false
shiftheadinglevelby: -1
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "docs(vim): auto generate help"
branch: ${{ github.head_ref }}
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Changelog

## Unreleased

### Added

- Support `accumulate` macro.

## [0.2][v0.2] (2021-06-20)

### Added

- Option `{g,b}:fennel_lua_version`.
- Option `{g,b}:fennel_use_luajit`.

### Fixed

- Correct highlight for string/numeric literals for each Lua version.
- Add missing `\<CR>` in string literal.
- Fix `\ddd` in string literal.

## [0.1][v0.1] (2021-06-13)

### Added

- Support Fennel 0.9.2.
- Support Lua string literals up to version 5.4.
- Support Lua numeric literals up to version 5.4.

[v0.2]: https://github.com/mnacamura/vim-fennel-syntax/tree/v0.2
[v0.1]: https://github.com/mnacamura/vim-fennel-syntax/tree/v0.1
104 changes: 63 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,90 +1,112 @@
<!-- panvimdoc-ignore-start -->

# vim-fennel-syntax

Vim syntax highlighting for [Fennel][1].
Yet another Vim syntax highlighting plugin for [Fennel][1].

![screenshot](_assets/example.png)

This is a personal fork from the original [fennel.vim][2].

![Screenshot](_assets/example.png)
## Requirements

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

## Installation

Use your favorite package manager. For example using [Paq][3]:
Use any Vim/Neovim package manager. An example using [Paq][3] for Neovim:

```lua
require'paq-nvim' {
require'paq' {
..., -- other plugins
'mnacamura/vim-fennel-syntax',
..., -- other plugins
}
```

## Options
<!-- panvimdoc-ignore-end -->

<!-- panvimdoc-include-comment
```vimdoc
Maintainer: NAKAMURA Mitsuhiro <m.nacamura@gmail.com>
URL: https://github.com/mnacamura/vim-fennel-syntax
License: MIT
```
Yet another syntax highlighting plugin for Fennel.
-->

## Configuration

For all options, if both global and buffer local ones are defined, the
buffer local one takes precedence.
This plugin will automatically configure most options for your environment.
To configure manually, you can use the following global/buffer-local variables.

### `fennel_lua_version`
### Options

| Option | Description | Type | Default value |
| :- | :- | :- | :- |
| [fennel_lua_version](#fennel_lua_version) | Lua version to highlight literals. | string | auto-detected |
| [fennel_use_luajit](#fennel_use_luajit) | Highlight LuaJIT extentions. | bool | auto-detected |
| [fennel_use_lume](#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 not set, it will be inferred and set automatically by invoking `lua -v`
command.
If this variable is not set, the plugin automatically infers it
by invoking `lua -v` command.

```vim
let g:fennel_lua_version = '5.4' " default: inferred from environment
let g:fennel_lua_version = '5.4'
```

If `g:fennel_lua_version` and `b:fennel_lua_version` are not set and `lua` is
not found in path, it defaults to `5.1`.
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`
#### `fennel_use_luajit`

Highlight literals and keywords extended in [LuaJIT][5].
If not set, it will be inferred and set automatically by invoking `lua -v`
command.
If this variable is not set, the plugin automatically infers it
by invoking `lua -v` command.

```vim
let g:fennel_use_luajit = 0 " default: inferred from environment
let g:fennel_use_luajit = 0
```

If `g:fennel_use_luajit` and `b:fennel_use_luajit` are not set and
`lua` (LuaJIT) is not found in path, it defaults to `0`.
Override it by defining buffer local `b:fennel_use_luajit`.

### `fennel_use_lume`
> [!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][4].
It defaults to `1`.

```vim
let g:fennel_use_lume = 1 " default: 1
let g:fennel_use_lume = 1
```

## Change log

### Unreleased
Override it by defining buffer local `b:fennel_use_lume`.

* Support `accumulate` macro

### [0.2][v0.2] (2021-06-20)

* Add option `{g,b}:fennel_lua_version`
* Add option `{g,b}:fennel_use_luajit`
* Fix `\ddd` in string literal
* Add missing `\<CR>` in string literal
* Add correct highlight for string/numeric literals for each Lua version

### [0.1][v0.1] (2021-06-13)

* Support Fennel 0.9.2
* Support Lua string literals up to version 5.4
* Support Lua numeric literals up to version 5.4
<!-- panvimdoc-ignore-start -->

## License

[MIT](LICENSE)

<!-- panvimdoc-ignore-end -->

[1]: https://fennel-lang.org/
[2]: https://github.com/bakpakin/fennel.vim/
[3]: https://github.com/savq/paq-nvim/
[4]: https://github.com/rxi/lume/
[5]: https://luajit.org/extensions.html
[v0.1]: https://github.com/mnacamura/vim-fennel-syntax/tree/v0.1
[v0.2]: https://github.com/mnacamura/vim-fennel-syntax/tree/v0.2

<!-- vim: set tw=78 spell: -->

0 comments on commit d0e2648

Please sign in to comment.