Skip to content

jonahgoldwastaken/copilot-status.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

copilot-status.nvim

A copilot.lua status indicator for Neovim.

Demo (status is shown in bottom right corner)

copilot_status.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:

  • status which is one of
    • "offline"
    • "loading"
    • "idle"
    • "warning"
    • "error"
  • message which is only populated when an error occurs

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

  • copilot.lua for creating an incredibly easy API to work with
  • Nonicons for providing great icons for this plug-in

About

Simple Copilot status indicator for Neovim

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages