A copilot.lua status indicator for Neovim.
copilot_status.mp4
Using Nonicons for the Copilot symbols and my unreleased Octocolors theme (coming soon...).
- Neovim 0.8+
- copilot.lua
- A patched font or a font like Nonicons (which I recommend)
- A place where you can show the status indicator, like lualine
{
"jonahgoldwastaken/copilot-status.nvim",
dependencies = { "copilot.lua" } -- or "zbirenbaum/copilot.lua"
lazy = true,
event = "BufReadPost",
}
use({
"jonahgoldwastaken/copilot-status.nvim",
after = { "zbirenbaum/copilot.lua" },
event = "BufReadPost",
})
Plug "jonahgoldwastaken/copilot-status.nvim", { "branch": "main" }
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.
require('lualine').setup {
sections = {
lualine_x = {
function() return require("copilot_status").status_string() end,
cnd = function() return require("copilot_status").enabled() end,
}
}
}
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.
- copilot.lua for creating an incredibly easy API to work with
- Nonicons for providing great icons for this plug-in