{"id":50731372,"url":"https://github.com/beixiyo/vv-utils.nvim","last_synced_at":"2026-06-10T09:01:16.087Z","repository":{"id":353808054,"uuid":"1220651810","full_name":"beixiyo/vv-utils.nvim","owner":"beixiyo","description":"Shared Lua utilities for vv-* Neovim plugins (path / fs / git / diagnostics / hl / help_panel / ui_window / bufdelete / yaml). vv-* 系列 Neovim 插件的共享工具库","archived":false,"fork":false,"pushed_at":"2026-05-30T17:26:53.000Z","size":71,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-30T19:12:39.587Z","etag":null,"topics":["lua","neovim","neovim-lua","neovim-plugin","neovim-utils","nvim","nvim-plugin","vv-utils"],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/beixiyo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-25T06:37:29.000Z","updated_at":"2026-05-30T17:26:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/beixiyo/vv-utils.nvim","commit_stats":null,"previous_names":["beixiyo/vv-utils.nvim"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/beixiyo/vv-utils.nvim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beixiyo%2Fvv-utils.nvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beixiyo%2Fvv-utils.nvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beixiyo%2Fvv-utils.nvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beixiyo%2Fvv-utils.nvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beixiyo","download_url":"https://codeload.github.com/beixiyo/vv-utils.nvim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beixiyo%2Fvv-utils.nvim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34144680,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lua","neovim","neovim-lua","neovim-plugin","neovim-utils","nvim","nvim-plugin","vv-utils"],"created_at":"2026-06-10T09:01:14.795Z","updated_at":"2026-06-10T09:01:16.077Z","avatar_url":"https://github.com/beixiyo.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003evv-utils.nvim\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cem\u003evv-* 系列插件的共享工具库 — 纯 Lua，零外部依赖\u003c/em\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Neovim-0.10+-57A143?style=flat-square\u0026logo=neovim\u0026logoColor=white\" alt=\"Requires Neovim 0.10+\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Lua-2C2D72?style=flat-square\u0026logo=lua\u0026logoColor=white\" alt=\"Lua\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/zero_deps-✓-2ea44f?style=flat-square\" alt=\"Zero Dependencies\" /\u003e\n\u003c/p\u003e\n\n---\n\n## 安装\n\n通常不需要手动安装 — 其他 `vv-*` 插件通过 `dependencies` 自动拉取。如果直接消费：\n\n```lua\n{\n  'beixiyo/vv-utils.nvim',\n  lazy = false,\n  priority = 1000, -- 其他插件启动期 require 时需要先就位\n}\n```\n\n## 模块\n\n| 模块 | 说明 |\n|------|------|\n| `vv-utils.path` | `norm(p)` 规范化路径、`get_root(buf?)` 向上找项目根、`get_cwd()` |\n| `vv-utils.yaml` | 轻量 YAML 解析（够用于 `pnpm-workspace.yaml` 等简单配置） |\n| `vv-utils.fs` | fs 原语：`mkdir_p` / `create_file` / `delete`（递归）/ `rename`（EXDEV 降级）/ `copy`（递归）/ `read_all` / `write_all`（原子写入） |\n| `vv-utils.git` | 异步 git 索引：`index(root, cb)` → `{ status_map, is_ignored, symbol_for }`；`register_hl()` 注册 VSCode Dark+ 调色板 |\n| `vv-utils.diagnostics` | `collect_by_path()` 聚合诊断 → `{[path]={[severity]=count}}`；`symbol_for(counts)` 选最高 severity；`format_range(buf, l1, l2?)` 行范围诊断 → `\"Label: message\"[]` |\n| `vv-utils.timer` | `debounce(fn, wait)` / `throttle(fn, limit)`，时间参数支持传入函数实现动态延时 |\n| `vv-utils.hl` | `register(augroup, specs)` 批量注册 highlight（自动 `default=true` + `ColorScheme` 重挂）；`get_fg(name)` |\n| `vv-utils.ui_window` | UI buffer 窗口 chrome 管理（关行号 / signcolumn 等），支持 restore |\n| `vv-utils.help_panel` | 通用 keymap 帮助浮窗：反读 buffer mappings 按 desc 前缀分组 |\n| `vv-utils.bufdelete` | 删 buffer 不破坏窗口布局：`delete` / `all` / `other` / `smart` |\n| `vv-utils.loading` | buffer 行内 loading 动画：`start(opts)` → `stop()`；内置 `presets.braille`（默认）/ `dots` / `bounce`；`hl_mode='combine'` 透明背景 |\n| `vv-utils.editor` | `copy(text)` / `visual_range()` / `copy_path(opts?)` |\n| `vv-utils.sys` | `open_default(path)` 跨平台打开（`vim.ui.open`）；niri 下额外把被打开的应用窗口聚焦回来 |\n| `vv-utils.exec` | `resolve(path, opts?)` 按文件类型解析执行命令：shebang（`/usr/bin/env` 透传）\u003e 扩展名运行器优先级，取首个 `executable()` 者，返回 `{cmd, runner}` 纯数据 |\n| `vv-utils.drop` | 终端拖拽路径检测 + handler 分发（需 `setup()` 启用）。两条路统一走 `dispatch(paths, pos)`：① 覆写 `vim.paste` 从 bracketed paste 检测路径（`pos=nil`，无坐标）；② **kitty DnD 协议（OSC 72，kitty ≥ 0.47 且脱 tmux）** 带落点坐标 + 拖拽事件（`pos={x,y,op}`）。`register(handler)` 签名 `fun(paths, pos)`；`on_drag(cb)` 订阅移动/离开（实时高亮用）；内置默认 handler（Normal 下 `:edit`）；`setup({ kitty_dnd=false })` 关协议 |\n| `vv-utils.bigfile` | 大文件保护（需 `setup()` 启用），禁用 matchparen / folding / completion 等 |\n| `vv-utils.format` | 中英文排版：`add_spaces_around_english` / `clean_line_trailing`（需 `setup()` 启用） |\n| `vv-utils.animate` | 通用补间动画引擎：`add(from, to, cb, opts?)` / `del(id)`，uv_timer 驱动 + easing（linear/outQuad/outCubic/inQuad/inOutQuad） |\n\n## 引用方式\n\n```lua\n-- 直接引用子模块\nlocal path = require('vv-utils.path')\npath.get_root()\n\n-- 或走 facade\nlocal utils = require('vv-utils')\nutils.path.get_root()\nutils.yaml.parse(...)\n```\n\n## 配置\n\n大多数模块是纯函数库，无需配置。带副作用的模块需显式启用：\n\n```lua\nrequire('vv-utils').setup({\n  drop    = true,          -- 终端拖拽：粘贴检测 + kitty DnD 落点协议（覆写 vim.paste）\n  bigfile = true,          -- 启用大文件保护\n  format  = true,          -- 启用中英文排版命令（:VVAddSpaces / :VVCleanTrailing）\n  -- 传 table 可透传子模块配置\n  -- bigfile = { size_threshold = 1024 * 500 },\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeixiyo%2Fvv-utils.nvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeixiyo%2Fvv-utils.nvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeixiyo%2Fvv-utils.nvim/lists"}