nvim-lint
2,789
Stars
310
Forks
6
Watchers
39
Open Issues
GPL-3.0
许可证
Lua
语言
2021-02-14
创建时间
2026-10-29
最近更新
项目能做什么
Neovim 的异步 Linter 插件,用于补充内置的 LSP 支持。
来源:基于仓库元数据
· 内容以仓库实际 README 为准
使用说明 查看原始 README 原仓库文档
中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
# nvim-lint
An asynchronous linter plugin for Neovim (>= 0.9.5) complementary to the
built-in Language Server Protocol support.
## Motivation & Goals
With [ale][1] we already got an asynchronous linter, why write yet another one?
Because [ale][1] also includes its own language server client.
`nvim-lint` instead has a more narrow scope: It spawns linters, parses their
output, and reports the results via the `vim.diagnostic` module.
`nvim-lint` complements the built-in language server client for languages where
there are no language servers, or where standalone linters provide better
results.
## Installation
- Requires Neovim >= 0.9.5
- `nvim-lint` is a regular plugin and can be installed via the `:h packages`
mechanism or via a plugin manager.
For example:
```bash
git clone \
https://codeberg.org/mfussenegger/nvim-lint.git
~/.config/nvim/pack/plugins/start/nvim-lint
```
- If using [vim-plug][3]: `Plug 'mfussenegger/nvim-lint'`
- If using [packer.nvim][4]: `use 'mfussenegger/nvim-lint'`
## Usage
Configure the linters you want to run per file type. For example:
```lua
require('lint').linters_by_ft = {
markdown = {'vale'},
}
```
To get the `filetype` of a buffer you can run `:= vim.bo.filetype`.
The `filetype` can also be a compound `filetype`. For example, if you have a buffer
with a `filetype` like `yaml.ghaction`, you can use either `ghaction`, `yaml` or
the full `yaml.ghaction` as key in the `linters_by_ft` table and the linter
will be picked up in that buffer. This is useful for linters like
[actionlint][actionlint] in combination with `vim.filetype` patterns like
`[".*/.github/workflows/.*%.yml"] = "yaml.ghaction",`
Then setup a `autocmd` to trigger linting. For example:
```vimL
au BufWritePost * lua require('lint').try_lint()
```
or with Lua auto commands:
```lua
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
callback = function()
-- try_lint without arguments runs the linters defined in `linters_by_ft`
-- for the current filetype
require("lint").try_lint()
-- You can call `try_lint` with a linter name or a list of names to always
-- run specific linters, independent of the `linters_by_ft` configuration
require("lint").try_lint("cspell")
end,
})
```
Some linters require a file to be saved to disk, others support linting `stdin`
input. For such linters you could also define a more aggressive `autocmd`, for
example on the `InsertLeave` or `TextChanged` events.
If you want to customize how the diagnostics are displayed, read `:help
vim.diagnostic.config`.
## Security
Some linters prioritize using an executable relative to the current working
directory over the executable in `$PATH`. For example the `eslint` linter will
use `./node_modules/.bin/eslint` if it exists. The executable is executed with
your users permission. Because of that, you must _not_ call `try_lint()` in
untrusted repositories.
To improve security you could run linters using sandbox systems like
[bubblewrap]
阅读完整原文
项目深度分析 规则生成(AI 未配置)
综合评分 60.2 分。该项目在“个人可实施性”维度得 45 分,“付费可能性”维度得 35.0 分,差异化空间 100.0 分(评分依据见评分卡)。
一键部署托管 / 代部署服务
| 产品构想 | 为不想自己折腾的用户提供在线实例或代部署。 |
| 目标用户 | 非技术背景的目标用户 |
| 难度/周期 | 低~中 · 1~2 周 |
| 收费模式 | 按次收费或按月托管费 |
| 竞争风险 | 客单价低,需控制人力成本 |
| 依据 | 数据支持的判断:项目支持 Docker 部署 |
面向细分需求的二次开发产品
| 产品构想 | 基于 nvim-lint 的核心能力,聚焦一个更窄的场景(如某平台、某行业)做差异化。 |
| 目标用户 | 该细分场景用户 |
| 难度/周期 | 中 · 2~6 周 |
| 收费模式 | 买断制 / 订阅制 / 广告 |
| 竞争风险 | 细分需求规模需验证 |
| 依据 | AI 推测:基于项目主题标签的判断 |
以上为规则引擎基于仓库公开数据生成的参考结论,包含推测成分,不构成投资或创业承诺;配置 AI 后可获得更深入的分析。
报告会保存到 个人中心
竞品与相似项目 GitHub Search 真实检索
相似项目数据正在完善中,暂不展示(避免误导)
项目优势与风险
| 技术成熟度 | 创建于 2021-02-14,近 30 天仍在推送 |
| 社区活跃 | Star 2,789 / Fork 310 / Issue 39(数据支持,可自行核实) |
| 许可证 | GPL-3.0 商用需注意传染性条款 |
| 主要风险 | 上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价 |
安装与使用
此项目未提供 Docker 镜像,安装步骤以原仓库 README 为准(涉及依赖安装与环境配置,对新手门槛较高)。