Skip to content

Latest commit

 

History

History
40 lines (32 loc) · 861 Bytes

README.md

File metadata and controls

40 lines (32 loc) · 861 Bytes

codeowners.nvim

A plugin for working with .github/CODEOWNERS.

The plugin has the following methods:

  • require("codeowners").get_buf_owner() returns the codeowner of the current buffer.
  • require("codeowners").get_owner(fullpath) returns the codeowner of the file path.
  • require("codeowners").reset() resets the cache.

A user command :CodeownersReset can be used to reset the codeowners cache.

Example for adding current buffers codeowner to lualine.nvim:

-- lazy.nvim
{
  "nvim-lualine/lualine.nvim",
  event = "VeryLazy",
  opts = function(_, opts)
    table.insert(opts.sections.lualine_x, 1, {
      function()
        return require("codeowners").get_buf_owner()
      end,
    })
  end,
}

Installation

-- lazy.nvim
{
  "rsreimer/codeowners.nvim",
  config = function()
    require("codeowners").setup()
  end,
}