https://github.com/beixiyo/vv-log-hl.nvim
Syntax highlighting for log files. 日志文件语法高亮
https://github.com/beixiyo/vv-log-hl.nvim
logs lua neovim neovim-plugin nvim nvim-plugin syntax syntax-highlighting
Last synced: 21 days ago
JSON representation
Syntax highlighting for log files. 日志文件语法高亮
- Host: GitHub
- URL: https://github.com/beixiyo/vv-log-hl.nvim
- Owner: beixiyo
- License: mit
- Created: 2026-04-25T07:06:29.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2026-05-23T08:48:02.000Z (about 1 month ago)
- Last Synced: 2026-05-23T10:35:13.740Z (about 1 month ago)
- Topics: logs, lua, neovim, neovim-plugin, nvim, nvim-plugin, syntax, syntax-highlighting
- Language: Lua
- Size: 14.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
vv-log-hl.nvim
日志文件语法高亮 — 等级关键词着色 + 圆角 badge 装饰
---
## 安装
```lua
{
'beixiyo/vv-log-hl.nvim',
ft = 'log',
---@type VVLogHighlight.Config
opts = {
extension = 'log', -- 按扩展名检测 filetype(string | string[])
filename = {}, -- 按完整文件名检测(string | string[])
pattern = {}, -- 按 Lua pattern 匹配路径检测(string | string[])
badge = true, -- 是否启用圆角 badge 效果(Powerline 圆角字符 extmark)
keyword = {
error = {}, -- 追加到 error 等级的自定义关键词
warning = {},
info = {},
debug = {},
pass = {},
},
},
}
```
## 配置
| 选项 | 类型 | 默认值 | 说明 |
|------|------|--------|------|
| `extension` | `string \| string[]` | `'log'` | 按扩展名注册 filetype |
| `filename` | `string \| string[]` | `{}` | 按完整文件名注册 filetype |
| `pattern` | `string \| string[]` | `{}` | 按 Lua pattern 匹配路径注册 filetype |
| `badge` | `boolean` | `true` | 启用圆角 badge(extmark inline 虚拟文本,不修改 buffer) |
| `keyword` | `table` | `{}` | 自定义关键词,按等级分组追加 |
### 内置等级关键词
| 等级 | 关键词(大小写不敏感) |
|------|----------------------|
| **Fatal** | `fatal`, `emerg`, `emergency`, `alert`, `crit`, `critical`, `panic` |
| **Error** | `error`, `err`, `errors`, `fail`, `failed`, `failure` |
| **Warning** | `warn`, `warning` |
| **Notice** | `notice` |
| **Info** | `info` |
| **Debug** | `debug`, `dbg`, `trace`, `verbose` |
| **Pass** | `pass`, `passed`, `success`, `done`, `ok`, `complete`, `finished` |