AGENT SKILL

Neovim 配置与构建交互

nvim

与 Neovim 配置和构建系统交互。

License 许可
MIT
所属仓库
whilp/world
最近更新
2026-11-14
Stars
★ 10
Forks
3

01 前言 Front Matter

trigger
Use this skill for neovim configuration, plugin management, or building custom nvim releases
description
Interact with Neovim configuration and build system

03 SKILL.md 正文

Neovim interaction skill

This skill provides comprehensive knowledge for interacting with Neovim in this environment.

Architecture

Binary management

  • Nvim binary installed to ~/.local/share/nvim/<version>-<sha>/bin/nvim
  • Symlinked from ~/.local/bin/nvim (managed by home 3p)
  • Custom nvim builds with bundled plugins available via .github/workflows/build-nvim.yml

Configuration structure

  • Entry point: .config/nvim/init.lua (sets up lua paths)
  • Plugin configs: .config/nvim/plugin/ (modular lua files)
    • editing.lua, git.lua, grep.lua, interface.lua, lsp.lua, mini.lua
    • system.lua, tab.lua, terminal.lua, treesitter.lua, window.lua
  • Treesitter queries: .config/nvim/queries/

Configuration guidelines

  • Prefer Lua for all Neovim configuration
  • Use modular approach: separate files in .config/nvim/plugin/ for different features
  • Use <Space> instead of <leader> for keybindings
  • Generally avoid plugins; prefer minimal, native configurations

Native package manager (vim.pack)

Install plugins using vim.pack.add() in plugin config files (nvim 0.12+):

vim.pack.add({
  { src = "https://github.com/user/plugin" },
})

Key details:

  • Plugins stored in $XDG_DATA_HOME/nvim/site/pack/core/opt
  • Optional version constraints: version = vim.version.range("1.0.0")
  • Check if loaded: local ok, plugin = pcall(require, "plugin-name")

Example from mini.lua:

vim.pack.add({
  { src = "https://github.com/nvim-mini/mini.nvim" },
})

local ok_bufremove, _ = pcall(require, "mini.bufremove")
if ok_bufremove then
  require("mini.bufremove").setup()
end

Building custom nvim releases

The repository includes infrastructure to build nvim nightly with bundled plugins:

Build system components

  • scripts/build-nvim.lua: lua script that downloads nvim nightly, bundles plugins, and creates tarballs
  • .config/nvim/nvim-pack-lock.json: lock file defining plugin versions
  • .github/workflows/build-nvim.yml: workflow to build for darwin-arm64, linux-arm64, linux-x64
  • requires luajit with dkjson (via .config/setup/luajit bootstrap)

Lock file format

{
  "plugins": {
    "plugin-name": {
      "src": "https://github.com/user/plugin",
      "rev": "commit-hash-or-tag"
    }
  }
}

Build process

  1. Downloads nvim nightly from neovim/neovim releases
  2. Clones each plugin from lock file at specified revision
  3. Installs plugins to share/nvim/site/pack/core/opt/
  4. Generates helptags with nvim --headless +'helptags ALL' +qa
  5. Creates reproducible tarball with checksums
  6. Verifies plugins load correctly

Running the build

# Locally (requires luajit with dkjson)
bash scripts/build-nvim

# Via GitHub workflow
gh workflow run build-nvim.yml -f create_release=false  # test build
gh workflow run build-nvim.yml -f release_tag=2025.11.23  # create release

Nvim wrapper and daemon management

The nvim wrapper at ~/.local/bin/nvim provides automatic server management with flexible socket configuration.

Socket configuration

  • Default socket: ~/.config/nvim/nvim.sock
  • Specify via CLI: nvim --server /path/to/socket.sock (uses nvim's native flag)
  • Specify via environment: NVIM_SOCKET=/path/to/socket.sock nvim
  • Priority: --server flag > NVIM_SOCKET env var > default

Client mode (nvim)

Automatically starts a daemon server if not running, then connects:

nvim file.txt                                    # uses default socket, auto-starts if needed
nvim --server /tmp/project.sock file.txt        # uses custom socket
nvim --remote-expr "execute('echo 42')"          # remote commands work too

Daemon management (nvimd)

Explicit daemon control commands:

nvimd start                                      # start server at default socket
nvimd --server /tmp/project.sock start           # start at custom socket
nvimd stop                                       # stop server
nvimd status                                     # check if running

Multiple servers

Each socket path gets its own daemon, pidfile, and logfile:

  • Socket: /path/to/foo.sock
  • Pidfile: /path/to/foo.pid
  • Logfile: /path/to/foo.log

Reloading configuration

To reload nvim configuration after making changes:

nvim --remote-expr "execute('source ~/.config/nvim/init.lua')"
# or with custom socket:
nvim --server /tmp/project.sock --remote-expr "execute('source ~/.config/nvim/init.lua')"

This sources the configuration in running nvim instances without restarting them.

04 同仓库更多 Skills

whilp
whilp/world

CleanShot 截图与 OCR 识别

screenshot

使用 CleanShot X 截图、屏幕录制、滚动截图和 OCR 文字识别。当用户请求截图、捕获、屏幕录制、OCR、文字提取或图像标注时使用。

普通用户屏幕截图与OCR识别
★ 10
whilp
whilp/world

Claude Code 技能编写指南

meta

编写和改进 Claude Code 技能的指南。用于创建新技能、调试技能为何未激活,或改进技能描述和结构。

AI 工程师插件与技能管理
★ 10
whilp
whilp/world

Karabiner 按键重映射配置

karabiner

配置和管理 Karabiner-Elements 按键重映射。用于修改 karabiner.json、添加按键重映射、创建复杂修改、管理配置方案、设置变量,或排查按键绑定问题。

软件开发工程师桌面自动化与界面操作
★ 10
whilp
whilp/world

Hammerspoon 自动化配置

hammerspoon

配置和管理 Hammerspoon 自动化、应用启动和窗口切换。用于处理 ~/.config/hammerspoon 配置文件、添加按键绑定、修改 leader 模态,或排查 Hammerspoon 功能问题。窗口管理由 AeroSpace 负责。

软件开发工程师桌面自动化与界面操作
★ 10
whilp
whilp/world

Ghostty 终端配置管理

ghostty

配置和管理 Ghostty 终端模拟器设置。用于修改 ghostty 配置、验证配置、检查窗口设置、主题、字体、按键绑定,或排查 ghostty 启动行为问题。

软件开发工程师开发环境与工具链管理
★ 10
whilp
whilp/world

GitHub Actions 工作流

gh-workflow

触发并监控 GitHub Actions 工作流、CI/CD 流水线与自动化构建。当运行工作流、触发 CI、通过 GitHub Actions 部署、下载构建产物,或在 github.com 上检查工作流状态时使用。

SRE 工程师部署与发布管理
★ 10