jonahgoldwastaken / copilot-status.nvim

Simple Copilot status indicator for Neovim
MIT License
24 stars 0 forks source link
copilot neovim neovim-plugin

copilot-status.nvim

A copilot.lua status indicator for Neovim.

Demo (status is shown in bottom right corner)

https://user-images.githubusercontent.com/23699599/211830740-1c6a07dd-bdf5-43f0-a35d-60e3c4584d44.mp4

Using Nonicons for the Copilot symbols and my unreleased Octocolors theme (coming soon...).

Requirements

(Minimal) installation

lazy.nvim

{
  "jonahgoldwastaken/copilot-status.nvim",
  dependencies = { "copilot.lua" } -- or "zbirenbaum/copilot.lua"
  lazy = true,
  event = "BufReadPost",
}

packer.nvim

use({
  "jonahgoldwastaken/copilot-status.nvim",
  after = { "zbirenbaum/copilot.lua" },
  event = "BufReadPost",
})

vim-plug

Plug "jonahgoldwastaken/copilot-status.nvim", { "branch": "main" }

Usage

copilot-status keeps track of two fields:

You can get these values with .status() and manipulate them yourself, or use the provided .status_string() function, which turns the status into an icon and appends the optional "message" if it exists. You can configure the icons yourself.

Example with lualine

require('lualine').setup {
  sections = {
    lualine_x = {
      function() return require("copilot_status").status_string() end,
      cnd = function() return require("copilot_status").enabled() end,
    }
  }
}

Configuration

copilot-status has little settings to adjust at the moment. Here are the defaults:

require('copilot_status').setup({
  icons = {
    idle = " ",
    error = " ",
    offline = " ",
    warning = "𥉉 ",
    loading = " ",
  },
  debug = false,
})

Make sure .setup() is run before .string() or .status_string(), otherwise the plugin will just ignore your configuration.

Acknowledgements