Skip to content

Kaiser-Yang/blink-cmp-avante

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

blink-cmp-avante

Avante source for blink.cmp

Use @ to trigger the mention completion:

Accept the @file or @quickfix will open the selector for the file or quickfix list:

Use / to trigger the command completion:

Installation

Add the plugin to your packer managers, and make sure it is loaded before blink.cmp.

lazy.nvim

{
    'saghen/blink.cmp',
    dependencies = {
        'Kaiser-Yang/blink-cmp-avante',
        -- ... Other dependencies
    },
    opts = {
        sources = {
            -- Add 'avante' to the list
            default = { 'avante', 'lsp', 'path', 'luasnip', 'buffer' },
            providers = {
                avante = {
                    module = 'blink-cmp-avante',
                    name = 'Avante',
                    opts = {
                        -- options for blink-cmp-avante
                    }
                }
            },
        }
    }
}

Default Configuration

See default.lua.

Q&A

How to customize the highlight

Customize the BlinkCmpKindAvante to customize the highlight for kind icon, here is an example:

vim.api.nvim_set_hl(0, 'BlinkCmpKindAvante', { default = false, fg = '#89b4fa' })

How to customize different icons for mention and command

Firstly, you need to customize the get_kind_name, here is an example:

avante = {
    command = {
        get_kind_name = function(_)
            return 'AvanteCmd'
        end
    },
    mention = {
        get_kind_name = function(_)
            return 'AvanteMention'
        end
    }
}

Then, you should customize the kind_icons:

kind_icons = {
    AvanteCmd = '',
    AvanteMention = '',
}

Maybe, you want to customize the highlight for icons:

vim.api.nvim_set_hl(0, 'BlinkCmpKindAvanteCmd', { default = false, fg = '#89b4fa' })
vim.api.nvim_set_hl(0, 'BlinkCmpKindAvanteMention', { default = false, fg = '#89b4fa' })

Version Introduction

The release versions are something like major.minor.patch. When one of these numbers is increased:

  • patch: bugs are fixed or docs are added. This will not break the compatibility.
  • minor: compatible features are added. This may cause some configurations deprecated, but not break the compatibility.
  • major: incompatible features are added. All the deprecated configurations will be removed. This will break the compatibility.

Acknowledgment

Nice and fast completion plugin: blink.cmp.

About

Avante source for blink-cmp

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages