FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
codeium.vim/plugin/codeium.vim at main · Python-Repository-Hub/codeium.vim · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
Python-Repository-Hub
/
codeium.vim
Public
forked from
Exafunction/windsurf.vim
Notifications
You must be signed in to change notification settings
Fork
0
Star
2
Code
Pull requests
0
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
codeium.vim
/
plugin
/
codeium.vim
Copy path
More file actions
More file actions
Latest commit
History
History
History
115 lines (93 loc) · 3.82 KB
Breadcrumbs
codeium.vim
/
plugin
/
codeium.vim
Copy path
File metadata and controls
115 lines (93 loc) · 3.82 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
if
exists
(
'
g:loaded_codeium
'
)
finish
endif
let
g:
loaded_codeium
=
1
command
!
-
nargs
=? -
complete
=
customlist
,codeium#
command
#Complete Codeium
exe
codeium#command#Command
(
<q-args>
)
if
!
codeium#util#HasSupportedVersion
()
finish
endif
function
!
s:
SetStyle
()
abort
if
&
t_Co
==
256
hi
def
CodeiumSuggestion guifg
=
#
808080
ctermfg
=
244
else
hi
def
CodeiumSuggestion guifg
=
#
808080
ctermfg
=
8
endif
hi
def
link
CodeiumAnnotation
Normal
endfunction
function
!
s:
MapTab
()
abort
if
!
get
(
g:
,
'
codeium_no_map_tab
'
,
v:
false
)
&&
!
get
(
g:
,
'
codeium_disable_bindings
'
)
imap
<script>
<silent><nowait><expr>
<Tab>
codeium#Accept()
endif
endfunction
augroup
codeium
autocmd
!
autocmd
InsertEnter
,
CursorMovedI
,
CompleteChanged
*
call
codeium#DebouncedComplete
()
autocmd
BufEnter
*
if
codeium#Enabled
()|
call
codeium#command#StartLanguageServer
()|
endif
autocmd
BufEnter
*
if
mode
()
=
~#
'
^[iR]
'
|
call
codeium#DebouncedComplete
()|
endif
autocmd
InsertLeave
*
call
codeium#Clear
()
autocmd
BufLeave
*
if
mode
()
=
~#
'
^[iR]
'
|
call
codeium#Clear
()|
endif
autocmd
ColorScheme
,
VimEnter
*
call
s:
SetStyle
()
"
Map tab using vim enter so it occurs after all other sourcing.
autocmd
VimEnter
*
call
s:
MapTab
()
autocmd
VimLeave
*
call
codeium#ServerLeave
()
augroup
END
imap
<Plug>
(codeium-dismiss)
<Cmd>
call codeium#Clear()
<CR>
imap
<Plug>
(codeium-next)
<Cmd>
call codeium#CycleCompletions(1)
<CR>
imap
<Plug>
(codeium-next-or-complete)
<Cmd>
call codeium#CycleOrComplete()
<CR>
imap
<Plug>
(codeium-previous)
<Cmd>
call codeium#CycleCompletions(-1)
<CR>
imap
<Plug>
(codeium-complete)
<Cmd>
call codeium#Complete()
<CR>
if
!
get
(
g:
,
'
codeium_disable_bindings
'
)
if
empty
(
mapcheck
(
'
<C-]>
'
,
'
i
'
))
imap
<silent>
<script><nowait><expr>
<C-]>
codeium#Clear() . "\
<C-]>
"
endif
if
empty
(
mapcheck
(
'
<M-]>
'
,
'
i
'
))
imap
<M-]>
<Plug>
(codeium-next-or-complete)
endif
if
empty
(
mapcheck
(
'
<M-[>
'
,
'
i
'
))
imap
<M-[>
<Plug>
(codeium-previous)
endif
if
empty
(
mapcheck
(
'
<M-Bslash>
'
,
'
i
'
))
imap
<M-Bslash>
<Plug>
(codeium-complete)
endif
if
empty
(
mapcheck
(
'
<C-k>
'
,
'
i
'
))
imap
<script>
<silent><nowait><expr>
<C-k>
codeium#AcceptNextWord()
endif
if
empty
(
mapcheck
(
'
<C-l>
'
,
'
i
'
))
imap
<script>
<silent><nowait><expr>
<C-l>
codeium#AcceptNextLine()
endif
endif
call
s:
SetStyle
()
let
s:
dir
=
expand
(
'
<sfile>:h:h
'
)
if
getftime
(
s:
dir
.
'
/doc/codeium.txt
'
)
>
getftime
(
s:
dir
.
'
/doc/tags
'
)
silent
!
execute
'
helptags
'
fnameescape
(
s:
dir
.
'
/doc
'
)
endif
function
!
CodeiumEnable
()
"
Enable Codeium if it is disabled
let
g:
codeium_enabled
=
v:
true
call
codeium#command#StartLanguageServer
()
endfun
command
!
CodeiumEnable :
silent
!
call
CodeiumEnable
()
function
!
CodeiumDisable
()
"
Disable Codeium altogether
let
g:
codeium_enabled
=
v:
false
endfun
command
!
CodeiumDisable :
silent
!
call
CodeiumDisable
()
function
!
CodeiumToggle
()
if
exists
(
'
g:codeium_enabled
'
)
&&
g:
codeium_enabled
==
v:
false
call
CodeiumEnable
()
else
call
CodeiumDisable
()
endif
endfunction
command
!
CodeiumToggle :
silent
!
call
CodeiumToggle
()
function
!
CodeiumManual
()
"
Disable the automatic triggering of completions
let
g:
codeium_manual
=
v:
true
endfun
command
!
CodeiumManual :
silent
!
call
CodeiumManual
()
function
!
CodeiumAuto
()
"
Enable the automatic triggering of completions
let
g:
codeium_manual
=
v:
false
endfun
command
!
CodeiumAuto :
silent
!
call
CodeiumAuto
()
:
amenu
Plugin
.Codeium.Enable
\ \C
odeium
\ \(\:
CodeiumEnable
\)
:
call
CodeiumEnable
()
<Esc>
:
amenu
Plugin
.Codeium.Disable
\ \C
odeium
\ \(\:
CodeiumDisable
\)
:
call
CodeiumDisable
()
<Esc>
:
amenu
Plugin
.Codeium.Manual
\ \C
odeium
\ \A
I
\ \A
utocompletion
\ \(\:
CodeiumManual
\)
:
call
CodeiumManual
()
<Esc>
:
amenu
Plugin
.Codeium.Automatic
\ \C
odeium
\ \A
I
\ \C
ompletion
\ \(\:
CodeiumAuto
\)
:
call
CodeiumAuto
()
<Esc>
:
amenu
Plugin
.Codeium.Toggle
\ \C
odeium
\ \(\:
CodeiumToggle
\)
:
call
CodeiumToggle
()
<Esc>
Back
|
FazBrowse Home
|
New Git URL