Skip to content
Munif Tanjim edited this page Nov 26, 2023 · 6 revisions

ℹ️ These integrations might not be optimized for performance.

local copilot = Item({
  ctx = { value = nil },
  init = function(item)
    require("copilot.api").register_status_notification_handler(function(data)
      item.ctx.value = data.status
      require("nougat.bar.util").refresh_statusline()
    end)
  end,
  prefix = " 🤖 ",
  content = function(item)
    return item.ctx.value
  end,
})
local lazy = Item({
  init = function(item)
    vim.api.nvim_create_autocmd("User", {
      group = vim.api.nvim_create_augroup("nougat.nut.integration.lazy", { clear = true }),
      pattern = { "LazyCheck", "LazyUpdate" },
      callback = function()
        item.value = require("lazy.status").updates()
      end,
    })
  end,
  hidden = function(item)
    return item.value == false
  end,
  prefix = " ",
  content = function(item)
    if item.value == nil then
      item.value = require("lazy.status").updates()
    end
    return item.value
  end,
  suffix = " ",
  on_click = function()
    require("lazy").update()
  end,
})
local navic = Item({
  hidden = function()
    return not require("nvim-navic").is_available()
  end,
  content = function()
    return require("nvim-navic").get_location()
  end,
})
Clone this wiki locally