Skip to content

Commit

Permalink
plugin: Add extension for codeium
Browse files Browse the repository at this point in the history
closes #2653
Signed-off-by: Christian Brabandt <cb@256bit.org>
  • Loading branch information
IngoMeyer441 authored and chrisbra committed Oct 11, 2023
1 parent 0adefd0 commit 3854429
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
5 changes: 5 additions & 0 deletions autoload/airline/extensions.vim
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,11 @@ function! airline#extensions#load()
call add(s:loaded_ext, 'capslock')
endif

if (get(g:, 'airline#extensions#codeium#enabled', 1) && get(g:, 'loaded_codeium', 0))
call airline#extensions#codeium#init(s:ext)
call add(s:loaded_ext, 'codeium')
endif

if (get(g:, 'airline#extensions#gutentags#enabled', 1) && get(g:, 'loaded_gutentags', 0))
call airline#extensions#gutentags#init(s:ext)
call add(s:loaded_ext, 'gutentags')
Expand Down
17 changes: 17 additions & 0 deletions autoload/airline/extensions/codeium.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
" MIT License. Copyright (c) 2014-2021 Mathias Andersson et al.
" Plugin: https://github.com/Exafunction/codeium.vim
" vim: et ts=2 sts=2 sw=2

scriptencoding utf-8

if !get(g:, 'loaded_codeium', 0)
finish
endif

function! airline#extensions#codeium#status() abort
return '{…}' . codeium#GetStatusString()
endfunction

function! airline#extensions#codeium#init(ext) abort
call airline#parts#define_function('codeium', 'airline#extensions#codeium#status')
endfunction
3 changes: 2 additions & 1 deletion autoload/airline/init.vim
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ function! airline#init#bootstrap()

call airline#parts#define_text('bookmark', '')
call airline#parts#define_text('capslock', '')
call airline#parts#define_text('codeium', '')
call airline#parts#define_text('gutentags', '')
call airline#parts#define_text('gen_tags', '')
call airline#parts#define_text('grepper', '')
Expand Down Expand Up @@ -267,7 +268,7 @@ function! airline#init#sections()
let g:airline_section_gutter = airline#section#create(['%='])
endif
if !exists('g:airline_section_x')
let g:airline_section_x = airline#section#create_right(['coc_current_function', 'bookmark', 'scrollbar', 'tagbar', 'taglist', 'vista', 'gutentags', 'gen_tags', 'omnisharp', 'grepper', 'filetype'])
let g:airline_section_x = airline#section#create_right(['coc_current_function', 'bookmark', 'scrollbar', 'tagbar', 'taglist', 'vista', 'gutentags', 'gen_tags', 'omnisharp', 'grepper', 'codeium', 'filetype'])
endif
if !exists('g:airline_section_y')
let g:airline_section_y = airline#section#create_right(['ffenc'])
Expand Down
6 changes: 6 additions & 0 deletions doc/airline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,12 @@ coc <https://github.com/neoclide/coc.nvim>
* change the warning format (%C - error count, %L - line number): >
let airline#extensions#coc#stl_format_warn = '%C(L%L)'
<
------------------------------------- *airline-codeium*
vim-codeium <https://github.com/Exafunction/codeium.vim>

* enable/disable codeium.vim integration >
let g:airline#extensions#codeium#enabled = 1
------------------------------------- *airline-commandt*
command-t <https://github.com/wincent/command-t>

Expand Down

0 comments on commit 3854429

Please sign in to comment.