/copilot-lualine

This is a component which makes a status icon for copilot.lua

Primary LanguageLuaMIT LicenseMIT

copilot-lualine

Component for lualine with the purpose of recieving and previewing status of copilot.lua

show_colors = false - This are the default icons (All can be changed)

show_colors = true - This are the default colors (All can be changed)

Requirements

Installation

Using lazy.nvim

{ 'AndreM222/copilot-lualine' }

Using packer.nvim

use 'AndreM222/copilot-lualine'

Using vim-plug

Plug 'AndreM222/copilot-lualine'

Setup

Add the component copilot to one of your lualine sections. example:

lualine.setup({
    options = {
        icons_enabled = true,
        theme = cozynight,
        component_separators = { left = '', right = '' },
        section_separators = { left = '', right = '' },
        disabled_filetypes = {},
        always_divide_middle = true
    },
    sections = {
        lualine_a = { 'mode' },
        lualine_b = { 'branch', 'diff',
            {
                'diagnostics',
                sources = { "nvim_diagnostic" },
                symbols = { error = '', warn = '', info = '', hint = '' }
            }
        },
        lualine_c = { 'filename' },
        lualine_x = { 'copilot' ,'encoding', 'fileformat', 'filetype' }, -- I added copilot here
        lualine_y = { 'progress' },
        lualine_z = { 'location' }
    },
    inactive_sections = {
        lualine_a = {},
        lualine_b = {},
        lualine_c = { 'filename' },
        lualine_x = { 'location' },
        lualine_y = {},
        lualine_z = {}
    },
    tabline = {},
    extensions = {}
})

Customization is available. For example:

sections = {
    lualine_x = {
        {
            'copilot',
            -- Default values
            symbols = {
                status = {
                    icons = {
                        enabled = "",
                        sleep = "",   -- auto-trigger disabled
                        disabled = "",
                        warning = "",
                        unknown = ""
                    },
                    hl = {
                        enabled = "#50FA7B",
                        sleep = "#AEB7D0",
                        disabled = "#6272A4",
                        warning = "#FFB86C",
                        unknown = "#FF5555"
                    }
                },
                spinners = require("copilot-lualine.spinners").dots,
                spinner_color = "#6272A4"
            },
            show_colors = false,
            show_loading = true
        },
        'encoding',
        'fileformat',
        'filetype'
    }
}

If you desire to use the colors of a highlight group, there is a function you can call for that usage:

hl = {
    enabled = require('copilot-lualine.colors').get_hl_value(0, "DiagnosticWarn", "fg"), -- hl value
    sleep = "#AEB7D0",
    disabled = "#6272A4",
    warning = "#FFB86C",
    unknown = "#FF5555"
}

Contributors

Thanks everyone for the support