https://github.com/hugginsio/modeline
A flexible Vim-style modeline parser
https://github.com/hugginsio/modeline
golang modeline vim
Last synced: 6 days ago
JSON representation
A flexible Vim-style modeline parser
- Host: GitHub
- URL: https://github.com/hugginsio/modeline
- Owner: hugginsio
- License: bsd-3-clause
- Created: 2026-01-26T01:01:50.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-02-08T01:21:17.000Z (4 months ago)
- Last Synced: 2026-02-08T03:11:56.185Z (4 months ago)
- Topics: golang, modeline, vim
- Language: Go
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# modeline
A flexible Vim-style modeline parser.
There are two forms of modelines, according to `:help modeline`. This module endeavours to support both.
1. `[text]{white}{program:}[white]{options}`
2. `[text]{white}{program:}[white]se[t] {options}:[text]`
A modeline such as `# vim: sw=3 foldmethod=marker noai cursorline` would result in the following:
```go
&modeline.Modeline{
Program: "vim",
Options: map[string]string{
"sw": "3",
"foldmethod": "marker",
"ai": "false",
"cursorline": "true",
},
}
```