搜索

PythonReactSEOPDF
GitHub Skill

add-plugin

Add a new lazy.nvim plugin spec following project conventions

ThorstenRhau☆ 37 仓库 Stars0 仓库 Forks

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

查看来源 ↗使用指南

技能说明

When adding a new plugin spec to this Neovim config, follow these conventions exactly:

File placement

Put the spec in lua/plugins/<category>.lua based on the plugin's purpose:

  • Editing aids → editor.lua
  • Git tools → git.lua
  • LSP/completion → lsp.lua or completion.lua
  • UI/appearance → ui.lua
  • Fuzzy finding/navigation → picker.lua
  • Treesitter-related → treesitter.lua
  • If unsure, look at existing file categories

Spec format

Always use declarative opts = {} instead of config = function() unless setup requires conditional logic or calling multiple functions.

{
  'author/plugin-name',
  event = 'VeryLazy',  -- or appropriate lazy-load trigger
  dependencies = {},
  opts = {
    -- plugin options here
  },
  keys = {
    { '<leader>xx', '<cmd>PluginCmd<cr>', desc = 'Plugin: action description' },
  },
},

Required conventions

  1. Lazy loading: always use event, cmd, or keys triggers. Only use lazy = false for plugins that must load at startup (colorscheme, etc.).

  2. Keymaps: every keymap entry must have a desc field. Use the format 'Category: action' (e.g. 'Git: open neogit', 'LSP: rename symbol').

  3. Border: set border = 'single' for any UI component that accepts it (floating windows, pickers, hover docs, etc.).

  4. Leader prefix: group related keymaps under a <leader><letter> prefix. Check lua/config/keymaps.lua to see existing prefixes and avoid conflicts.

  5. Style: 2-space indent, single quotes, trailing commas after every item. StyLua enforces this, but match it manually for consistency.

Example: adding a new picker integration

{
  'author/new-picker',
  cmd = 'NewPicker',
  opts = {
    border = 'single',
    layout = { width = 0.8, height = 0.6 },
  },
  keys = {
    { '<leader>fp', '<cmd>NewPicker<cr>', desc = 'Picker: find something' },
  },
},

After adding, run make all to validate formatting and lint.

使用示例

查看来源仓库中的使用示例与配置说明。

查看来源 ↗

来源历史

收录时间
2026-03-11
索引更新时间
2026-03-11
Branch
main

收录与同步日期属于本站记录。源码修改历史请查看来源仓库。

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!