Skip to content

Latest commit

 

History

History
44 lines (32 loc) · 1.36 KB

File metadata and controls

44 lines (32 loc) · 1.36 KB

Agent guidelines for this Neovim config

Code style

  • Follow idiomatic Lua and Neovim plugin conventions.
  • Use require("...") for imports.
  • Prefer local modules and functions.
  • Use snake_case for variables and functions; PascalCase for modules.
  • Use early returns for error handling; avoid exceptions.
  • Add ---@param and similar Lua annotations for types when helpful.
  • Keep functions small and descriptive.
  • Use descriptive, lowercase file names (e.g., persist_colorscheme.lua).

Keymaps:

  • For keymap blocks with long lines, use -- stylua: ignore start ... -- stylua: ignore end comments around them. This prevents line wrapping.

  • Avoid inline functions that span more than one line.

    -- avoid
    vim.keymap.set("n", "<leader>xx", function()
      x()
      y()
    end, { desc = "xxx" })
    
    -- consider
    local function descriptive_name()
      x()
      y()
    end
    
    vim.keymap.set("n", "<leader>xx", descriptive_name, { desc = "xxx" })

Keymap descriptions:

  • Always have a desc for each keymap.
  • For keymaps that open a prompt, add ellipsis at the end. Eg, LSP: rename symbol…
  • For plugin keybindings, ensure desc is prefixed by the plugin, "Flash: jump to" rather than "Jump to".

Documentation

When working with mini.nvim, consult the website for documentation, not context7. See https://github.com/nvim-mini/mini.nvim/tree/main/readmes